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 4111 2008-08-13 06:14:12Z Tikitiki $
| * $Id: modcp.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 20 | 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 50 | 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 65 | Zeile 71 |
---|
// Fetch the Mod CP menu eval("\$modcp_nav = \"".$templates->get("modcp_nav")."\";");
|
// Fetch the Mod CP menu eval("\$modcp_nav = \"".$templates->get("modcp_nav")."\";");
|
|
|
$plugins->run_hooks("modcp_start");
// Make navigation add_breadcrumb($lang->nav_modcp, "modcp.php");
|
$plugins->run_hooks("modcp_start");
// Make navigation add_breadcrumb($lang->nav_modcp, "modcp.php");
|
|
|
if($mybb->input['action'] == "do_reports") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
if($mybb->input['action'] == "do_reports") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
|
|
if(!is_array($mybb->input['reports'])) { error($lang->error_noselected_reports); }
|
if(!is_array($mybb->input['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 90 | Zeile 96 |
---|
$db->update_query("reportedposts", array('reportstatus' => 1), "rid IN ({$rids}){$flist}"); $cache->update_reportedposts(); redirect("modcp.php?action=reports", $lang->redirect_reportsmarked);
|
$db->update_query("reportedposts", array('reportstatus' => 1), "rid IN ({$rids}){$flist}"); $cache->update_reportedposts(); redirect("modcp.php?action=reports", $lang->redirect_reportsmarked);
|
}
| }
|
if($mybb->input['action'] == "reports") { add_breadcrumb($lang->mcp_nav_reported_posts, "modcp.php?action=reports");
|
if($mybb->input['action'] == "reports") { add_breadcrumb($lang->mcp_nav_reported_posts, "modcp.php?action=reports");
|
|
|
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") { $page = intval($mybb->input['page']);
|
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage']; if($mybb->input['page'] != "last") { $page = intval($mybb->input['page']);
|
}
| }
|
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "reportstatus ='0'"); $report_count = $db->fetch_field($query, "count");
$mybb->input['rid'] = intval($mybb->input['rid']);
|
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "reportstatus ='0'"); $report_count = $db->fetch_field($query, "count");
$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['page'] == "last")
{ $page = $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") { $page = $pages;
|
}
if($page > $pages || $page <= 0)
|
}
if($page > $pages || $page <= 0)
|
{ $page = 1;
| { $page = 1;
|
}
if($page && $page > 0)
| }
if($page && $page > 0)
|
Zeile 173 | Zeile 180 |
---|
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid) WHERE r.reportstatus='0'
|
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid) WHERE r.reportstatus='0'
|
ORDER BY r.dateline DESC
| ORDER BY r.dateline DESC
|
LIMIT {$start}, {$perpage} "); while($report = $db->fetch_array($query))
| LIMIT {$start}, {$perpage} "); while($report = $db->fetch_array($query))
|
Zeile 214 | Zeile 221 |
---|
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage'];
|
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage'];
|
if($mybb->input['page'] != "last")
| if($mybb->input['page'] != "last")
|
{ $page = intval($mybb->input['page']); }
| { $page = intval($mybb->input['page']); }
|
Zeile 236 | 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 334 | 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'];
|
}
| }
|
$where = '';
// Searching for entries by a particular user if($mybb->input['uid']) { $where .= " AND l.uid='".intval($mybb->input['uid'])."'";
|
$where = '';
// Searching for entries by a particular user if($mybb->input['uid']) { $where .= " AND l.uid='".intval($mybb->input['uid'])."'";
|
}
| }
|
// Searching for entries in a specific forum if($mybb->input['fid']) { $where .= " AND t.fid='".intval($mybb->input['fid'])."'";
|
// Searching for entries in a specific forum if($mybb->input['fid']) { $where .= " AND t.fid='".intval($mybb->input['fid'])."'";
|
}
| }
|
// Order? switch($mybb->input['sortby'])
| // Order? switch($mybb->input['sortby'])
|
Zeile 361 | Zeile 368 |
---|
break; case "forum": $sortby = "f.name";
|
break; case "forum": $sortby = "f.name";
|
break;
| break;
|
case "thread": $sortby = "t.subject"; break;
| case "thread": $sortby = "t.subject"; break;
|
Zeile 376 | Zeile 383 |
---|
$query = $db->query(" SELECT COUNT(l.dateline) AS count
|
$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) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
| FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
|
WHERE 1=1 {$where} "); $rescount = $db->fetch_field($query, "count");
| WHERE 1=1 {$where} "); $rescount = $db->fetch_field($query, "count");
|
Zeile 387 | Zeile 394 |
---|
if($mybb->input['page'] != "last") { $page = intval($mybb->input['page']);
|
if($mybb->input['page'] != "last") { $page = intval($mybb->input['page']);
|
}
| }
|
$postcount = intval($rescount); $pages = $postcount / $perpage; $pages = ceil($pages);
|
$postcount = intval($rescount); $pages = $postcount / $perpage; $pages = ceil($pages);
|
|
|
if($mybb->input['page'] == "last") { $page = $pages;
|
if($mybb->input['page'] == "last") { $page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0)
|
if($page > $pages || $page <= 0)
|
{ $page = 1;
| { $page = 1;
|
}
if($page)
| }
if($page)
|
Zeile 413 | Zeile 420 |
---|
$page = 1; }
|
$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)
|
if($postcount > $perpage)
|
{
| {
|
eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";"); } $query = $db->query("
| eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";"); } $query = $db->query("
|
Zeile 432 | Zeile 439 |
---|
while($logitem = $db->fetch_array($query)) { $information = '';
|
while($logitem = $db->fetch_array($query)) { $information = '';
|
| $logitem['action'] = htmlspecialchars_uni($logitem['action']);
|
$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']); $trow = alt_trow();
| $log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']); $trow = alt_trow();
|
Zeile 444 | Zeile 452 |
---|
if($logitem['fname']) { $information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";
|
if($logitem['fname']) { $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>"; }
|
if($logitem['psubject']) { $information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>"; }
|
|
|
eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";"); }
if(!$results)
|
eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";"); }
if(!$results)
|
{
| {
|
eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";"); }
| eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";"); }
|
Zeile 471 | Zeile 479 |
---|
{ // Deleted Users if(!$user['username'])
|
{ // Deleted Users if(!$user['username'])
|
{
| {
|
$user['username'] = $lang->na_deleted; }
| $user['username'] = $lang->na_deleted; }
|
Zeile 483 | Zeile 491 |
---|
$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); }
if($mybb->input['action'] == "do_delete_announcement")
|
eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";"); output_page($modlogs); }
if($mybb->input['action'] == "do_delete_announcement")
|
{ verify_post_check($mybb->input['my_post_key']);
$aid = intval($mybb->input['aid']);
| { verify_post_check($mybb->input['my_post_key']);
$aid = intval($mybb->input['aid']);
|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
| $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
|
Zeile 601 | Zeile 609 |
---|
{ $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 609 | Zeile 617 |
---|
elseif($enddate < $startdate) { $errors[] = $lang->error_end_before_start;
|
elseif($enddate < $startdate) { $errors[] = $lang->error_end_before_start;
|
} }
| } }
|
if(!$errors) {
| if(!$errors) {
|
Zeile 625 | Zeile 633 |
---|
'allowmycode' => $db->escape_string($mybb->input['allowmycode']), 'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']), );
|
'allowmycode' => $db->escape_string($mybb->input['allowmycode']), 'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']), );
|
|
|
$aid = $db->insert_query("announcements", $insert_announcement); redirect("modcp.php?action=announcements", $lang->redirect_add_announcement); } else
|
$aid = $db->insert_query("announcements", $insert_announcement); redirect("modcp.php?action=announcements", $lang->redirect_add_announcement); } else
|
{
| {
|
$mybb->input['action'] = 'new_announcement'; } }
| $mybb->input['action'] = 'new_announcement'; } }
|
Zeile 649 | Zeile 657 |
---|
// Deal with inline errors if(is_array($errors))
|
// Deal with inline errors if(is_array($errors))
|
{
| {
|
$errors = inline_error($errors); // Set $announcement to input stuff
| $errors = inline_error($errors); // Set $announcement to input stuff
|
Zeile 663 | Zeile 671 |
---|
if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1;
|
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;
|
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']);
| $startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
|
Zeile 678 | Zeile 686 |
---|
$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 689 | Zeile 697 |
---|
$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
| }
// 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"; }
| { $enddateday .= "<option value=\"$i\">$i</option>\n"; }
|
Zeile 747 | Zeile 755 |
---|
$html_sel = $mycode_sel = $smilies_sel = array(); if($mybb->input['allowhtml'] || !isset($mybb->input['allowhtml']))
|
$html_sel = $mycode_sel = $smilies_sel = array(); if($mybb->input['allowhtml'] || !isset($mybb->input['allowhtml']))
|
{ $html_sel['yes'] = ' checked="checked"';
| { $html_sel['yes'] = ' checked="checked"';
|
} else { $html_sel['no'] = ' checked="checked"';
|
} else { $html_sel['no'] = ' checked="checked"';
|
}
| }
|
if($mybb->input['allowmycode'] || !isset($mybb->input['allowmycode'])) { $mycode_sel['yes'] = ' checked="checked"';
|
if($mybb->input['allowmycode'] || !isset($mybb->input['allowmycode'])) { $mycode_sel['yes'] = ' checked="checked"';
|
} else
| } else
|
{ $mycode_sel['no'] = ' checked="checked"'; }
| { $mycode_sel['no'] = ' checked="checked"'; }
|
Zeile 767 | Zeile 775 |
---|
if($mybb->input['allowsmilies'] || !isset($mybb->input['allowsmilies'])) { $smilies_sel['yes'] = ' checked="checked"';
|
if($mybb->input['allowsmilies'] || !isset($mybb->input['allowsmilies'])) { $smilies_sel['yes'] = ' checked="checked"';
|
} else {
| } else {
|
$smilies_sel['no'] = ' checked="checked"'; }
if($mybb->input['endtime_type'] == 2 || !isset($mybb->input['endtime_type']))
|
$smilies_sel['no'] = ' checked="checked"'; }
if($mybb->input['endtime_type'] == 2 || !isset($mybb->input['endtime_type']))
|
{
| {
|
$end_type_sel['infinite'] = ' checked="checked"'; } else
| $end_type_sel['infinite'] = ' checked="checked"'; } else
|
Zeile 788 | Zeile 796 |
---|
eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";"); output_page($announcements);
|
eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";"); output_page($announcements);
|
}
| }
|
if($mybb->input['action'] == "do_edit_announcement") { verify_post_check($mybb->input['my_post_key']);
| if($mybb->input['action'] == "do_edit_announcement") { verify_post_check($mybb->input['my_post_key']);
|
Zeile 803 | Zeile 811 |
---|
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']))) { error_no_permission();
|
// Mod has permissions to edit this announcement if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid']))) { error_no_permission();
|
}
| }
|
// Basic error checking if(!trim($mybb->input['title']))
| // Basic error checking if(!trim($mybb->input['title']))
|
Zeile 827 | Zeile 835 |
---|
$errors[] = $lang->error_missing_forum; }
|
$errors[] = $lang->error_missing_forum; }
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
| $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; }
| { $mybb->input['starttime_month'] = 1; }
|
Zeile 849 | Zeile 880 |
---|
{ $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 940 | Zeile 971 |
---|
} 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 1041 | Zeile 1072 |
---|
if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0)) { $end_type_sel['infinite'] = ' checked="checked"';
|
if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0)) { $end_type_sel['infinite'] = ' checked="checked"';
|
} else
| } else
|
{ $end_type_sel['finite'] = ' checked="checked"'; }
|
{ $end_type_sel['finite'] = ' checked="checked"'; }
|
|
|
// MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
|
// MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
|
|
|
eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";"); output_page($announcements); }
| eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";"); output_page($announcements); }
|
Zeile 1058 | Zeile 1089 |
---|
if($mybb->input['action'] == "announcements") { add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
|
if($mybb->input['action'] == "announcements") { add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
|
|
|
// Fetch announcements into their proper arrays $query = $db->simple_select("announcements", "aid, fid, subject, enddate"); while($announcement = $db->fetch_array($query))
|
// Fetch announcements into their proper arrays $query = $db->simple_select("announcements", "aid, fid, subject, enddate"); while($announcement = $db->fetch_array($query))
|
{
| {
|
if($announcement['fid'] == -1) { $global_announcements[$announcement['aid']] = $announcement;
| if($announcement['fid'] == -1) { $global_announcements[$announcement['aid']] = $announcement;
|
Zeile 1074 | Zeile 1105 |
---|
if($mybb->usergroup['issupermod'] == 1) { if($global_announcements && $mybb->usergroup['issupermod'] == 1)
|
if($mybb->usergroup['issupermod'] == 1) { if($global_announcements && $mybb->usergroup['issupermod'] == 1)
|
{
| {
|
// Get the global announcements foreach($global_announcements as $aid => $announcement) {
| // Get the global announcements foreach($global_announcements as $aid => $announcement) {
|
Zeile 1145 | Zeile 1176 |
---|
{ $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 1167 | Zeile 1199 |
---|
{ $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']];
| while($attachment = $db->fetch_array($query)) { $action = $mybb->input['attachments'][$attachment['aid']];
|
Zeile 1227 | Zeile 1266 |
---|
$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 1310 | Zeile 1349 |
---|
$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 1370 | Zeile 1409 |
---|
}
$perpage = $mybb->settings['postsperpage'];
|
}
$perpage = $mybb->settings['postsperpage'];
|
$pages = $unapprovedthreads / $perpage;
| $pages = $unapproved_attachments / $perpage;
|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
| $pages = ceil($pages);
if($mybb->input['page'] == "last")
|
Zeile 1393 | Zeile 1432 |
---|
$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 1472 | Zeile 1511 |
---|
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['cancp'] == 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 1561 | Zeile 1600 |
---|
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['cancp'] == 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 1605 | Zeile 1644 |
---|
} 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 1625 | Zeile 1672 |
---|
$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 1769 | Zeile 1816 |
---|
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) {
| } if($profilefield['required'] == 1) {
|
Zeile 1803 | Zeile 1855 |
---|
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'];
|
}
| }
|
$where = '';
if($mybb->input['username']) { $where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";
|
$where = '';
if($mybb->input['username']) { $where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";
|
}
| }
|
// Sort order & direction switch($mybb->input['sortby'])
|
// Sort order & direction switch($mybb->input['sortby'])
|
{
| {
|
case "lastvisit": $sortby = "lastvisit";
|
case "lastvisit": $sortby = "lastvisit";
|
break;
| break;
|
case "postnum": $sortby = "postnum"; break;
| case "postnum": $sortby = "postnum"; break;
|
Zeile 1830 | Zeile 1883 |
---|
$sortby = "regdate"; } $order = $mybb->input['order'];
|
$sortby = "regdate"; } $order = $mybb->input['order'];
|
if($order != "asc") { $order = "desc"; }
| if($order != "asc") { $order = "desc"; }
|
$query = $db->simple_select("users", "COUNT(uid) AS count", "1=1 {$where}"); $user_count = $db->fetch_field($query, "count");
| $query = $db->simple_select("users", "COUNT(uid) AS count", "1=1 {$where}"); $user_count = $db->fetch_field($query, "count");
|
Zeile 1872 | Zeile 1925 |
---|
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 1888 | Zeile 1942 |
---|
$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 1915 | Zeile 1969 |
---|
$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 1923 | Zeile 1978 |
---|
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 1931 | Zeile 1986 |
---|
$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'])
|
{
| {
|
$search['mod_uid'] = intval($mybb->input['filter']['mod_uid']); $where_sql .= " AND w.issuedby='{$search['mod_uid']}'"; if(!isset($mybb->input['search']['mod_username'])) { $mod_user = get_user($mybb->input['search']['uid']);
|
$search['mod_uid'] = intval($mybb->input['filter']['mod_uid']); $where_sql .= " AND w.issuedby='{$search['mod_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 1998 | Zeile 2055 |
---|
if(isset($mybb->input['filter']['per_page']) && intval($mybb->input['filter']['per_page']) > 0) { $per_page = intval($mybb->input['filter']['per_page']);
|
if(isset($mybb->input['filter']['per_page']) && intval($mybb->input['filter']['per_page']) > 0) { $per_page = intval($mybb->input['filter']['per_page']);
|
}
| }
|
$start = ($page-1) * $per_page; // Build the base URL for pagination links $url = 'modcp.php?action=warninglogs';
| $start = ($page-1) * $per_page; // Build the base URL for pagination links $url = 'modcp.php?action=warninglogs';
|
Zeile 2029 | Zeile 2086 |
---|
LIMIT {$start}, {$per_page} "; $query = $db->query($sql);
|
LIMIT {$start}, {$per_page} "; $query = $db->query($sql);
|
|
|
$warning_list = ''; while($row = $db->fetch_array($query)) {
| $warning_list = ''; while($row = $db->fetch_array($query)) {
|
Zeile 2051 | Zeile 2108 |
---|
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']).' '.my_date($mybb->settings['timeformat'], $row['expires']); } else
|
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']).' '.my_date($mybb->settings['timeformat'], $row['expires']); } else
|
{
| {
|
$expire_date = $lang->never; } $title = $row['title']; if(empty($row['title']))
|
$expire_date = $lang->never; } $title = $row['title']; if(empty($row['title']))
|
{
| {
|
$title = $row['custom_title']; } $title = htmlspecialchars_uni($title);
| $title = $row['custom_title']; } $title = htmlspecialchars_uni($title);
|
Zeile 2071 | Zeile 2128 |
---|
if(!$warning_list) { eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");
|
if(!$warning_list) { eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");
|
}
| }
|
eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs);
| eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs);
|
Zeile 2087 | Zeile 2144 |
---|
{ $groupscache = $cache->read("usergroups"); }
|
{ $groupscache = $cache->read("usergroups"); }
|
|
|
$ipaddressvalue = htmlspecialchars_uni($mybb->input['ipaddress']);
// Searching post IP addresses
| $ipaddressvalue = htmlspecialchars_uni($mybb->input['ipaddress']);
// Searching post IP addresses
|
Zeile 2097 | Zeile 2154 |
---|
if(strpos($mybb->input['ipaddress'], ":") !== false) { $post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";
|
if(strpos($mybb->input['ipaddress'], ":") !== false) { $post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";
|
}
| }
|
else { $ip_range = fetch_longipv4_range($mybb->input['ipaddress']); if(!is_array($ip_range))
|
else { $ip_range = fetch_longipv4_range($mybb->input['ipaddress']); if(!is_array($ip_range))
|
{
| {
|
$post_ip_sql = "longipaddress='{$ip_range}'"; } else
| $post_ip_sql = "longipaddress='{$ip_range}'"; } else
|
Zeile 2112 | Zeile 2169 |
---|
} $query = $db->query(" SELECT COUNT(pid) AS count
|
} $query = $db->query(" SELECT COUNT(pid) AS count
|
FROM ".TABLE_PREFIX."posts
| FROM ".TABLE_PREFIX."posts
|
WHERE {$post_ip_sql} "); $post_results = $db->fetch_field($query, "count");
|
WHERE {$post_ip_sql} "); $post_results = $db->fetch_field($query, "count");
|
}
| }
|
// Searching user IP addresses if($mybb->input['search_users']) {
| // Searching user IP addresses if($mybb->input['search_users']) {
|
Zeile 2132 | Zeile 2189 |
---|
if(!is_array($ip_range)) { $user_ip_sql = "longregip='{$ip_range}' OR longlastip='{$ip_range}'";
|
if(!is_array($ip_range)) { $user_ip_sql = "longregip='{$ip_range}' OR longlastip='{$ip_range}'";
|
}
| }
|
else { $user_ip_sql = "(longregip > '{$ip_range[0]}' AND longregip < '{$ip_range[1]}') OR (longlastip > '{$ip_range[0]}' AND longlastip < '{$ip_range[1]}')";
| else { $user_ip_sql = "(longregip > '{$ip_range[0]}' AND longregip < '{$ip_range[1]}') OR (longlastip > '{$ip_range[0]}' AND longlastip < '{$ip_range[1]}')";
|
Zeile 2150 | Zeile 2207 |
---|
// 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'];
|
}
| }
|
// 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']); }
|
Zeile 2167 | Zeile 2224 |
---|
if($mybb->input['page'] == "last") { $page = $pages;
|
if($mybb->input['page'] == "last") { $page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0)
|
if($page > $pages || $page <= 0)
|
{ $page = 1; }
| { $page = 1; }
|
if($page) { $start = ($page-1) * $perpage;
|
if($page) { $start = ($page-1) * $perpage;
|
}
| }
|
else { $start = 0; $page = 1;
|
else { $start = 0; $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 2194 | Zeile 2251 |
---|
$post_limit = $perpage; if($mybb->input['search_users'] && $start <= $user_results)
|
$post_limit = $perpage; if($mybb->input['search_users'] && $start <= $user_results)
|
{ $query = $db->query("
| { $query = $db->query("
|
SELECT username, uid, regip, lastip FROM ".TABLE_PREFIX."users WHERE {$user_ip_sql}
| SELECT username, uid, regip, lastip FROM ".TABLE_PREFIX."users WHERE {$user_ip_sql}
|
Zeile 2210 | Zeile 2267 |
---|
$regexp_ip = str_replace("\*", "(.*)", preg_quote($mybb->input['ipaddress'], "#")); // Reg IP matches if(preg_match("#{$regexp_ip}#i", $ipaddress['regip']))
|
$regexp_ip = str_replace("\*", "(.*)", preg_quote($mybb->input['ipaddress'], "#")); // Reg IP matches if(preg_match("#{$regexp_ip}#i", $ipaddress['regip']))
|
{
| {
|
$ip = $ipaddress['regip']; $subject = "<strong>{$lang->ipresult_regip}</strong> {$profile_link}";
|
$ip = $ipaddress['regip']; $subject = "<strong>{$lang->ipresult_regip}</strong> {$profile_link}";
|
eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";"); $result = true; }
| eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";"); $result = true; }
|
// Last known IP matches if(preg_match("#{$regexp_ip}#i", $ipaddress['lastip'])) {
| // Last known IP matches if(preg_match("#{$regexp_ip}#i", $ipaddress['lastip'])) {
|
Zeile 2235 | Zeile 2292 |
---|
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")."\";");
| |
}
|
}
|
}
| }
|
if(!$results) { eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");
|
if(!$results) { eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");
|
}
| }
|
if($ipaddressvalue) {
| if($ipaddressvalue) {
|
Zeile 2288 | Zeile 2371 |
---|
if($mybb->input['search_posts']) { $postsearchselect = "checked=\"checked\"";
|
if($mybb->input['search_posts']) { $postsearchselect = "checked=\"checked\"";
|
}
| }
|
if($mybb->input['search_users']) { $usersearchselect = "checked=\"checked\"";
|
if($mybb->input['search_users']) { $usersearchselect = "checked=\"checked\"";
|
}
| }
|
eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";"); output_page($ipsearch); }
|
eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";"); output_page($ipsearch); }
|
|
|
if($mybb->input['action'] == "banning") { add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
| if($mybb->input['action'] == "banning") { add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
|
Zeile 2305 | Zeile 2388 |
---|
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 2316 | 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);
if($mybb->input['page'] == "last")
|
$pages = $postcount / $perpage; $pages = ceil($pages);
if($mybb->input['page'] == "last")
|
{
| {
|
$page = $pages; }
|
$page = $pages; }
|
if($page > $pages || $page <= 0) { $page = 1; }
| if($page > $pages || $page <= 0) { $page = 1; }
|
if($page) { $start = ($page-1) * $perpage;
| if($page) { $start = ($page-1) * $perpage;
|
Zeile 2367 | Zeile 2450 |
---|
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>";
|
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>";
|
}
$admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);
| }
$admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);
|
$trow = alt_trow();
if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
|
$trow = alt_trow();
if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
|
}
| }
|
else { $banned['reason'] = $lang->na;
|
else { $banned['reason'] = $lang->na;
|
}
| }
|
if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---') { $banlength = $lang->permanent;
| if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---') { $banlength = $lang->permanent;
|
Zeile 2391 | Zeile 2474 |
---|
{ $banlength = $bantimes[$banned['bantime']]; $remaining = $banned['lifted']-TIME_NOW;
|
{ $banlength = $bantimes[$banned['bantime']]; $remaining = $banned['lifted']-TIME_NOW;
|
|
|
$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
if($remaining < 3600)
| $timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
if($remaining < 3600)
|
Zeile 2401 | Zeile 2484 |
---|
else if($remaining < 86400) { $timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";
|
else if($remaining < 86400) { $timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";
|
}
| }
|
else if($remaining < 604800) { $timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";
| else if($remaining < 604800) { $timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";
|
Zeile 2410 | Zeile 2493 |
---|
{ $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; }
|
{ $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; }
|
}
| }
|
eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";"); }
if(!$bannedusers)
|
eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";"); }
if(!$bannedusers)
|
{
| {
|
eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";");
|
eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";");
|
}
$plugins->run_hooks("modcp_banning");
| }
$plugins->run_hooks("modcp_banning");
|
eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";"); output_page($bannedpage); }
| eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";"); output_page($bannedpage); }
|
Zeile 2435 | Zeile 2518 |
---|
$ban = $db->fetch_array($query);
if(!$ban['uid'])
|
$ban = $db->fetch_array($query);
if(!$ban['uid'])
|
{ $lang->error_invalidban; }
| { error($lang->error_invalidban); }
|
// Permission to edit this ban? if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
| // Permission to edit this ban? if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
Zeile 2452 | Zeile 2535 |
---|
); $db->update_query("users", $updated_group, "uid='{$ban['uid']}'"); $db->delete_query("banned", "uid='{$ban['uid']}'");
|
); $db->update_query("users", $updated_group, "uid='{$ban['uid']}'"); $db->delete_query("banned", "uid='{$ban['uid']}'");
|
|
|
$cache->update_banned(); $cache->update_moderators();
| $cache->update_banned(); $cache->update_moderators();
|
Zeile 2485 | Zeile 2568 |
---|
{ 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 2575 | Zeile 2656 |
---|
);
$db->insert_query('banned', $insert_array);
|
);
$db->insert_query('banned', $insert_array);
|
}
| }
|
// Move the user to the banned group $update_array = array(
| // Move the user to the banned group $update_array = array(
|
Zeile 2584 | Zeile 2665 |
---|
'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
|
|
$cache->update_banned();
if($mybb->input['uid'])
| $cache->update_banned();
if($mybb->input['uid'])
|
Zeile 2614 | Zeile 2695 |
---|
else { add_breadcrumb($lang->mcp_nav_editing_ban);
|
else { add_breadcrumb($lang->mcp_nav_editing_ban);
|
}
| }
|
// If incoming user ID, we are editing a ban if($mybb->input['uid']) { $query = $db->query("
|
// If incoming user ID, we are editing a ban 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 2631 | Zeile 2712 |
---|
$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 2680 | Zeile 2763 |
---|
$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 2692 | Zeile 2775 |
---|
} $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);
| eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser);
|
Zeile 2699 | Zeile 2784 |
---|
if($mybb->input['action'] == "do_modnotes") {
|
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 2722 | Zeile 2810 |
---|
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 2755 | Zeile 2843 |
---|
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 2770 | Zeile 2858 |
---|
$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 2796 | Zeile 2884 |
---|
$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 2821 | Zeile 2909 |
---|
while($logitem = $db->fetch_array($query)) { $information = '';
|
while($logitem = $db->fetch_array($query)) { $information = '';
|
| $logitem['action'] = htmlspecialchars_uni($logitem['action']);
|
$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']); $trow = alt_trow();
| $log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']); $trow = alt_trow();
|