aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2003-03-06 02:03:37 +0000
committerLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2003-03-06 02:03:37 +0000
commit9e9d126a6a39e678342ff8fcd6f762f9e3a02f97 (patch)
tree3df79ed3aed114b47bb6644dc763c82f072a187d /phpBB
parent553087d0aa8d25d98930a034f3aa886744dd5937 (diff)
downloadforums-9e9d126a6a39e678342ff8fcd6f762f9e3a02f97.tar
forums-9e9d126a6a39e678342ff8fcd6f762f9e3a02f97.tar.gz
forums-9e9d126a6a39e678342ff8fcd6f762f9e3a02f97.tar.bz2
forums-9e9d126a6a39e678342ff8fcd6f762f9e3a02f97.tar.xz
forums-9e9d126a6a39e678342ff8fcd6f762f9e3a02f97.zip
More "reporting" stuff, note the very lame warning in viewtopic when a post has been reported.
git-svn-id: file:///svn/phpbb/trunk@3604 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/language/en/lang_main.php46
-rw-r--r--phpBB/mcp.php220
-rw-r--r--phpBB/report.php162
-rw-r--r--phpBB/templates/subSilver/mcp_forum.html2
-rw-r--r--phpBB/templates/subSilver/mcp_topic.html20
-rw-r--r--phpBB/templates/subSilver/report.html54
-rw-r--r--phpBB/templates/subSilver/viewtopic_body.html12
7 files changed, 399 insertions, 117 deletions
diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php
index 754b16e335..dca8383ec3 100644
--- a/phpBB/language/en/lang_main.php
+++ b/phpBB/language/en/lang_main.php
@@ -29,7 +29,7 @@
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
-$lang = array_merge($lang, array(
+$lang = array(
'ENCODING' => 'iso-8859-15',
'DIRECTION' => 'ltr',
'LEFT' => 'left',
@@ -70,8 +70,6 @@ $lang = array_merge($lang, array(
'GO' => 'Go',
'JUMP_TO' => 'Jump to',
- 'SEARCH_FOR' => 'Search for',
-
'SUBMIT' => 'Submit',
'RESET' => 'Reset',
'CANCEL' => 'Cancel',
@@ -83,6 +81,7 @@ $lang = array_merge($lang, array(
'NO' => 'No',
'ENABLED' => 'Enabled',
'DISABLED' => 'Disabled',
+ 'SELECT' => 'Select',
'ERROR' => 'Error',
'NEXT' => 'Next',
'PREVIOUS' => 'Previous',
@@ -281,6 +280,8 @@ $lang = array_merge($lang, array(
'VIEW_IP' => 'IP',
'DELETE_POST' => 'Delete',
'DELETE_POST_WARN' => 'Once deleted the post cannot be recovered',
+ 'REPORT_TO_ADMIN' => 'Report this post',
+ 'POST_BEEN_REPORTED' => 'This post has been reported',
'wrote' => 'wrote',
'Quote' => 'Quote',
'Code' => 'Code',
@@ -784,43 +785,6 @@ $lang = array_merge($lang, array(
'Viewing_priv_msgs' => 'Viewing Private Messages',
'Viewing_FAQ' => 'Viewing FAQ',
-
- 'MOD_CP' => 'Moderator Control Panel',
- 'MOD_CP_EXPLAIN' => 'Using the form below you can perform mass moderation operations on this forum. You can lock, unlock, move or delete any number of topics.',
- 'SELECT' => 'Select',
- 'MOVE' => 'Move',
- 'LOCK' => 'Lock',
- 'UNLOCK' => 'Unlock',
- 'Topics_Removed' => 'The selected topics have been successfully removed from the database.',
- 'Topics_Locked' => 'The selected topics have been locked',
- 'Topics_Moved' => 'The selected topics have been moved',
- 'Topics_Unlocked' => 'The selected topics have been unlocked',
- 'No_Topics_Moved' => 'No topics were moved',
- 'Confirm_delete_topic' => 'Are you sure you want to remove the selected topic/s?',
- 'Confirm_lock_topic' => 'Are you sure you want to lock the selected topic/s?',
- 'Confirm_unlock_topic' => 'Are you sure you want to unlock the selected topic/s?',
- 'Confirm_move_topic' => 'Are you sure you want to move the selected topic/s?',
- 'Move_to_forum' => 'Move to forum',
- 'Leave_shadow_topic' => 'Leave shadow topic in old forum.',
- 'Split_Topic' => 'Split Topic Control Panel',
- 'Split_Topic_explain' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post',
- 'Split_title' => 'New topic title',
- 'Split_forum' => 'Forum for new topic',
- 'Split_posts' => 'Split selected posts',
- 'Split_after' => 'Split from selected post',
- 'Topic_split' => 'The selected topic has been split successfully',
- 'Too_many_error' => 'You have selected too many posts. You can only select one post to split a topic after!',
- 'None_selected' => 'You have no selected any topics to preform this operation on. Please go back and select at least one.',
- 'New_forum' => 'New forum',
- 'This_posts_IP' => 'IP for this post',
- 'Other_IP_this_user' => 'Other IP\'s this user has posted from',
- 'Users_this_IP' => 'Users posting from this IP',
- 'IP_info' => 'IP Information',
- 'Lookup_IP' => 'Look up IP',
-
- 'logm_lock' => 'Locked following topic/s => %s',
-
-
'All_times' => 'All times are %s %s',
'-13' => 'GMT - 13 Hours',
'-12' => 'GMT - 12 Hours',
@@ -943,5 +907,5 @@ $lang = array_merge($lang, array(
'Critical_Error' => 'Critical Error',
'An_error_occured' => 'An Error Occurred',
'A_critical_error' => 'A Critical Error Occurred'
-));
+);
?> \ No newline at end of file
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index 2e5ca3634c..358759bf54 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -57,6 +57,16 @@ $user->setup();
$auth->acl($user->data);
// End session management
+
+/**
+$sql = 'SELECT auth_option_id, auth_value FROM phpbb_auth_options';
+$result = $db->sql_query($sql);
+while ($row=$db->sql_fetchrow($result))
+{
+ echo "$row[auth_option_id] $row[auth_value] => " . $auth->acl_get($row['auth_value'], 2) . "<br/>";
+}
+/**/
+
// temp temp temp
very_temporary_lang_strings();
// temp temp temp
@@ -69,17 +79,18 @@ $topic_id = (!empty($_REQUEST['t'])) ? intval($_REQUEST['t']) : '';
$post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : '';
$start = (!empty($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0;
+
//
// Check if user did or did not confirm
// If they did not, forward them to the last page they were on
//
if (isset($_POST['cancel']))
{
- if ($topic_id)
+ if ($topic_id > 0)
{
$redirect = "viewtopic.$phpEx$SID&t=$topic_id&amp;start=$start";
}
- elseif ($forum_id)
+ elseif ($forum_id > 0)
{
$redirect = "viewforum.$phpEx$SID&f=$forum_id&amp;start=$start";
}
@@ -116,6 +127,22 @@ foreach ($post_modes as $post_mode)
}
}
+// Cleanse inputted values
+foreach ($_POST['topic_id_list'] as $t_id)
+{
+ if ($t_id = intval($t_id))
+ {
+ $topic_id_list[] = $t_id;
+ }
+}
+foreach ($_POST['post_id_list'] as $p_id)
+{
+ if ($p_id = intval($p_id))
+ {
+ $post_id_list[] = $p_id;
+ }
+}
+
// Build short_id_list and $return string
$selected_post_ids = array();
if (!empty($_GET['post_id_list']))
@@ -128,7 +155,7 @@ if (!empty($_GET['post_id_list']))
$post_id_list[] = base_convert($short, 36, 10);
}
}
-$url_extra = (!empty($selected_post_ids)) ? '&amp;post_id_list=' . short_id_list($selected_post_ids) : '';
+$url_extra = (!empty($post_id_list)) ? '&amp;post_id_list=' . short_id_list($post_id_list ) : '';
$return_mcp = '<br /><br />' . sprintf($user->lang['RETURN_MCP'], '<a href="mcp.' . $phpEx . $SID . '">', '</a>');
// Build up return links and acl list
@@ -208,26 +235,9 @@ if ($to_forum_id > 0)
}
}
-// Cleanse inputted values then get permissions
-foreach ($_POST['topic_id_list'] as $t_id)
-{
- if ($t_id = intval($t_id))
- {
- $topic_id_list[] = $t_id;
- }
-}
-foreach ($_POST['post_id_list'] as $p_id)
-{
- if ($p_id = intval($p_id))
- {
- $post_id_list[] = $p_id;
- }
-}
-
+// Reset id lists then rebuild them from verified data
$topic_id_sql = implode(', ', array_unique($topic_id_list));
$post_id_sql = implode(', ', array_unique($post_id_list));
-
-// Reset id lists then rebuild them
$forum_id_list = $topic_id_list = $post_id_list = array();
$not_moderator = FALSE;
@@ -334,7 +344,7 @@ else
{
// There's no forums list available so the user either submitted an empty or invalid list of posts/topics or isn't a moderator
- if ($not_moderator)
+ if ($not_moderator || !$auth->acl_gets('m_', 'a_'))
{
trigger_error('Line : ' . __LINE__ . '<br/><br/>' . 'Not_Moderator');
}
@@ -344,7 +354,7 @@ else
if (!in_array($mode, $forumless_modes))
{
// The user has submitted invalid post_ids or topic_ids
- trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['Topic_post_not_exist'] . $return_mcp);
+ trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['TOPIC_NOT_EXIST'] . $return_mcp);
}
}
}
@@ -365,8 +375,8 @@ else
$mcp_url = "mcp.$phpEx$SID";
$tabs = array(
'front' => $mcp_url,
- 'mod_queue' => $mcp_url . '&amp;mode=mod_queue',
- 'post_reports' => $mcp_url . '&amp;mode=post_reports'
+ 'mod_queue' => $mcp_url . '&amp;f=' . $forum_id . '&amp;mode=mod_queue',
+ 'post_reports' => $mcp_url . '&amp;f=' . $forum_id . '&amp;mode=post_reports'
);
$mcp_url .= ($forum_id) ? '&amp;f=' . $forum_id : '';
@@ -377,7 +387,7 @@ $return_mcp = '<br /><br />' . sprintf($user->lang['RETURN_MCP'], '<a href="' .
if ($forum_id)
{
- $tabs['forum_view'] = $mcp_url . '&amp;mode=forum_view' . $url_extra;
+ $tabs['forum_view'] = $mcp_url . '&amp;mode=forum_view';
}
if ($topic_id)
{
@@ -385,7 +395,7 @@ if ($topic_id)
}
if ($post_id)
{
- $tabs['post_details'] = $mcp_url . '&amp;mode=post_details' . $url_extra;
+ $tabs['post_details'] = $mcp_url . '&amp;mode=post_details';
}
if (!$forum_info['forum_postable'])
{
@@ -421,9 +431,16 @@ if (!$mode)
switch ($mode)
{
+ case 'select_topic':
+ if ($url_extra)
+ {
+ $tabs['merge'] = $mcp_url . '&amp;mode=merge' . $url_extra;
+ }
+ break;
+
case 'merge':
case 'split':
- $tabs[$mode] = $mcp_url . '&amp=' . $mode;
+ $tabs[$mode] = $mcp_url . '&amp;=' . $mode . $url_extra;
break;
}
// Get the current tab from the mode
@@ -537,7 +554,7 @@ switch ($mode)
'L_YES' => $user->lang['YES'],
'L_NO' => $user->lang['NO'],
- 'S_CONFIRM_ACTION' => $mcp_url . '&amp;mode=delete_posts',
+ 'S_CONFIRM_ACTION' => "mcp.$phpEx$SID&amp;mode=delete_posts",
'S_HIDDEN_FIELDS' => $hidden_fields
));
break;
@@ -587,16 +604,11 @@ switch ($mode)
'L_YES' => $user->lang['YES'],
'L_NO' => $user->lang['NO'],
- 'S_CONFIRM_ACTION' => $mcp_url . '&amp;mode=delete' . (($quickmod) ? '&amp;quickmod=1' : ''),
+ 'S_CONFIRM_ACTION' => "mcp.$phpEx$SID&amp;mode=delete" . (($quickmod) ? '&amp;quickmod=1' : ''),
'S_HIDDEN_FIELDS' => $hidden_fields
));
break;
- case 'select_topic':
- $post_id_str = short_id_list($post_id_list);
- redirect(str_replace('&amp;', '&', $mcp_url) . '&mode=forum_view&post_id_list=' . $post_id_str);
- break;
-
case 'merge':
case 'split':
case 'delete':
@@ -605,13 +617,14 @@ switch ($mode)
$posts_per_page = (isset($_REQUEST['posts_per_page'])) ? intval($_REQUEST['posts_per_page']) : $config['posts_per_page'];
+/*
// Temp fix for merge: display all posts after the topic has been selected to avoid any confusion
if ($to_topic_id)
{
$sort_days = 0;
$posts_per_page = 0;
}
-
+*/
// Following section altered for consistency with viewforum, viewtopic, etc.
// Post ordering options
@@ -688,13 +701,11 @@ switch ($mode)
'POST_ID' => $row['post_id'],
'S_CHECKBOX' => $s_checkbox,
- 'ROW_CLASS' => ($i % 2) ? 'row2' : 'row1',
+ 'S_ROW_COUNT' => $i++,
'S_DISPLAY_MODES' => ($i % 10 == 0) ? TRUE : FALSE,
'U_POST_DETAILS' => $mcp_url . '&amp;p=' . $row['post_id'] . '&amp;mode=post_details'
));
-
- ++$i;
}
if ($mode == 'topic_view' || $mode == 'split')
@@ -733,8 +744,8 @@ switch ($mode)
'POSTS_PER_PAGE' => $posts_per_page,
- 'S_FORM_ACTION' => $mcp_url . '&amp;mode=' . $mode,
- 'S_FORUM_SELECT' => '<select name="to_forum_id">' . make_forum_select() . '</select>',
+ 'S_FORM_ACTION' => "mcp.$phpEx$SID&amp;mode=$mode&amp;t=$topic_id&amp;start=$start",
+ 'S_FORUM_SELECT' => '<select name="to_forum_id">' . make_forum_select($to_forum_id) . '</select>',
'S_CAN_SPLIT' => ($auth->acl_gets('m_split', 'a_', $forum_id) &&($mode == 'topic_view' || $mode == 'split')) ? TRUE : FALSE,
'S_CAN_MERGE' => ($auth->acl_gets('m_merge', 'a_', $forum_id) &&($mode == 'topic_view' || $mode == 'merge')) ? TRUE : FALSE,
'S_CAN_DELETE' => ($auth->acl_gets('m_delete', 'a_', $forum_id) &&($mode == 'topic_view' || $mode == 'delete')) ? TRUE : FALSE,
@@ -743,7 +754,7 @@ switch ($mode)
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS'=> $s_limit_days,
- 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination("$mcp_url&amp;mode=$mode&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total_posts, $posts_per_page, $start)
+ 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination("mcp.$phpEx$SID&amp;t=$topic_id&amp;mode=$mode&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total_posts, $posts_per_page, $start)
));
break;
@@ -753,7 +764,7 @@ switch ($mode)
$template->assign_vars(array(
'FORUM_NAME' => $forum_info['forum_name'],
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=$forum_id",
- 'S_FORM_ACTION' => $mcp_url
+ 'S_FORM_ACTION' => "mcp.$phpEx$SID"
));
$sql = 'SELECT u.username, p.*
@@ -899,23 +910,60 @@ switch ($mode)
if (!$subject)
{
- trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['Empty_subject'] . $return_split);
+ trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['EMPTY_SUBJECT'] . $return_split);
}
- if (!$to_forum_id)
+ if ($to_forum_id <= 0)
{
trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['SELECT_DESTINATION_FORUM'] . $return_split);
}
if ($mode == 'split_beyond')
{
- // TODO: this method only works when posts are displayed in chronological order
+ $sort_by_sql = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'p.post_subject');
+ $sort_days = (!empty($_REQUEST['st'])) ? max(intval($_REQUEST['st']), 0) : 0;
+ $sort_key = (!empty($_REQUEST['sk'])) ? htmlspecialchars($_REQUEST['sk']) : 't';
+ $sort_dir = (!empty($_REQUEST['sd'])) ? htmlspecialchars($_REQUEST['sd']) : 'a';
+ $sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+
+ $s_limit_days = $s_sort_key = $s_sort_dir = '';
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir);
+
+ if ($sort_days)
+ {
+ $min_post_time = time() - ($sort_days * 86400);
+
+ $sql = 'SELECT COUNT(post_id) AS num_posts
+ FROM ' . POSTS_TABLE . "
+ WHERE topic_id = $topic_id
+ AND post_time >= $min_post_time";
+ $result = $db->sql_query($sql);
+
+ $total_posts = ($row = $db->sql_fetchrow($result)) ? $row['num_posts'] : 0;
+ $limit_posts_time = "AND p.post_time >= $min_post_time ";
+ }
+ else
+ {
+ $limit_posts_time = '';
+ $total_posts = $topic_info['topic_replies'] + 1;
+ }
+
+ $sql = 'SELECT p.post_id
+ FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
+ WHERE p.topic_id = $topic_id
+ AND p.poster_id = u.user_id
+ $limit_posts_time
+ ORDER BY $sort_order
+ LIMIT $start, -1";
+ $result = $db->sql_query($sql);
+
+/*
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND post_id >= $post_id";
$result = $db->sql_query($sql);
-
+*/
$post_id_list = array();
while ($row = $db->sql_fetchrow($result))
{
@@ -928,6 +976,7 @@ switch ($mode)
trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['None_selected'] . $return_split);
}
+/*
$icon_id = (!empty($_POST['icon'])) ? intval($_POST['icon']) : 0;
$sql = 'INSERT INTO ' . TOPICS_TABLE . " (forum_id, topic_title, icon_id, topic_approved)
VALUES ($to_forum_id, '" . $db->sql_escape($subject) . "', $icon_id, 1)";
@@ -935,6 +984,7 @@ switch ($mode)
$to_topic_id = $db->sql_nextid();
move_posts($post_id_list, $to_topic_id);
+*/
$return_url = '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&amp;t=' . $topic_id . '">', '</a>');
$return_url .= '<br /><br />' . sprintf($user->lang['CLICK_GO_NEW_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&amp;t=' . $to_topic_id . '">', '</a>');
@@ -1032,21 +1082,27 @@ switch ($mode)
$db->sql_freeresult($result);
break;
+
+ case 'select_topic':
+/* $post_id_str = short_id_list($post_id_list);
+ redirect(str_replace('&amp;', '&', $mcp_url) . '&mode=forum_view&post_id_list=' . $post_id_str);
+ break;
+*/
+
case 'forum_view':
mcp_header('mcp_forum.html', TRUE);
$template->assign_vars(array(
'FORUM_NAME' => $forum_info['forum_name'],
- 'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id),
- 'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id),
- 'S_CAN_LOCK' => $auth->acl_get('m_lock', $forum_id),
- 'S_CAN_UNLOCK' => $auth->acl_get('m_unlock', $forum_id),
- 'S_CAN_RESYNC' => $auth->acl_gets('m_', 'a_', $forum_id),
+ 'S_CAN_DELETE' => $auth->acl_gets('a_', 'm_delete', $forum_id),
+ 'S_CAN_MOVE' => $auth->acl_gets('a_', 'm_move', $forum_id),
+ 'S_CAN_LOCK' => $auth->acl_gets('a_', 'm_lock', $forum_id),
+ 'S_CAN_RESYNC' => $auth->acl_gets('a_', 'm_', $forum_id),
- 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=$forum_id",
- 'S_HIDDEN_FIELDS' => '<input type="hidden" name="f" value="' . $forum_id . '">',
- 'S_MCP_ACTION' => $mcp_url
+ 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=$forum_id",
+ 'S_HIDDEN_FIELDS' => '<input type="hidden" name="f" value="' . $forum_id . '">',
+ 'S_MCP_ACTION' => "mcp.$phpEx$SID"
));
// Define censored word matches
@@ -1116,17 +1172,17 @@ switch ($mode)
}
$template->assign_block_vars('topicrow', array(
- 'U_VIEW_TOPIC' => $mcp_url . '&amp;t=' . $row['topic_id'] . '&amp;mode=topic_view',
+ 'U_VIEW_TOPIC' => $mcp_url . '&amp;t=' . $row['topic_id'] . '&amp;mode=topic_view',
- 'S_SELECT_TOPIC' => ($topic_id && isset($_GET['post_id_list']) && $row['topic_id'] != $topic_id) ? TRUE : FALSE,
+ 'S_SELECT_TOPIC' => ($mode == 'select_topic' && $row['topic_id'] != $topic_id) ? TRUE : FALSE,
'U_SELECT_TOPIC' => $mcp_url . '&amp;mode=merge&amp;to_topic_id=' . $row['topic_id'] . $url_extra,
- 'TOPIC_FOLDER_IMG' => $folder_img,
- 'TOPIC_TYPE' => $topic_type,
- 'TOPIC_TITLE' => $topic_title,
- 'REPLIES' => $row['topic_replies'],
- 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
- 'TOPIC_ID' => $row['topic_id']
+ 'TOPIC_FOLDER_IMG' => $folder_img,
+ 'TOPIC_TYPE' => $topic_type,
+ 'TOPIC_TITLE' => $topic_title,
+ 'REPLIES' => $row['topic_replies'],
+ 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
+ 'TOPIC_ID' => $row['topic_id']
));
}
$db->sql_freeresult($result);
@@ -1736,12 +1792,12 @@ function short_id_list($id_list)
foreach ($id_list as $id)
{
- $short = base_convert($id, 10, 36);
+ $short = (string) base_convert($id, 10, 36);
$max_len = max(strlen($short), $max_len);
$short_id_list[] = $short;
}
- $id_str = $max_len;
+ $id_str = (string) $max_len;
foreach ($short_id_list as $short)
{
$id_str .= str_pad($short, $max_len, '0', STR_PAD_LEFT);
@@ -1763,7 +1819,7 @@ function very_temporary_lang_strings()
'FORUM_NOT_POSTABLE' => 'This forum is not postable',
'SELECTED_TOPICS' => 'You selected the following topic(s)',
'FORUM_NOT_EXIST' => 'The forum you selected does not exist',
- 'Topic_not_exist' => 'The topic you selected does not exist',
+ 'TOPIC_NOT_EXIST' => 'The topic you selected does not exist',
'Posts_merged' => 'The selected posts have been merged',
'SELECT_TOPIC' => 'Select topic',
'Topic_number_is' => 'Topic #%d is %s',
@@ -1797,6 +1853,9 @@ function very_temporary_lang_strings()
'SPLIT_AFTER' => 'Split from selected post',
'DELETE_POSTS' => 'Delete posts',
+ 'MOVE' => 'Move',
+ 'LOCK' => 'Lock',
+ 'UNLOCK' => 'Unlock',
'NOT_ALLOWED' => 'You are not allowed to perform this action.'
);
@@ -1814,5 +1873,34 @@ function very_temporary_lang_strings()
'merge' => 'Merge topic',
'split' => 'Split topic'
);
+
+ $user->lang['report_reasons'] = array(
+ 'warez' => 'The post contains links to illegal or pirated software',
+ 'sex' => 'The post contains nudity or something similar',
+ 'off_topic' => 'Typically any of Pit\'t or TC\'s posts ^ ^'
+ );
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
?> \ No newline at end of file
diff --git a/phpBB/report.php b/phpBB/report.php
new file mode 100644
index 0000000000..249fcfba44
--- /dev/null
+++ b/phpBB/report.php
@@ -0,0 +1,162 @@
+<?php
+/***************************************************************************
+ * report.php
+ * -------------------
+ * begin : July 4, 2001
+ * copyright : (C) 2001 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ ***************************************************************************/
+
+define('IN_PHPBB', true);
+$phpbb_root_path = './';
+include($phpbb_root_path . 'extension.inc');
+include($phpbb_root_path . 'common.'.$phpEx);
+
+// Start session management
+$user->start();
+$user->setup();
+$auth->acl($user->data);
+// End session management
+
+// temp temp temp
+very_temporary_lang_strings();
+// temp temp temp
+
+// var definitions
+$post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0;
+$reason_id = (!empty($_REQUEST['reason_id'])) ? intval($_REQUEST['reason_id']) : 0;
+$description = (!empty($_REQUEST['description'])) ? stripslashes($_REQUEST['description']) : '';
+
+// Start output of page
+$page_title = $user->lang['REPORT_TO_ADMIN'];
+include($phpbb_root_path . 'includes/page_header.' . $phpEx);
+
+$sql = 'SELECT f.*, t.*, p.*
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
+ WHERE p.post_id = $post_id
+ AND p.topic_id = t.topic_id
+ AND p.forum_id = f.forum_id";
+$result = $db->sql_query($sql);
+
+if (!$row = $db->sql_fetchrow($result))
+{
+ trigger_error('POST_NOT_EXIST');
+}
+
+$forum_id = $row['forum_id'];
+$topic_id = $row['topic_id'];
+
+// Checking permissions
+if (!$auth->acl_gets('f_list', 'm_', 'a_', $forum_id))
+{
+ trigger_error('POST_NOT_EXIST');
+}
+if (!$auth->acl_gets('f_read', 'm_', 'a_', $forum_id))
+{
+ trigger_error('USER_CANNOT_READ');
+}
+
+// Has the report been cancelled?
+if (isset($_POST['cancel']))
+{
+ redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id");
+}
+
+// Has the report been confirmed?
+if (!empty($_POST['reason_id']))
+{
+ $sql_ary = array(
+ 'reason_id' => (int) $reason_id,
+ 'post_id' => (int) $post_id,
+ 'user_id' => (int) $user->user_id,
+ 'report_time' => (int) time(),
+ 'report_text' => (string) $description
+ );
+
+ $sql = 'INSERT INTO ' . REPORTS_TABLE . " (reason_id, post_id, user_id, report_time, report_text)
+ VALUES ($reason_id, $post_id, " . $user->data['user_id'] . ', ' . time() . ", '" . $db->sql_escape($description) . "')";
+ $db->sql_query($sql);
+
+ if (!$row['post_reported'])
+ {
+ $db->sql_query('UPDATE ' . POSTS_TABLE . ' SET post_reported = 1 WHERE post_id = ' . $post_id);
+ }
+ if (!$row['topic_reported'])
+ {
+ $db->sql_query('UPDATE ' . TOPICS_TABLE . ' SET topic_reported = 1 WHERE topic_id = ' . $topic_id);
+ }
+
+ trigger_error($user->lang['POST_REPORTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&amp;p=$post_id#$post_id\">", '</a>'));
+}
+
+// Generate the form
+
+generate_forum_nav($row);
+
+$result = $db->sql_query('SELECT * FROM ' . REASONS_TABLE . ' ORDER BY reason_priority ASC');
+while ($row = $db->sql_fetchrow($result))
+{
+ $reason_name = str_replace('_', ' ', $row['reason_name']);
+ $reason_name = ucwords($reason_name);
+
+ if (!empty($user->lang['reports_reasons'][$row['reason_name']]))
+ {
+ $reason_description = $user->lang['reports_reasons'][$row['reason_name']];
+ }
+ else
+ {
+ $reason_description = $row['reason_description'];
+ }
+
+ $template->assign_block_vars('reason', array(
+ 'ID' => $row['reason_id'],
+ 'NAME' => htmlspecialchars($reason_name),
+ 'DESCRIPTION' => htmlspecialchars($reason_description)
+ ));
+}
+
+$template->set_filenames(array(
+ 'body' => 'report.html'
+));
+
+include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
+
+
+function very_temporary_lang_strings()
+{
+ global $user;
+ $user->lang['reports_reasons'] = array(
+ 'warez' => 'The post contains links to illegal or pirated software'
+ );
+
+
+ $lang = array(
+ 'REASON' => 'Reason',
+ 'ADDITIONAL_INFOS' => 'Additional infos',
+ 'CAN_BE_LEFT_BLANK' => '(can be left blank)',
+
+ 'POST_NOT_EXIST' => 'The post you requested does not exist',
+
+ 'REPORT_TO_ADMIN_EXPLAIN' => 'Using this forum you can report the selected post to admins.',
+
+ 'REPORT_NOTIFY' => 'Notify me when this report is reviewed',
+ 'POST_REPORTED' => 'This post has been successfully reported'
+ );
+
+ $user->lang = array_merge($user->lang, $lang);
+
+}
+
+?> \ No newline at end of file
diff --git a/phpBB/templates/subSilver/mcp_forum.html b/phpBB/templates/subSilver/mcp_forum.html
index c46ed26d17..b457427e8f 100644
--- a/phpBB/templates/subSilver/mcp_forum.html
+++ b/phpBB/templates/subSilver/mcp_forum.html
@@ -36,8 +36,6 @@
<!-- IF S_CAN_LOCK -->
<input type="submit" name="lock" class="liteoption" value="{L_LOCK}" />
&nbsp;
- <!-- ENDIF -->
- <!-- IF S_CAN_UNLOCK -->
<input type="submit" name="unlock" class="liteoption" value="{L_UNLOCK}" />
&nbsp;
<!-- ENDIF -->
diff --git a/phpBB/templates/subSilver/mcp_topic.html b/phpBB/templates/subSilver/mcp_topic.html
index 8a2607e6fe..090287e79a 100644
--- a/phpBB/templates/subSilver/mcp_topic.html
+++ b/phpBB/templates/subSilver/mcp_topic.html
@@ -47,6 +47,9 @@
<td class="row2" colspan="2"><input class="post" type="text" name="posts_per_page" size="6" value="{POSTS_PER_PAGE}"></td>
</tr>
<tr>
+ <td class="cat" colspan="3" height="28" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="liteoption" type="submit" name="sort" value="{L_GO}" /></span></td>
+ </tr>
+ <tr>
<th nowrap="nowrap">{L_AUTHOR}</th>
<th nowrap="nowrap">{L_MESSAGE}</th>
<th nowrap="nowrap">{L_SELECT}</th>
@@ -61,9 +64,13 @@
</td>
</tr>
<!-- ENDIF -->
- <tr>
- <td class="{postrow.ROW_CLASS}" align="left" valign="top"><span class="name"><a name="{postrow.U_POST_ID}"></a>{postrow.POSTER_NAME}</span><br /><br /><br /><span class="gensmall"><a href="{postrow.U_POST_DETAILS}">{L_POST_DETAILS}</a></span></td>
- <td width="100%" valign="top" class="{postrow.ROW_CLASS}"><table width="100%" cellspacing="0" cellpadding="2" border="0">
+ <!-- IF postrow.S_ROW_COUNT is even -->
+ <tr class="row1">
+ <!-- ELSE -->
+ <tr class="row2">
+ <!-- ENDIF -->
+ <td align="left" valign="top"><span class="name"><a name="{postrow.U_POST_ID}"></a>{postrow.POSTER_NAME}</span><br /><br /><br /><span class="gensmall"><a href="{postrow.U_POST_DETAILS}">{L_POST_DETAILS}</a></span></td>
+ <td width="100%" valign="top"><table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td valign="middle"><img src="imagesets/subSilver/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}:
{postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
@@ -72,7 +79,7 @@
<td class="postbody" valign="top"><hr size="1" />{postrow.MESSAGE}</td>
</tr>
</table></td>
- <td class="{postrow.ROW_CLASS}" width="5%" align="center">{postrow.S_CHECKBOX}</td>
+ <td width="5%" align="center">{postrow.S_CHECKBOX}</td>
</tr>
<tr>
<td class="row3" colspan="3" height="1"><img src="images/spacer.gif" width="1" height="1" alt="" /></td>
@@ -84,8 +91,9 @@
</table></form>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td>
+ <tr>
+ <td class="nav" align="left" valign="middle">{PAGE_NUMBER}</td>
+ <td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span></td>
</tr>
</table>
diff --git a/phpBB/templates/subSilver/report.html b/phpBB/templates/subSilver/report.html
new file mode 100644
index 0000000000..7400590d78
--- /dev/null
+++ b/phpBB/templates/subSilver/report.html
@@ -0,0 +1,54 @@
+<!-- INCLUDE overall_header.html -->
+
+<form action="{S_POST_ACTION}" method="post">
+
+{ERROR_BOX}
+
+<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
+ <tr>
+ <td class="nav" width="100%" align="left" valign="middle">&nbsp; &nbsp;<a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> -> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
+ <tr>
+ <th colspan="2" height="25">&nbsp;{L_REPORT_TO_ADMIN}&nbsp;</th>
+ </tr>
+ <tr>
+ <td class="row2" colspan="2" align="center"><span class="gen">&nbsp;{L_REPORT_TO_ADMIN_EXPLAIN}&nbsp;</span></td>
+ </tr>
+ <tr>
+ <td class="row1" width="22%"><span class="gen"><b>{L_REASON}</b></span></td>
+ <td class="row2" width="78%"><select name="reason_id"><!-- BEGIN reason --><option value="{reason.ID}">{reason.DESCRIPTION}</option><!-- END reason --></select></td>
+ </tr>
+ <tr>
+ <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span></td>
+ <td class="row2"><table cellspacing="0" cellpadding="1" border="0">
+ <tr>
+ <td><input type="checkbox" name="notify" /></td>
+ <td><span class="gen">{L_REPORT_NOTIFY}</span></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="row1" valign="top"><span class="gen"><b>{L_ADDITIONAL_INFOS}</b></span><br /><span class="gensmall">{L_CAN_BE_LEFT_BLANK}</span></td>
+ <td class="row2"><span class="gen"><textarea name="description" rows="25" cols="40" wrap="virtual" style="width:500px" class="post">{MESSAGE}</textarea></span></td>
+ </tr>
+ <tr>
+ <td class="cat" colspan="2" align="center" height="28"><input type="submit" name="submit" class="mainoption" value="{L_REPORT_TO_ADMIN}" />&nbsp;<input type="submit" name="cancel" class="liteoption" value="{L_CANCEL}"></td>
+ </tr>
+</table>
+
+<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
+ <tr>
+ <td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td>
+ </tr>
+</table></form>
+
+<table width="100%" cellspacing="2" border="0" align="center">
+ <tr>
+ <td valign="top" align="right">{JUMPBOX}</td>
+ </tr>
+</table>
+
+<!-- INCLUDE overall_footer.html --> \ No newline at end of file
diff --git a/phpBB/templates/subSilver/viewtopic_body.html b/phpBB/templates/subSilver/viewtopic_body.html
index 12ef522f60..e1926b7356 100644
--- a/phpBB/templates/subSilver/viewtopic_body.html
+++ b/phpBB/templates/subSilver/viewtopic_body.html
@@ -105,8 +105,16 @@
<tr>
<td colspan="2"><hr /></td>
</tr>
+ <!-- IF postrow.S_POST_REPORTED -->
<tr>
- <td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
+ <td colspan="2" class="gen"><a href="{postrow.U_MCP_REPORT}">{L_POST_BEEN_REPORTED}</a></td>
+ </tr>
+ <tr>
+ <td colspan="2"><hr /></td>
+ </tr>
+ <!-- ENDIF -->
+ <tr>
+ <td><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table></td>
</tr>
@@ -126,7 +134,7 @@
document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');
//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
- <td width="100%" align="right" nowrap="nowrap"><!-- span class="gensmall">{postrow.RATING}</span -->&nbsp;</td>
+ <td width="100%" align="right" nowrap="nowrap"><!-- span class="gensmall">{postrow.RATING}</span --><span class="gensmall">[ <a href="{postrow.U_REPORT}">{L_REPORT_TO_ADMIN}</a> ]</span>&nbsp;</td>
</tr>
</table></td>
<!-- ENDIF -->