diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2004-07-11 15:20:35 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-07-11 15:20:35 +0000 |
commit | 59767029a969b4cea2eacb38cb27fd784937f72e (patch) | |
tree | 3b2a8024048201998ce61d58a3df876258d8b9ad /phpBB/includes/functions_posting.php | |
parent | 6a6910650103980c5741e9958c6067b0de772d24 (diff) | |
download | forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar.gz forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar.bz2 forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar.xz forums-59767029a969b4cea2eacb38cb27fd784937f72e.zip |
- fixed permissions for mcp (global permission settings are false if user is only able to moderate one to x forums)
- determine permission settings for submodules
- further approve/disapprove work (approve_details added)
git-svn-id: file:///svn/phpbb/trunk@4925 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 720a91ed86..d793e66586 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -928,4 +928,89 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) } } +// Topic Review +function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) +{ + global $user, $auth, $db, $template, $bbcode, $template; + global $config, $phpbb_root_path, $phpEx, $SID; + + // Go ahead and pull all data for this topic + $sql = 'SELECT u.username, u.user_id, u.user_karma, p.post_id, p.post_username, p.post_subject, p.post_text, p.enable_smilies, p.bbcode_uid, p.bbcode_bitfield, p.post_time + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE p.topic_id = $topic_id + AND p.poster_id = u.user_id + " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . ' + ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . ' + ORDER BY p.post_time DESC'; + $result = $db->sql_query_limit($sql, $config['posts_per_page']); + + if (!$row = $db->sql_fetchrow($result)) + { + return false; + } + + $bbcode_bitfield = 0; + do + { + $rowset[] = $row; + $bbcode_bitfield |= $row['bbcode_bitfield']; + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + + // Instantiate BBCode class + if (!isset($bbcode) && $bbcode_bitfield) + { + include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); + $bbcode = new bbcode($bbcode_bitfield); + } + + foreach ($rowset as $i => $row) + { + $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']; + $message = $row['post_text']; + + if ($row['bbcode_bitfield']) + { + $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); + } + + $message = smilie_text($message, !$row['enable_smilies']); + + $post_subject = censor_text($post_subject); + $message = censor_text($message); + + $template->assign_block_vars($mode . '_row', array( + 'POSTER_NAME' => $poster, + 'POST_SUBJECT' => $post_subject, + 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), + 'POST_DATE' => $user->format_date($row['post_time']), + 'MESSAGE' => str_replace("\n", '<br />', $message), + + 'U_POST_ID' => $row['post_id'], + 'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#' . $row['post_id'], + 'U_MCP_DETAILS' => ($auth->acl_get('m_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', + 'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_quote', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . str_replace("'", "\\'", $poster) . "')" : '') + ); + unset($rowset[$i]); + } + + if ($mode == 'topic_review') + { + $template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE'])); + } + + return true; +} + ?>
\ No newline at end of file |