Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: modcp.php 4038 2008-07-25 08:50:26Z dennis $
| * $Id: modcp.php 4729 2010-01-23 08:21:16Z Huji $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'modcp.php');
|
$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";
| $templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";
|
Zeile 19 | Zeile 20 |
---|
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special"; $templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields"; $templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs";
|
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special"; $templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields"; $templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs";
|
$templatelist .= ",modcp_warninglogs";
| $templatelist .= ",modcp_warninglogs,modcp_modlogs_result";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_user.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_user.php";
|
Zeile 49 | Zeile 50 |
---|
while($forum = $db->fetch_array($query)) { $flist .= ",'{$forum['fid']}'";
|
while($forum = $db->fetch_array($query)) { $flist .= ",'{$forum['fid']}'";
|
| $children = get_child_list($forum['fid']); if(!empty($children)) { $flist .= ",'".implode("','", $children)."'"; }
|
$moderated_forums[] = $forum['fid']; } if($flist)
| $moderated_forums[] = $forum['fid']; } if($flist)
|
Zeile 80 | Zeile 87 |
---|
error($lang->error_noselected_reports); }
|
error($lang->error_noselected_reports); }
|
array_walk($mybb->input['reports'], "intval");
| $mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
|
$rids = implode($mybb->input['reports'], "','"); $rids = "'0','{$rids}'";
| $rids = implode($mybb->input['reports'], "','"); $rids = "'0','{$rids}'";
|
Zeile 112 | Zeile 119 |
---|
$mybb->input['rid'] = intval($mybb->input['rid']);
|
$mybb->input['rid'] = intval($mybb->input['rid']);
|
if($mybb->input['rid']) { $query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'"); $result = $db->fetch_field($query, "count"); if(($result % $perpage) == 0) { $page = $result / $perpage; } else { $page = intval($result / $perpage) + 1; } } $postcount = intval($report_count)+1; $pages = $postcount / $perpage; $pages = ceil($pages);
| if($mybb->input['rid']) { $query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'"); $result = $db->fetch_field($query, "count"); if(($result % $perpage) == 0) { $page = $result / $perpage; } else { $page = intval($result / $perpage) + 1; } } $postcount = intval($report_count); $pages = $postcount / $perpage; $pages = ceil($pages);
|
if($mybb->input['page'] == "last") {
| if($mybb->input['page'] == "last") {
|
Zeile 135 | Zeile 144 |
---|
}
if($page > $pages || $page <= 0)
|
}
if($page > $pages || $page <= 0)
|
{ $page = 1;
| { $page = 1;
|
}
if($page && $page > 0)
| }
if($page && $page > 0)
|
Zeile 154 | Zeile 163 |
---|
if($postcount > $perpage) { eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
if($postcount > $perpage) { eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
}
$query = $db->simple_select("forums", "fid, name"); while($forum = $db->fetch_array($query)) { $forums[$forum['fid']] = $forum['name']; }
$reports = ''; $query = $db->query(" SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
| }
$query = $db->simple_select("forums", "fid, name"); while($forum = $db->fetch_array($query)) { $forums[$forum['fid']] = $forum['name']; }
$reports = ''; $query = $db->query(" SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
|
FROM ".TABLE_PREFIX."reportedposts r LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
| FROM ".TABLE_PREFIX."reportedposts r LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
|
Zeile 189 | Zeile 198 |
---|
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']); $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject'])); eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");
|
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']); $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject'])); eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");
|
}
| }
|
if(!$reports) { eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";"); }
|
if(!$reports) { eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";"); }
|
|
|
$plugins->run_hooks("modcp_reports");
eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";");
| $plugins->run_hooks("modcp_reports");
eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";");
|
Zeile 202 | Zeile 211 |
---|
}
if($mybb->input['action'] == "allreports")
|
}
if($mybb->input['action'] == "allreports")
|
{ add_breadcrumb($lang->mcp_nav_all_reported_posts, "modcp.php?action=allreports");
| { add_breadcrumb($lang->mcp_nav_all_reported_posts, "modcp.php?action=allreports");
|
if(!$mybb->settings['threadsperpage']) { $mybb->settings['threadsperpage'] = 20;
|
if(!$mybb->settings['threadsperpage']) { $mybb->settings['threadsperpage'] = 20;
|
}
| }
|
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage']; if($mybb->input['page'] != "last")
| // Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage']; if($mybb->input['page'] != "last")
|
Zeile 219 | Zeile 228 |
---|
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count"); $warnings = $db->fetch_field($query, "count");
|
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count"); $warnings = $db->fetch_field($query, "count");
|
|
|
if($mybb->input['rid']) { $mybb->input['rid'] = intval($mybb->input['rid']);
| if($mybb->input['rid']) { $mybb->input['rid'] = intval($mybb->input['rid']);
|
Zeile 234 | Zeile 243 |
---|
$page = intval($result / $perpage) + 1; } }
|
$page = intval($result / $perpage) + 1; } }
|
$postcount = intval($warnings)+1;
| $postcount = intval($warnings);
|
$pages = $postcount / $perpage; $pages = ceil($pages);
| $pages = $postcount / $perpage; $pages = ceil($pages);
|
Zeile 244 | Zeile 253 |
---|
}
if($page > $pages || $page <= 0)
|
}
if($page > $pages || $page <= 0)
|
{ $page = 1;
| { $page = 1;
|
}
if($page)
| }
if($page)
|
Zeile 332 | Zeile 341 |
---|
add_breadcrumb($lang->mcp_nav_modlogs, "modcp.php?action=modlogs");
$perpage = intval($mybb->input['perpage']);
|
add_breadcrumb($lang->mcp_nav_modlogs, "modcp.php?action=modlogs");
$perpage = intval($mybb->input['perpage']);
|
if(!$perpage)
| if(!$perpage || $perpage <= 0)
|
{ $perpage = $mybb->settings['threadsperpage']; }
| { $perpage = $mybb->settings['threadsperpage']; }
|
Zeile 365 | Zeile 374 |
---|
break; default: $sortby = "l.dateline";
|
break; default: $sortby = "l.dateline";
|
} $order = $mybb->input['order']; if($order != "asc") { $order = "desc"; }
$query = $db->query("
| } $order = $mybb->input['order']; if($order != "asc") { $order = "desc"; }
$query = $db->query("
|
SELECT COUNT(l.dateline) AS count FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
| SELECT COUNT(l.dateline) AS count FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
|
Zeile 380 | Zeile 389 |
---|
WHERE 1=1 {$where} "); $rescount = $db->fetch_field($query, "count");
|
WHERE 1=1 {$where} "); $rescount = $db->fetch_field($query, "count");
|
|
|
// Figure out if we need to display multiple pages. if($mybb->input['page'] != "last") {
| // Figure out if we need to display multiple pages. if($mybb->input['page'] != "last") {
|
Zeile 392 | Zeile 401 |
---|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
{
| {
|
$page = $pages; }
| $page = $pages; }
|
Zeile 404 | Zeile 413 |
---|
if($page) { $start = ($page-1) * $perpage;
|
if($page) { $start = ($page-1) * $perpage;
|
}
| }
|
else { $start = 0; $page = 1; }
|
else { $start = 0; $page = 1; }
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&perpage=$perpage&uid={$mybb->input['uid']}&fid={$mybb->input['fid']}&orderby=$mybb->input['sortby']&order={$mybb->input['order']}");
| $multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&perpage=$perpage&uid={$mybb->input['uid']}&fid={$mybb->input['fid']}&sortby={$mybb->input['sortby']}&order={$mybb->input['order']}");
|
if($postcount > $perpage) { eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
| if($postcount > $perpage) { eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
|
Zeile 444 | Zeile 453 |
---|
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />"; } if($logitem['psubject'])
|
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />"; } if($logitem['psubject'])
|
{
| {
|
$information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>"; }
| $information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>"; }
|
Zeile 481 | Zeile 490 |
---|
$user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n"; }
|
$user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n"; }
|
$forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, '', "fid");
| $forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, true, '', "fid");
|
eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";"); output_page($modlogs);
| eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";"); output_page($modlogs);
|
Zeile 518 | Zeile 527 |
---|
if(!$announcement['aid']) { error($lang->error_invalid_announcement);
|
if(!$announcement['aid']) { error($lang->error_invalid_announcement);
|
} if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid']))) { error_no_permission(); }
| } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid']))) { error_no_permission(); }
|
eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";"); output_page($announcements); }
| eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";"); output_page($announcements); }
|
Zeile 562 | Zeile 571 |
---|
{ $startdate[0] = 12+$startdate[0]; if($startdate[0] >= 24)
|
{ $startdate[0] = 12+$startdate[0]; if($startdate[0] >= 24)
|
{
| {
|
$startdate[0] = "00"; } }
| $startdate[0] = "00"; } }
|
Zeile 599 | Zeile 608 |
---|
{ $mybb->input['endtime_month'] = 1; }
|
{ $mybb->input['endtime_month'] = 1; }
|
$enddate = gmmktime($enddatehour, intval($mybb->input['endtime_time']), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
| $enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
|
if($enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date;
| if($enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date;
|
Zeile 641 | Zeile 650 |
---|
$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
|
$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
|
{
| {
|
error_no_permission(); }
| error_no_permission(); }
|
Zeile 649 | Zeile 658 |
---|
if(is_array($errors)) { $errors = inline_error($errors);
|
if(is_array($errors)) { $errors = inline_error($errors);
|
|
|
// Set $announcement to input stuff
|
// Set $announcement to input stuff
|
$title = $mybb->input['title']; $message = $mybb->input['message']; $startmonth = intval($mybb->input['starttime_month']);
| $announcement['subject'] = $mybb->input['title']; $announcement['message'] = $mybb->input['message']; $announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies']; $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1; } if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $startmonth = $mybb->input['starttime_month'];
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$endmonth = intval($mybb->input['endtime_month']);
| $endmonth = $mybb->input['endtime_month'];
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
|
}
| }
|
else {
|
else {
|
// Note: dates are not in user's timezone
| // Note: dates are in GMT timezone
|
$starttime_time = gmdate("g:i a", TIME_NOW); $endtime_time = gmdate("g:i a", TIME_NOW); $startday = $endday = gmdate("j", TIME_NOW);
| $starttime_time = gmdate("g:i a", TIME_NOW); $endtime_time = gmdate("g:i a", TIME_NOW); $startday = $endday = gmdate("j", TIME_NOW);
|
Zeile 672 | Zeile 696 |
---|
$startdateyear = gmdate("Y", TIME_NOW);
$enddateyear = $startdateyear+1;
|
$startdateyear = gmdate("Y", TIME_NOW);
$enddateyear = $startdateyear+1;
|
}
// Generate form elements for($i = 1; $i <= 31; ++$i) { if($startday == $i) { $startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else { $startdateday .= "<option value=\"$i\">$i</option>\n"; }
if($endday == $i) { $enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else { $enddateday .= "<option value=\"$i\">$i</option>\n"; } }
$startmonthsel = $endmonthsel = array(); $startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth .= "<option value=\"01\" {$startmonthsel['01']}>{$lang->january}</option>\n";
| }
// Generate form elements for($i = 1; $i <= 31; ++$i) { if($startday == $i) { $startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else { $startdateday .= "<option value=\"$i\">$i</option>\n"; }
if($endday == $i) { $enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else { $enddateday .= "<option value=\"$i\">$i</option>\n"; } }
$startmonthsel = $endmonthsel = array(); $startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth .= "<option value=\"01\" {$startmonthsel['01']}>{$lang->january}</option>\n";
|
$enddatemonth .= "<option value=\"01\" {$endmonthsel['01']}>{$lang->january}</option>\n"; $startdatemonth .= "<option value=\"02\" {$startmonthsel['02']}>{$lang->february}</option>\n"; $enddatemonth .= "<option value=\"02\" {$endmonthsel['02']}>{$lang->february}</option>\n";
| $enddatemonth .= "<option value=\"01\" {$endmonthsel['01']}>{$lang->january}</option>\n"; $startdatemonth .= "<option value=\"02\" {$startmonthsel['02']}>{$lang->february}</option>\n"; $enddatemonth .= "<option value=\"02\" {$endmonthsel['02']}>{$lang->february}</option>\n";
|
Zeile 774 | Zeile 798 |
---|
}
if($mybb->input['action'] == "do_edit_announcement")
|
}
if($mybb->input['action'] == "do_edit_announcement")
|
{
| {
|
verify_post_check($mybb->input['my_post_key']);
// Get the announcement
| verify_post_check($mybb->input['my_post_key']);
// Get the announcement
|
Zeile 786 | Zeile 810 |
---|
if(!$announcement['aid']) { error($lang->error_invalid_announcement);
|
if(!$announcement['aid']) { error($lang->error_invalid_announcement);
|
}
| }
|
// Mod has permissions to edit this announcement if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
| // Mod has permissions to edit this announcement if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
|
Zeile 798 | Zeile 822 |
---|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
}
| }
|
if(!trim($mybb->input['message'])) {
| if(!trim($mybb->input['message'])) {
|
Zeile 808 | Zeile 832 |
---|
if(!trim($mybb->input['fid'])) { $errors[] = $lang->error_missing_forum;
|
if(!trim($mybb->input['fid'])) { $errors[] = $lang->error_missing_forum;
|
}
| }
$startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']); $enddate = @explode(":", $enddate[0]);
if(stristr($mybb->input['starttime_time'], "pm")) { $startdate[0] = 12+$startdate[0]; if($startdate[0] >= 24) { $startdate[0] = "00"; } }
if(stristr($mybb->input['endtime_time'], "pm")) { $enddate[0] = 12+$enddate[0]; if($enddate[0] >= 24) { $enddate[0] = "00"; } }
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1;
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1;
|
}
| }
|
$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])); if($startdate < 0 || $startdate == false)
| $startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])); if($startdate < 0 || $startdate == false)
|
Zeile 823 | Zeile 870 |
---|
}
if($mybb->input['endtime_type'] == "2")
|
}
if($mybb->input['endtime_type'] == "2")
|
{
| {
|
$enddate = '0'; } else
| $enddate = '0'; } else
|
Zeile 832 | Zeile 879 |
---|
{ $mybb->input['endtime_month'] = 1; }
|
{ $mybb->input['endtime_month'] = 1; }
|
$enddate = gmmktime($enddatehour, intval($mybb->input['endtime_time']), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
| $enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
|
if($enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date;
| if($enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date;
|
Zeile 873 | Zeile 920 |
---|
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");
|
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");
|
|
|
// Get announcement $query = $db->simple_select("announcements", "*", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement['fid'])
|
// Get announcement $query = $db->simple_select("announcements", "*", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement['fid'])
|
{
| {
|
error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
| error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
|
Zeile 898 | Zeile 945 |
---|
$announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies'];
|
$announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies'];
|
$startmonth = intval($mybb->input['starttime_month']);
| $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1; } if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $startmonth = $mybb->input['starttime_month'];
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$endmonth = intval($mybb->input['endtime_month']);
| $endmonth = $mybb->input['endtime_month'];
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
| $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
|
Zeile 911 | Zeile 970 |
---|
} else {
|
} else {
|
// Note: dates are in user's timezone $starttime_time = my_date('g:i a', $announcement['startdate']); $endtime_time = my_date('g:i a', $announcement['enddate']);
| // Note: dates are in GMT timezone $starttime_time = gmdate('g:i a', $announcement['startdate']); $endtime_time = gmdate('g:i a', $announcement['enddate']);
|
|
|
$startday = my_date('j', $announcement['startdate']); $endday = my_date('j', $announcement['enddate']);
| $startday = gmdate('j', $announcement['startdate']); $endday = gmdate('j', $announcement['enddate']);
|
|
|
$startmonth = my_date('m', $announcement['startdate']); $endmonth = my_date('m', $announcement['enddate']);
| $startmonth = gmdate('m', $announcement['startdate']); $endmonth = gmdate('m', $announcement['enddate']);
|
|
|
$startdateyear = my_date('Y', $announcement['startdate']); $enddateyear = my_date('Y', $announcement['enddate']);
| $startdateyear = gmdate('Y', $announcement['startdate']); $enddateyear = gmdate('Y', $announcement['enddate']);
|
$errored = false; }
| $errored = false; }
|
Zeile 1116 | Zeile 1175 |
---|
{ $moderation->approve_threads($threads_to_approve); }
|
{ $moderation->approve_threads($threads_to_approve); }
|
| log_moderator_action(array('tids' => $threads_to_approve), $lang->multi_approve_threads);
|
redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated); } else if(is_array($mybb->input['posts']))
| redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated); } else if(is_array($mybb->input['posts']))
|
Zeile 1138 | Zeile 1198 |
---|
{ $moderation->approve_posts($posts_to_approve); }
|
{ $moderation->approve_posts($posts_to_approve); }
|
| log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);
|
redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated); } else if(is_array($mybb->input['attachments'])) {
|
redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated); } else if(is_array($mybb->input['attachments'])) {
|
$query = $db->simple_select("attachments", "aid, pid", "aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$flist}");
| $query = $db->query(" SELECT a.pid, a.aid FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$tflist} ");
|
while($attachment = $db->fetch_array($query)) { $action = $mybb->input['attachments'][$attachment['aid']]; if($action == "approve")
|
while($attachment = $db->fetch_array($query)) { $action = $mybb->input['attachments'][$attachment['aid']]; if($action == "approve")
|
{
| {
|
$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'"); } else if($action == "delete")
| $db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'"); } else if($action == "delete")
|
Zeile 1162 | Zeile 1229 |
---|
if($mybb->input['action'] == "modqueue") { if($mybb->input['type'] == "threads" || !$mybb->input['type'])
|
if($mybb->input['action'] == "modqueue") { if($mybb->input['type'] == "threads" || !$mybb->input['type'])
|
{ $forum_cache = $cache->read("forums");
| { $forum_cache = $cache->read("forums");
|
$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}"); $unapproved_threads = $db->fetch_field($query, "unapprovedthreads");
|
$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}"); $unapproved_threads = $db->fetch_field($query, "unapprovedthreads");
|
|
|
// Figure out if we need to display multiple pages. if($mybb->input['page'] != "last")
|
// Figure out if we need to display multiple pages. if($mybb->input['page'] != "last")
|
{
| {
|
$page = intval($mybb->input['page']);
|
$page = intval($mybb->input['page']);
|
}
| }
|
$perpage = $mybb->settings['threadsperpage']; $pages = $unapproved_threads / $perpage;
|
$perpage = $mybb->settings['threadsperpage']; $pages = $unapproved_threads / $perpage;
|
$pages = ceil($pages);
if($mybb->input['page'] == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page)
| $pages = ceil($pages);
if($mybb->input['page'] == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page)
|
{ $start = ($page-1) * $perpage; }
| { $start = ($page-1) * $perpage; }
|
Zeile 1198 | Zeile 1265 |
---|
$page = 1; }
|
$page = 1; }
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modqueue&type=threads");
| $multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&type=threads");
|
$query = $db->query(" SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid
| $query = $db->query(" SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid
|
Zeile 1259 | Zeile 1326 |
---|
$perpage = $mybb->settings['postsperpage']; $pages = $unapproved_posts / $perpage;
|
$perpage = $mybb->settings['postsperpage']; $pages = $unapproved_posts / $perpage;
|
$pages = ceil($pages);
if($mybb->input['page'] == "last") { $page = $pages; }
| $pages = ceil($pages);
if($mybb->input['page'] == "last") { $page = $pages; }
|
if($page > $pages || $page <= 0) {
| if($page > $pages || $page <= 0) {
|
Zeile 1281 | Zeile 1348 |
---|
$page = 1; }
|
$page = 1; }
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modqueue&type=posts");
| $multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&type=posts");
|
$query = $db->query(" SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline
| $query = $db->query(" SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline
|
Zeile 1315 | Zeile 1382 |
---|
}
if($posts)
|
}
if($posts)
|
{
| {
|
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&type=posts"); eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";"); eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";"); output_page($postqueue); } }
|
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&type=posts"); eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";"); eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";"); output_page($postqueue); } }
|
|
|
if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue)) { $query = $db->query("
| if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue)) { $query = $db->query("
|
Zeile 1341 | Zeile 1408 |
---|
}
$perpage = $mybb->settings['postsperpage'];
|
}
$perpage = $mybb->settings['postsperpage'];
|
$pages = $unapprovedthreads / $perpage; $pages = ceil($pages);
if($mybb->input['page'] == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page) { $start = ($page-1) * $perpage;
| $pages = $unapproved_attachments / $perpage; $pages = ceil($pages);
if($mybb->input['page'] == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
} else {
| } else {
|
Zeile 1364 | Zeile 1431 |
---|
$page = 1; }
|
$page = 1; }
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modqueue&type=attachments");
| $multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&type=attachments");
|
$query = $db->query(" SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject
| $query = $db->query(" SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject
|
Zeile 1411 | Zeile 1478 |
---|
eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";"); eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";"); output_page($attachmentqueue);
|
eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";"); eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";"); output_page($attachmentqueue);
|
} }
| } }
|
// Still nothing? All queues are empty! :-D if(!$threadqueue && !$postqueue && !$attachmentqueue)
|
// Still nothing? All queues are empty! :-D if(!$threadqueue && !$postqueue && !$attachmentqueue)
|
{
| {
|
add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue"); eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";"); output_page($queue);
|
add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue"); eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";"); output_page($queue);
|
}
| }
|
}
|
}
|
|
|
if($mybb->input['action'] == "do_editprofile") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
if($mybb->input['action'] == "do_editprofile") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$user = get_user($mybb->input['uid']); if(!$user['uid']) { error($lang->invalid_user); }
// Check if the current user has permission to edit this user $user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['canadmincp'] == 1)) {
| $user = get_user($mybb->input['uid']); if(!$user['uid']) { error($lang->invalid_user); }
// Check if the current user has permission to edit this user $user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['cancp'] == 1)) {
|
error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['canadmincp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
| else if(!modcp_can_manage_user($user['uid']))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 1527 | Zeile 1594 |
---|
$user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins
|
$user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins
|
if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['canadmincp'] == 1))
| if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['cancp'] == 1))
|
{ error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
{ error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['canadmincp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
| else if(!modcp_can_manage_user($user['uid']))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 1576 | Zeile 1643 |
---|
} else {
|
} else {
|
| if(!$user['displaygroup']) { $user['displaygroup'] = $user['usergroup']; }
$displaygroupfields = array( "usertitle" );
|
$display_group = usergroup_displaygroup($user['displaygroup']); $defaulttitle = $display_group['usertitle']; }
| $display_group = usergroup_displaygroup($user['displaygroup']); $defaulttitle = $display_group['usertitle']; }
|
Zeile 1596 | Zeile 1671 |
---|
$bdaydaysel .= "<option value=\"$i\">$i</option>\n"; } }
|
$bdaydaysel .= "<option value=\"$i\">$i</option>\n"; } }
|
$bdaymonthsel[$mybb->input['birthday_month']] = "selected";
| $bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';
|
// Fetch profile fields
|
// Fetch profile fields
|
Zeile 1740 | Zeile 1815 |
---|
else { $value = htmlspecialchars_uni($userfield);
|
else { $value = htmlspecialchars_uni($userfield);
|
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\" maxlength=\"{$profilefield['maxlength']}\" value=\"$value\" />";
| $maxlength = ""; if($profilefield['maxlength'] > 0) { $maxlength = " maxlength=\"{$profilefield['maxlength']}\""; } $code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";
|
} if($profilefield['required'] == 1) { eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
|
} if($profilefield['required'] == 1) { eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
|
}
| }
|
else { eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
| else { eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
|
Zeile 1774 | Zeile 1854 |
---|
if($mybb->input['action'] == "finduser") {
|
if($mybb->input['action'] == "finduser") {
|
if(!$perpage)
| $perpage = intval($mybb->input['perpage']); if(!$perpage || $perpage <= 0)
|
{ $perpage = $mybb->settings['threadsperpage']; }
| { $perpage = $mybb->settings['threadsperpage']; }
|
Zeile 1843 | Zeile 1924 |
---|
if($mybb->input[$field]) { $page_url .= "&{$field}=".htmlspecialchars_uni($mybb->input[$field]);
|
if($mybb->input[$field]) { $page_url .= "&{$field}=".htmlspecialchars_uni($mybb->input[$field]);
|
| $mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
|
} }
| } }
|
Zeile 1859 | Zeile 1941 |
---|
$user['postnum'] = my_number_format($user['postnum']); $regdate = my_date($mybb->settings['dateformat'], $user['regdate']); $regtime = my_date($mybb->settings['timeformat'], $user['regdate']);
|
$user['postnum'] = my_number_format($user['postnum']); $regdate = my_date($mybb->settings['dateformat'], $user['regdate']); $regtime = my_date($mybb->settings['timeformat'], $user['regdate']);
|
$lastdate = my_date($mybb->settings['dateformat'], $user['lastactive']); $lasttime = my_date($mybb->settings['timeformat'], $user['lastactive']);
| $lastdate = my_date($mybb->settings['dateformat'], $user['lastvisit']); $lasttime = my_date($mybb->settings['timeformat'], $user['lastvisit']);
|
$usergroup = $usergroups_cache[$user['usergroup']]['title']; eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";"); }
| $usergroup = $usergroups_cache[$user['usergroup']]['title']; eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";"); }
|
Zeile 1886 | Zeile 1968 |
---|
$search['username'] = $db->escape_string($mybb->input['filter']['username']); $query = $db->simple_select("users", "uid", "username='{$search['username']}'"); $mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");
|
$search['username'] = $db->escape_string($mybb->input['filter']['username']); $query = $db->simple_select("users", "uid", "username='{$search['username']}'"); $mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");
|
| $mybb->input['filter']['username'] = htmlspecialchars_uni($mybb->input['filter']['username']);
|
} if($mybb->input['filter']['uid']) {
| } if($mybb->input['filter']['uid']) {
|
Zeile 1894 | Zeile 1977 |
---|
if(!isset($mybb->input['search']['username'])) { $user = get_user($mybb->input['search']['uid']);
|
if(!isset($mybb->input['search']['username'])) { $user = get_user($mybb->input['search']['uid']);
|
$mybb->input['search']['username'] = $user['username'];
| $mybb->input['search']['username'] = htmlspecialchars_uni($user['username']);
|
} } if($mybb->input['filter']['mod_username'])
| } } if($mybb->input['filter']['mod_username'])
|
Zeile 1902 | Zeile 1985 |
---|
$search['mod_username'] = $db->escape_string($mybb->input['filter']['mod_username']); $query = $db->simple_select("users", "uid", "username='{$search['mod_username']}'"); $mybb->input['filter']['mod_uid'] = $db->fetch_field($query, "uid");
|
$search['mod_username'] = $db->escape_string($mybb->input['filter']['mod_username']); $query = $db->simple_select("users", "uid", "username='{$search['mod_username']}'"); $mybb->input['filter']['mod_uid'] = $db->fetch_field($query, "uid");
|
| $mybb->input['filter']['mod_username'] = htmlspecialchars_uni($mybb->input['filter']['mod_username']);
|
} if($mybb->input['filter']['mod_uid']) {
| } if($mybb->input['filter']['mod_uid']) {
|
Zeile 1910 | Zeile 1994 |
---|
if(!isset($mybb->input['search']['mod_username'])) { $mod_user = get_user($mybb->input['search']['uid']);
|
if(!isset($mybb->input['search']['mod_username'])) { $mod_user = get_user($mybb->input['search']['uid']);
|
$mybb->input['search']['mod_username'] = $mod_user['username'];
| $mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
|
} } if($mybb->input['filter']['reason']) { $search['reason'] = $db->escape_string($mybb->input['filter']['reason']); $where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
|
} } if($mybb->input['filter']['reason']) { $search['reason'] = $db->escape_string($mybb->input['filter']['reason']); $where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
|
| $mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']);
|
} $sortbysel = array(); switch($mybb->input['filter']['sortby'])
| } $sortbysel = array(); switch($mybb->input['filter']['sortby'])
|
Zeile 2121 | Zeile 2206 |
---|
// Now we have the result counts, paginate $perpage = intval($mybb->input['perpage']);
|
// Now we have the result counts, paginate $perpage = intval($mybb->input['perpage']);
|
if(!$perpage)
| if(!$perpage || $perpage <= 0)
|
{ $perpage = $mybb->settings['threadsperpage']; }
| { $perpage = $mybb->settings['threadsperpage']; }
|
Zeile 2155 | Zeile 2240 |
---|
$page = 1; }
|
$page = 1; }
|
$page_url = "modcp.php?action=ipsearch&perpage={$perpage}&ipaddress={$mybb->input['ipaddress']}";
| $page_url = "modcp.php?action=ipsearch&perpage={$perpage}";
|
foreach(array('ipaddress', 'search_users', 'search_posts') as $input) { if(!$mybb->input[$input]) continue;
| foreach(array('ipaddress', 'search_users', 'search_posts') as $input) { if(!$mybb->input[$input]) continue;
|
Zeile 2206 | Zeile 2291 |
---|
if($total_results > $user_results && $post_limit) { $post_start = $start-$user_results;
|
if($total_results > $user_results && $post_limit) { $post_start = $start-$user_results;
|
if($post_start < 0) $post_start = 0;
| if($post_start < 0) { $post_start = 0; }
|
} if($mybb->input['search_posts'] && (!$mybb->input['search_users'] || ($mybb->input['search_users'] && $post_limit > 0))) {
|
} if($mybb->input['search_posts'] && (!$mybb->input['search_users'] || ($mybb->input['search_users'] && $post_limit > 0))) {
|
| $ipaddresses = $tids = $uids = array();
|
$query = $db->query("
|
$query = $db->query("
|
SELECT p.username AS postusername, p.uid, u.username, p.subject, p.pid, p.tid, p.ipaddress, t.subject AS threadsubject FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON(p.uid=u.uid)
| SELECT username AS postusername, uid, subject, pid, tid, ipaddress FROM ".TABLE_PREFIX."posts
|
WHERE {$post_ip_sql}
|
WHERE {$post_ip_sql}
|
ORDER BY p.dateline DESC
| ORDER BY dateline DESC
|
LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query)) {
|
LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query)) {
|
$ip = $ipaddress['ipaddress']; if(!$ipaddress['username']) $ipaddress['username'] = $ipaddress['postusername']; // Guest username support $trow = alt_trow(); if(!$ipaddress['subject'])
| $tids[$ipaddress['tid']] = $ipaddress['pid']; $uids[$ipaddress['uid']] = $ipaddress['pid']; $ipaddresses[$ipaddress['pid']] = $ipaddress; } if(!empty($ipaddresses)) { $query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")"); while($thread = $db->fetch_array($query))
|
{
|
{
|
$ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}";
| $ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject']; } unset($tids); $query = $db->simple_select("users", "username, uid", "uid IN(".implode(',', array_keys($uids)).")"); while($user = $db->fetch_array($query)) { $ipaddresses[$uids[$user['uid']]]['username'] = $user['username']; } unset($uids); foreach($ipaddresses as $ipaddress) { $ip = $ipaddress['ipaddress']; if(!$ipaddress['username']) $ipaddress['username'] = $ipaddress['postusername']; // Guest username support $trow = alt_trow(); if(!$ipaddress['subject']) { $ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}"; } $subject = "<strong>{$lang->ipresult_post}</strong> <a href=\"".get_post_link($ipaddress['pid'], $ipaddress['tid'])."\">".htmlspecialchars_uni($ipaddress['subject'])."</a> {$lang->by} ".build_profile_link($ipaddress['username'], $ipaddress['uid']); eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");
|
}
|
}
|
$subject = "<strong>{$lang->ipresult_post}</strong> <a href=\"".get_post_link($ipaddress['pid'], $ipaddress['tid'])."\">".htmlspecialchars_uni($ipaddress['subject'])."</a> by ".build_profile_link($ipaddress['username'], $ipaddress['uid']); eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");
| |
} }
| } }
|
Zeile 2288 | Zeile 2399 |
---|
$query = $db->simple_select("banned", "COUNT(uid) AS count"); $banned_count = $db->fetch_field($query, "count");
|
$query = $db->simple_select("banned", "COUNT(uid) AS count"); $banned_count = $db->fetch_field($query, "count");
|
$postcount = intval($banned_count)+1;
| $postcount = intval($banned_count);
|
$pages = $postcount / $perpage; $pages = ceil($pages);
| $pages = $postcount / $perpage; $pages = ceil($pages);
|
Zeile 2335 | Zeile 2446 |
---|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canadmincp'] == 1)
| if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
|
{ $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
| { $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
|
Zeile 2407 | Zeile 2518 |
---|
if(!$ban['uid']) {
|
if(!$ban['uid']) {
|
$lang->error_invalidban;
| error($lang->error_invalidban);
|
}
// Permission to edit this ban?
|
}
// Permission to edit this ban?
|
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['canadmincp'] != 1)
| if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 2452 | Zeile 2563 |
---|
}
// Permission to edit this ban?
|
}
// Permission to edit this ban?
|
if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['canadmincp'] != 1)
| if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&bid={$user['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";
| |
} // Creating a new ban else
| } // Creating a new ban else
|
Zeile 2509 | Zeile 2618 |
---|
{ // Ban the user if($mybb->input['liftafter'] == '---')
|
{ // Ban the user if($mybb->input['liftafter'] == '---')
|
{
| {
|
$lifted = 0; } else
| $lifted = 0; } else
|
Zeile 2561 | Zeile 2670 |
---|
if($mybb->input['uid']) { redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
|
if($mybb->input['uid']) { redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
|
} else
| } else
|
{ redirect("modcp.php?action=banning", $lang->redirect_banuser); }
| { redirect("modcp.php?action=banning", $lang->redirect_banuser); }
|
Zeile 2591 | Zeile 2700 |
---|
if($mybb->input['uid']) { $query = $db->query("
|
if($mybb->input['uid']) { $query = $db->query("
|
SELECT b.*, u.username
| SELECT b.*, u.username, u.uid
|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}'
| FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}'
|
Zeile 2602 | Zeile 2711 |
---|
$username = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']); $uid = $mybb->input['uid'];
|
$username = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']); $uid = $mybb->input['uid'];
|
| $user = get_user($banned['uid']);
|
$lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";"); } }
|
$lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";"); } }
|
|
|
// New ban!
|
// New ban!
|
if(!$banuer_username)
| if(!$banuser_username)
|
{ if($mybb->input['uid']) {
| { if($mybb->input['uid']) {
|
Zeile 2617 | Zeile 2728 |
---|
else { $username = htmlspecialchars_uni($mybb->input['username']);
|
else { $username = htmlspecialchars_uni($mybb->input['username']);
|
}
| }
|
eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";"); }
| eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";"); }
|
Zeile 2643 | Zeile 2754 |
---|
} $thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $banned['dateline'])); if($time == '---')
|
} $thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $banned['dateline'])); if($time == '---')
|
{
| {
|
$liftlist .= ">{$title}</option>\n"; } else
|
$liftlist .= ">{$title}</option>\n"; } else
|
{
| {
|
$liftlist .= ">{$title} ({$thatime})</option>\n";
|
$liftlist .= ">{$title} ({$thatime})</option>\n";
|
} }
| } }
|
$bangroups = ''; $query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1"); while($item = $db->fetch_array($query))
| $bangroups = ''; $query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1"); while($item = $db->fetch_array($query))
|
Zeile 2663 | Zeile 2774 |
---|
} $bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n"; }
|
} $bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n"; }
|
| $lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&uid={$user['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";
|
eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser); }
if($mybb->input['action'] == "do_modnotes") {
|
eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser); }
if($mybb->input['action'] == "do_modnotes") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
// Update Moderator Notes cache $update_cache = array( "modmessage" => $mybb->input['modnotes']
| // Update Moderator Notes cache $update_cache = array( "modmessage" => $mybb->input['modnotes']
|
Zeile 2693 | Zeile 2809 |
---|
if($unapproved_attachments > 0) { $query = $db->query("
|
if($unapproved_attachments > 0) { $query = $db->query("
|
SELECT t.tid, p.pid, t.uid, t.username, a.filename, a.dateuploaded
| SELECT t.tid, p.pid, p.uid, t.username, a.filename, a.dateuploaded
|
FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
| FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
Zeile 2726 | Zeile 2842 |
---|
if($unapproved_posts > 0) { $query = $db->query("
|
if($unapproved_posts > 0) { $query = $db->query("
|
SELECT p.pid, p.tid, p.subject, p.uid, p.username
| SELECT p.pid, p.tid, p.subject, p.uid, p.username, p.dateline
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
| FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
|
Zeile 2741 | Zeile 2857 |
---|
$post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']); if(my_strlen($post['subject']) > 25) {
|
$post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']); if(my_strlen($post['subject']) > 25) {
|
$lastpost_subject = my_substr($post['subject'], 0, 25)."...";
| $post['subject'] = my_substr($post['subject'], 0, 25)."...";
|
} $post['subject'] = htmlspecialchars_uni($post['subject']); $post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']);
| } $post['subject'] = htmlspecialchars_uni($post['subject']); $post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']);
|
Zeile 2767 | Zeile 2883 |
---|
$thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']); if(my_strlen($thread['subject']) > 25) {
|
$thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']); if(my_strlen($thread['subject']) > 25) {
|
$lastpost_subject = my_substr($thread['subject'], 0, 25)."...";
| $post['subject'] = my_substr($thread['subject'], 0, 25)."...";
|
} $thread['subject'] = htmlspecialchars_uni($thread['subject']); $thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);
| } $thread['subject'] = htmlspecialchars_uni($thread['subject']); $thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);
|
Zeile 2835 | Zeile 2951 |
---|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canadmincp'] == 1)
| if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
|
{ $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
| { $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
|