aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2003-02-28 12:57:10 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2003-02-28 12:57:10 +0000
commite42a20b32e18162afd3847a9849fe4760491d437 (patch)
tree3ee333cd83ac0409238f68f98c0ea0d0892a06b0 /phpBB/includes/functions_posting.php
parentb5031760af3f5f803cd5bc836fec00dbc7c016a7 (diff)
downloadforums-e42a20b32e18162afd3847a9849fe4760491d437.tar
forums-e42a20b32e18162afd3847a9849fe4760491d437.tar.gz
forums-e42a20b32e18162afd3847a9849fe4760491d437.tar.bz2
forums-e42a20b32e18162afd3847a9849fe4760491d437.tar.xz
forums-e42a20b32e18162afd3847a9849fe4760491d437.zip
minor changes, re-added topicreview
git-svn-id: file:///svn/phpbb/trunk@3575 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php128
1 files changed, 127 insertions, 1 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index df0e07f433..30350513cb 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -169,7 +169,133 @@ function decode_text(&$message)
// Quote Text
function quote_text(&$message, $username = '')
{
- $message = ' [quote' . ( (empty($username)) ? ']' : '="]' . addslashes(trim($username)) . '"]') . trim($message) . '[/quote] ';
+ $message = ' [quote' . ( (empty($username)) ? ']' : '="' . addslashes(trim($username)) . '"]') . trim($message) . '[/quote] ';
+}
+
+// Topic Review
+function topic_review($topic_id, $is_inline_review = false)
+{
+ global $SID, $db, $config, $template, $user, $auth, $phpEx, $phpbb_root_path, $starttime;
+ global $censors;
+
+ // Define censored word matches
+ if (empty($censors))
+ {
+ $censors = array();
+ obtain_word_list($censors);
+ }
+
+ if (!$is_inline_review)
+ {
+ // Get topic info ...
+ $sql = "SELECT t.topic_title, f.forum_id
+ FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
+ WHERE t.topic_id = $topic_id
+ AND f.forum_id = t.forum_id";
+ $result = $db->sql_query($sql);
+
+ if (!($row = $db->sql_fetchrow($result)))
+ {
+ trigger_error($user->lang['NO_TOPIC']);
+ }
+
+ $forum_id = intval($row['forum_id']);
+ $topic_title = $row['topic_title'];
+
+ if (!$auth->acl_gets('f_read', 'm_', 'a_', $forum_id))
+ {
+ trigger_error($user->lang['SORRY_AUTH_READ']);
+ }
+
+ if (count($orig_word))
+ {
+ $topic_title = preg_replace($censors['match'], $censors['replace'], $topic_title);
+ }
+ }
+ else
+ {
+ $template->assign_vars(array(
+ 'S_DISPLAY_INLINE' => true)
+ );
+ }
+
+ // Go ahead and pull all data for this topic
+ $sql = "SELECT u.username, u.user_id, p.*
+ FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u
+ WHERE p.topic_id = $topic_id
+ AND p.poster_id = u.user_id
+ ORDER BY p.post_time DESC
+ LIMIT " . $config['posts_per_page'];
+ $result = $db->sql_query($sql);
+
+ // Okay, let's do the loop, yeah come on baby let's do the loop
+ // and it goes like this ...
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $i = 0;
+ do
+ {
+ $poster_id = $row['user_id'];
+ $poster = $row['username'];
+
+ // Handle anon users posting with usernames
+ if($poster_id == ANONYMOUS && $row['post_username'] != '')
+ {
+ $poster = $row['post_username'];
+ $poster_rank = $user->lang['GUEST'];
+ }
+
+ $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : '';
+
+ $message = $row['post_text'];
+
+ if ($row['enable_smilies'])
+ {
+ $message = str_replace('<img src="{SMILE_PATH}', '<img src="' . $phpbb_root_path . $config['smilies_path'], $message);
+ }
+
+ if (count($orig_word))
+ {
+ $post_subject = preg_replace($censors['match'], $censors['replace'], $post_subject);
+ $message = preg_replace($censors['match'], $censors['replace'], $message);
+ }
+
+ $template->assign_block_vars('postrow', array(
+ 'MINI_POST_IMG' => $user->img('goto_post', $user->lang['POST']),
+ 'POSTER_NAME' => $poster,
+ 'POST_DATE' => $user->format_date($row['post_time']),
+ 'POST_SUBJECT' => $post_subject,
+ 'MESSAGE' => nl2br($message),
+
+ 'S_ROW_COUNT' => $i++)
+ );
+ }
+ while ($row = $db->sql_fetchrow($result));
+ }
+ else
+ {
+ trigger_error($user->lang['NO_TOPIC']);
+ }
+ $db->sql_freeresult($result);
+
+ $template->assign_vars(array(
+ 'L_MESSAGE' => $user->lang['MESSAGE'],
+ 'L_POSTED' => $user->lang['POSTED'],
+ 'L_POST_SUBJECT'=> $user->lang['POST_SUBJECT'],
+ 'L_TOPIC_REVIEW'=> $user->lang['TOPIC_REVIEW'])
+ );
+
+ if (!$is_inline_review)
+ {
+ $page_title = $user->lang['TOPIC_REVIEW'] . ' - ' . $topic_title;
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
+
+ $template->set_filenames(array(
+ 'body' => 'posting_topic_review.html')
+ );
+
+ include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
+ }
}
?> \ No newline at end of file