Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: modcp.php 5418 2011-03-24 14:03:12Z jammerx2 $
| * $Id$
|
*/
define("IN_MYBB", 1); define('THIS_SCRIPT', 'modcp.php');
|
*/
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_banning_multipage,modcp_banning_nobanned,modcp_banning_auser,modcp_banning_error"; $templatelist .= ",modcp_banning_edit,modcp_banning_banned_user,modcp_nav,modcp_modlogs_noresults,modcp"; $templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements"; $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,modcp_modlogs_result,modcp_editprofile_signature_info,modcp_editprofile_signature_options,modcp_editprofile_signature";
| $templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread"; $templatelist .= ",modcp_banning_multipage,modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty"; $templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp,modcp_modqueue_posts,modcp_modqueue_attachments_attachment,modcp_modqueue_attachments_empty,modcp_modqueue_attachments,modcp_editprofile_suspensions_info"; $templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements,modcp_editprofile_select_option,modcp_editprofile_select,modcp_finduser_noresults"; $templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result"; $templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info"; $templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread"; $templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,modcp_announcements_forum_nomod,modcp_announcements_announcement,multipage_prevpage"; $templatelist .= ",multipage_start,multipage_page_current,multipage_page,multipage_end,multipage_nextpage,multipage";
|
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 67 | Zeile 68 |
---|
else { $flist = $tflist = '';
|
else { $flist = $tflist = '';
|
| }
// Retrieve a list of unviewable forums $unviewableforums = get_unviewable_forums();
if($unviewableforums && !is_super_admin($mybb->user['uid'])) { $flist .= " AND fid NOT IN ({$unviewableforums})"; $tflist .= " AND t.fid NOT IN ({$unviewableforums})";
$unviewableforums = str_replace("'", '', $unviewableforums); $unviewableforums = explode(',', $unviewableforums); } else { $unviewableforums = array();
|
}
// Fetch the Mod CP menu
| }
// Fetch the Mod CP menu
|
Zeile 81 | Zeile 98 |
---|
{ // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
{ // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
|
|
if(!is_array($mybb->input['reports']))
|
if(!is_array($mybb->input['reports']))
|
{
| {
|
error($lang->error_noselected_reports);
|
error($lang->error_noselected_reports);
|
}
| }
$sql = '1=1'; if(!$mybb->input['allbox']) { $mybb->input['reports'] = array_map("intval", $mybb->input['reports']); $rids = implode($mybb->input['reports'], "','"); $rids = "'0','{$rids}'";
|
|
|
$mybb->input['reports'] = array_map("intval", $mybb->input['reports']); $rids = implode($mybb->input['reports'], "','"); $rids = "'0','{$rids}'";
| $sql = "rid IN ({$rids})"; }
|
$plugins->run_hooks("modcp_do_reports");
|
$plugins->run_hooks("modcp_do_reports");
|
$db->update_query("reportedposts", array('reportstatus' => 1), "rid IN ({$rids}){$flist}");
| $db->update_query("reportedposts", array('reportstatus' => 1), "{$sql}{$flist}");
|
$cache->update_reportedposts(); $page = intval($mybb->input['page']);
| $cache->update_reportedposts(); $page = intval($mybb->input['page']);
|
Zeile 104 | Zeile 127 |
---|
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;
|
Zeile 121 | Zeile 144 |
---|
$report_count = $db->fetch_field($query, "count");
$mybb->input['rid'] = intval($mybb->input['rid']);
|
$report_count = $db->fetch_field($query, "count");
$mybb->input['rid'] = intval($mybb->input['rid']);
|
if($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)
| $query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'"); $result = $db->fetch_field($query, "count"); if(($result % $perpage) == 0)
|
Zeile 186 | Zeile 209 |
---|
ORDER BY r.dateline DESC LIMIT {$start}, {$perpage} ");
|
ORDER BY r.dateline DESC LIMIT {$start}, {$perpage} ");
|
while($report = $db->fetch_array($query))
| if(!$db->num_rows($query)) { eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";"); } else
|
{
|
{
|
$trow = alt_trow(); if(is_moderator($report['fid']))
| while($report = $db->fetch_array($query))
|
{
|
{
|
$trow = 'trow_shaded';
| $trow = alt_trow(); if(is_moderator($report['fid'])) { $trow = 'trow_shaded'; }
$report['postlink'] = get_post_link($report['pid'], $report['tid']); $report['threadlink'] = get_thread_link($report['tid']); $report['posterlink'] = get_profile_link($report['postuid']); $report['reporterlink'] = get_profile_link($report['uid']); $reportdate = my_date($mybb->settings['dateformat'], $report['dateline']); $reporttime = my_date($mybb->settings['timeformat'], $report['dateline']); $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");
|
}
|
}
|
$report['postlink'] = get_post_link($report['pid'], $report['tid']); $report['threadlink'] = get_thread_link($report['tid']); $report['posterlink'] = get_profile_link($report['postuid']); $report['reporterlink'] = get_profile_link($report['uid']); $reportdate = my_date($mybb->settings['dateformat'], $report['dateline']); $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")."\";"); }
$plugins->run_hooks("modcp_reports");
| }
$plugins->run_hooks("modcp_reports_end");
|
eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";"); output_page($reportedposts); }
| eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";"); output_page($reportedposts); }
|
Zeile 218 | Zeile 247 |
---|
add_breadcrumb($lang->mcp_nav_all_reported_posts, "modcp.php?action=allreports");
if(!$mybb->settings['threadsperpage'])
|
add_breadcrumb($lang->mcp_nav_all_reported_posts, "modcp.php?action=allreports");
if(!$mybb->settings['threadsperpage'])
|
{
| {
|
$mybb->settings['threadsperpage'] = 20; }
| $mybb->settings['threadsperpage'] = 20; }
|
Zeile 228 | Zeile 257 |
---|
{ $page = intval($mybb->input['page']); }
|
{ $page = intval($mybb->input['page']); }
|
|
|
$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");
|
Zeile 237 | Zeile 266 |
---|
$mybb->input['rid'] = intval($mybb->input['rid']); $query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'"); $result = $db->fetch_field($query, "count");
|
$mybb->input['rid'] = intval($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) {
| if(($result % $perpage) == 0) {
|
$page = $result / $perpage; } else
| $page = $result / $perpage; } else
|
Zeile 256 | Zeile 285 |
---|
}
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;
|
}
| }
|
$upper = $start+$perpage;
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=allreports"); if($postcount > $perpage)
|
$upper = $start+$perpage;
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=allreports"); if($postcount > $perpage)
|
{
| {
|
eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
}
$query = $db->simple_select("forums", "fid, name"); while($forum = $db->fetch_array($query)) { $forums[$forum['fid']] = $forum['name'];
| |
} $plugins->run_hooks("modcp_allreports_start");
|
} $plugins->run_hooks("modcp_allreports_start");
|
$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
| $query = $db->query(" SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject FROM ".TABLE_PREFIX."reportedposts r
|
Zeile 294 | Zeile 316 |
---|
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid) ORDER BY r.dateline DESC
|
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid) ORDER BY r.dateline DESC
|
LIMIT $start, $perpage
| LIMIT {$start}, {$perpage}
|
");
|
");
|
while($report = $db->fetch_array($query)) { $report['postlink'] = get_post_link($report['pid'], $report['tid']); $report['threadlink'] = get_thread_link($report['tid']); $report['posterlink'] = get_profile_link($report['postuid']); $report['reporterlink'] = get_profile_link($report['uid']);
| |
|
|
$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']); $reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
if($report['reportstatus'] == 0) { $trow = "trow_shaded"; } else
| $allreports = ''; if(!$db->num_rows($query)) { eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";"); } else { while($report = $db->fetch_array($query))
|
{ $trow = alt_trow();
|
{ $trow = alt_trow();
|
}
| $report['threadlink'] = get_thread_link($report['tid']);
$report['posterlink'] = get_profile_link($report['postuid']); $report['postlink'] = get_post_link($report['pid'], $report['tid']); $report['postusername'] = build_profile_link($report['postusername'], $report['postuid']); $report['reporterlink'] = get_profile_link($report['uid']);
|
|
|
$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);
| $reportdate = my_date($mybb->settings['dateformat'], $report['dateline']); $reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
|
|
|
if($report['threadsubject']) { $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
| if($report['reportstatus'] == 0) { $trow = "trow_shaded"; } // No subject? Set it to N/A if($report['threadsubject'] == '') { $report['threadsubject'] = $lang->na; } else { // Only parse bad words and sanitize subject if there is one... $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject'])); }
|
$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";
|
$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";
|
} else { $report['threadsubject'] = $lang->na; }
| |
|
|
eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";"); }
if(!$allreports) { eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");
| eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";"); }
|
}
|
}
|
$plugins->run_hooks("modcp_reports");
| $plugins->run_hooks("modcp_allreports_end");
|
eval("\$allreportedposts = \"".$templates->get("modcp_reports_allreports")."\";"); output_page($allreportedposts);
| eval("\$allreportedposts = \"".$templates->get("modcp_reports_allreports")."\";"); output_page($allreportedposts);
|
Zeile 393 | Zeile 420 |
---|
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}
| WHERE 1=1 {$where}{$tflist}
|
"); $rescount = $db->fetch_field($query, "count");
| "); $rescount = $db->fetch_field($query, "count");
|
Zeile 408 | Zeile 435 |
---|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
{
| {
|
$page = $pages;
|
$page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0)
|
if($page > $pages || $page <= 0)
|
{ $page = 1; }
| { $page = 1; }
|
if($page) {
| if($page) {
|
Zeile 439 | Zeile 466 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)
|
WHERE 1=1 {$where}
| WHERE 1=1 {$where}{$tflist}
|
ORDER BY {$sortby} {$order} LIMIT {$start}, {$perpage} "); while($logitem = $db->fetch_array($query)) { $information = '';
|
ORDER BY {$sortby} {$order} LIMIT {$start}, {$perpage} "); while($logitem = $db->fetch_array($query)) { $information = '';
|
$logitem['action'] = $logitem['action'];
| $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 455 | Zeile 482 |
---|
if($logitem['tsubject']) { $information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
|
if($logitem['tsubject']) { $information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</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'])
|
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>"; }
| $information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>"; }
|
Zeile 484 | Zeile 511 |
---|
} $plugins->run_hooks("modcp_modlogs_filter");
|
} $plugins->run_hooks("modcp_modlogs_filter");
|
|
|
// Fetch filter options $sortbysel[$mybb->input['sortby']] = "selected=\"selected\""; $ordersel[$mybb->input['order']] = "selected=\"selected\"";
| // Fetch filter options $sortbysel[$mybb->input['sortby']] = "selected=\"selected\""; $ordersel[$mybb->input['order']] = "selected=\"selected\"";
|
Zeile 508 | Zeile 535 |
---|
$selected = " selected=\"selected\""; } $user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n";
|
$selected = " selected=\"selected\""; } $user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n";
|
}
$forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, true, '', "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']);
|
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);
if(!$announcement['aid']) { error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid']))) {
| $aid = intval($mybb->input['aid']); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement['aid']) { error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) {
|
error_no_permission(); } $plugins->run_hooks("modcp_do_delete_announcement");
|
error_no_permission(); } $plugins->run_hooks("modcp_do_delete_announcement");
|
|
|
$db->delete_query("announcements", "aid='{$aid}'"); $cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement); }
|
$db->delete_query("announcements", "aid='{$aid}'"); $cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement); }
|
|
|
if($mybb->input['action'] == "delete_announcement") { $aid = intval($mybb->input['aid']); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
|
if($mybb->input['action'] == "delete_announcement") { $aid = intval($mybb->input['aid']); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
|
|
|
$announcement = $db->fetch_array($query);
|
$announcement = $db->fetch_array($query);
|
| $announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
|
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'])))
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
{ error_no_permission(); } $plugins->run_hooks("modcp_delete_announcement");
|
{ error_no_permission(); } $plugins->run_hooks("modcp_delete_announcement");
|
|
|
eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";"); output_page($announcements); }
|
eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";"); output_page($announcements); }
|
|
|
if($mybb->input['action'] == "do_new_announcement") { verify_post_check($mybb->input['my_post_key']);
$announcement_fid = intval($mybb->input['fid']);
|
if($mybb->input['action'] == "do_new_announcement") { verify_post_check($mybb->input['my_post_key']);
$announcement_fid = intval($mybb->input['fid']);
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
| if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 575 | Zeile 605 |
---|
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'])) { $errors[] = $lang->error_missing_message;
| if(!trim($mybb->input['message'])) { $errors[] = $lang->error_missing_message;
|
Zeile 586 | Zeile 616 |
---|
{ $errors[] = $lang->error_missing_forum; }
|
{ $errors[] = $lang->error_missing_forum; }
|
|
|
$startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']);
| $startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']);
|
Zeile 617 | Zeile 647 |
---|
}
$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
|
}
$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)
| if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
|
{ $errors[] = $lang->error_invalid_start_date;
|
{ $errors[] = $lang->error_invalid_start_date;
|
}
| }
|
if($mybb->input['endtime_type'] == "2") { $enddate = '0'; } else
|
if($mybb->input['endtime_type'] == "2") { $enddate = '0'; } else
|
{
| {
|
if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $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(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $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)
| if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)
|
{ $errors[] = $lang->error_invalid_end_date; }
|
{ $errors[] = $lang->error_invalid_end_date; }
|
elseif($enddate < $startdate)
| if($enddate <= $startdate)
|
{ $errors[] = $lang->error_end_before_start; }
| { $errors[] = $lang->error_end_before_start; }
|
Zeile 647 | Zeile 676 |
---|
$plugins->run_hooks("modcp_do_new_announcement_start");
if(!$errors)
|
$plugins->run_hooks("modcp_do_new_announcement_start");
if(!$errors)
|
{
| {
|
$insert_announcement = array( 'fid' => $announcement_fid, 'uid' => $mybb->user['uid'],
| $insert_announcement = array( 'fid' => $announcement_fid, 'uid' => $mybb->user['uid'],
|
Zeile 680 | Zeile 709 |
---|
$announcement_fid = intval($mybb->input['fid']);
|
$announcement_fid = intval($mybb->input['fid']);
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
| if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 711 | Zeile 740 |
---|
$startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']);
|
$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']);
| $starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);
|
$endmonth = $mybb->input['endtime_month']; $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']);
|
$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']);
| $endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
} else {
| } else {
|
Zeile 735 | Zeile 764 |
---|
if($startday == $i) { $startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
if($startday == $i) { $startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
} else
| } else
|
{ $startdateday .= "<option value=\"$i\">$i</option>\n"; }
if($endday == $i)
|
{ $startdateday .= "<option value=\"$i\">$i</option>\n"; }
if($endday == $i)
|
{
| {
|
$enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else
| $enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else
|
Zeile 779 | Zeile 808 |
---|
$enddatemonth .= "<option value=\"11\" {$endmonthsel['11']}>{$lang->november}</option>\n"; $startdatemonth .= "<option value=\"12\" {$startmonthsel['12']}>{$lang->december}</option>\n"; $enddatemonth .= "<option value=\"12\" {$endmonthsel['12']}>{$lang->december}</option>\n";
|
$enddatemonth .= "<option value=\"11\" {$endmonthsel['11']}>{$lang->november}</option>\n"; $startdatemonth .= "<option value=\"12\" {$startmonthsel['12']}>{$lang->december}</option>\n"; $enddatemonth .= "<option value=\"12\" {$endmonthsel['12']}>{$lang->december}</option>\n";
|
|
|
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
| $title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
|
Zeile 846 | Zeile 875 |
---|
}
// Mod has permissions to edit this announcement
|
}
// Mod has permissions to edit this announcement
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 866 | Zeile 895 |
---|
{ $errors[] = $lang->error_missing_forum; }
|
{ $errors[] = $lang->error_missing_forum; }
|
|
|
$startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']);
| $startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']);
|
Zeile 897 | Zeile 926 |
---|
}
$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
|
}
$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)
| if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
|
{ $errors[] = $lang->error_invalid_start_date; }
| { $errors[] = $lang->error_invalid_start_date; }
|
Zeile 913 | Zeile 942 |
---|
$mybb->input['endtime_month'] = 1; } $enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
|
$mybb->input['endtime_month'] = 1; } $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)
| if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)
|
{ $errors[] = $lang->error_invalid_end_date; }
|
{ $errors[] = $lang->error_invalid_end_date; }
|
elseif($enddate < $startdate)
| elseif($enddate <= $startdate)
|
{ $errors[] = $lang->error_end_before_start; }
| { $errors[] = $lang->error_end_before_start; }
|
Zeile 968 | Zeile 997 |
---|
{ error($lang->error_invalid_announcement); }
|
{ error($lang->error_invalid_announcement); }
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
{ error_no_permission();
|
{ error_no_permission();
|
| }
if(!$announcement['startdate']) { // No start date? Make it now. $announcement['startdate'] = TIME_NOW; }
$makeshift_end = false; if(!$announcement['enddate']) { $makeshift_end = true; $makeshift_time = TIME_NOW; if($announcement['startdate']) { $makeshift_time = $announcement['startdate']; }
// No end date? Make it a year from now. $announcement['enddate'] = $makeshift_time + (60 * 60 * 24 * 366);
|
}
// Deal with inline errors
| }
// Deal with inline errors
|
Zeile 999 | Zeile 1048 |
---|
$startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']);
|
$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']);
| $starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);
|
$endmonth = $mybb->input['endtime_month']; $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']);
|
$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']);
| $endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
$errored = true; }
| $errored = true; }
|
Zeile 1107 | Zeile 1156 |
---|
$smilies_sel['no'] = ' checked="checked"'; }
|
$smilies_sel['no'] = ' checked="checked"'; }
|
if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0))
| if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0) || $makeshift_end == true)
|
{ $end_type_sel['infinite'] = ' checked="checked"'; }
| { $end_type_sel['infinite'] = ' checked="checked"'; }
|
Zeile 1152 | Zeile 1201 |
---|
$trow = alt_trow(); if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0)) {
|
$trow = alt_trow(); if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0)) {
|
$icon = "<img src=\"images/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\" style=\"vertical-align: middle;\" /> ";
| $icon = "<img src=\"{$theme['imgdir']}/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\" style=\"vertical-align: middle;\" /> ";
|
} else {
|
} else {
|
$icon = "<img src=\"images/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\" style=\"vertical-align: middle;\" /> ";
| $icon = "<img src=\"{$theme['imgdir']}/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\" style=\"vertical-align: middle;\" /> ";
|
}
$subject = htmlspecialchars_uni($announcement['subject']);
| }
$subject = htmlspecialchars_uni($announcement['subject']);
|
Zeile 1327 | Zeile 1376 |
---|
$page = 1; }
|
$page = 1; }
|
$multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&type=threads");
| $multipage = multipage($unapproved_threads, $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 1413 | Zeile 1462 |
---|
$page = 1; }
|
$page = 1; }
|
$multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&type=posts");
| $multipage = multipage($unapproved_posts, $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 1499 | Zeile 1548 |
---|
$page = 1; }
|
$page = 1; }
|
$multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&type=attachments");
| $multipage = multipage($unapproved_attachments, $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 1672 | Zeile 1721 |
---|
require_once MYBB_ROOT."inc/functions_warnings.php"; foreach($moderator_options as $option) {
|
require_once MYBB_ROOT."inc/functions_warnings.php"; foreach($moderator_options as $option) {
|
| $mybb->input[$option['time']] = intval($mybb->input[$option['time']]);
|
if(!$mybb->input[$option['action']]) { if($user[$option['update_field']] == 1)
| if(!$mybb->input[$option['action']]) { if($user[$option['update_field']] == 1)
|
Zeile 1687 | Zeile 1737 |
---|
if($mybb->input[$option['action']]) {
|
if($mybb->input[$option['action']]) {
|
if(intval($mybb->input[$option['time']]) == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)
| if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)
|
{ // User has selected a type of ban, but not entered a valid time frame $string = $option['action']."_error";
| { // User has selected a type of ban, but not entered a valid time frame $string = $option['action']."_error";
|
Zeile 1752 | Zeile 1802 |
---|
$plugins->run_hooks("modcp_do_editprofile_end"); redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
|
$plugins->run_hooks("modcp_do_editprofile_end"); redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
|
} } }
| } } }
|
if($mybb->input['action'] == "editprofile") { add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");
| if($mybb->input['action'] == "editprofile") { add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");
|
Zeile 1775 | Zeile 1825 |
---|
if($user['website'] == "" || $user['website'] == "http://") { $user['website'] = "http://";
|
if($user['website'] == "" || $user['website'] == "http://") { $user['website'] = "http://";
|
}
| }
|
if($user['icq'] != "0") {
| if($user['icq'] != "0") {
|
Zeile 1787 | Zeile 1837 |
---|
}
if(!$errors)
|
}
if(!$errors)
|
{
| {
|
$mybb->input = array_merge($user, $mybb->input); list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = explode("-", $user['birthday']); }
| $mybb->input = array_merge($user, $mybb->input); list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = explode("-", $user['birthday']); }
|
Zeile 1800 | Zeile 1850 |
---|
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field) { $mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
|
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field) { $mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
|
}
if($user['usertitle'] == "") { $query = $db->simple_select("usertitles", "*", "posts <='".$user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1)); $utitle = $db->fetch_array($query); $defaulttitle = $utitle['title']; } else { if(!$user['displaygroup']) { $user['displaygroup'] = $user['usergroup']; }
$displaygroupfields = array( "usertitle" ); $display_group = usergroup_displaygroup($user['displaygroup']);
| }
// Custom user title, check to see if we have a default group title if(!$user['displaygroup']) { $user['displaygroup'] = $user['usergroup']; }
$displaygroupfields = array('usertitle'); $display_group = usergroup_displaygroup($user['displaygroup']);
if(!empty($display_group['usertitle'])) {
|
$defaulttitle = $display_group['usertitle']; }
|
$defaulttitle = $display_group['usertitle']; }
|
| else { // Go for post count title if a group default isn't set $usertitles = $cache->read('usertitles');
foreach($usertitles as $title) { if($title['posts'] <= $mybb->user['postnum']) { $defaulttitle = $title['title']; } } }
|
if(empty($user['usertitle'])) { $lang->current_custom_usertitle = '';
| if(empty($user['usertitle'])) { $lang->current_custom_usertitle = '';
|
Zeile 1915 | Zeile 1973 |
---|
$val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
|
$val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
|
if($val == $userfield) { $sel = " selected=\"selected\"";
| if($val == $userfield) { $sel = " selected=\"selected\"";
|
} $select .= "<option value=\"$val\"$sel>$val</option>"; }
| } $select .= "<option value=\"$val\"$sel>$val</option>"; }
|
Zeile 2019 | Zeile 2077 |
---|
// Do we mark the suspend signature box? if($user['suspendsignature'] || ($mybb->input['suspendsignature'] && !empty($errors)))
|
// Do we mark the suspend signature box? if($user['suspendsignature'] || ($mybb->input['suspendsignature'] && !empty($errors)))
|
{
| {
|
$checked = 1; $checked_item = "checked=\"checked\""; }
| $checked = 1; $checked_item = "checked=\"checked\""; }
|
Zeile 2037 | Zeile 2095 |
---|
else { $modpost_check = 0;
|
else { $modpost_check = 0;
|
}
| }
|
// Do we mark the suspend posts box? if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
| // Do we mark the suspend posts box? if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
|
Zeile 2056 | Zeile 2114 |
---|
"option" => "suspendsignature", // The field in the database that this option relates to "length" => "suspendsigtime", // The length of suspension field in the database "select_option" => "action" // The name of the select box of this option
|
"option" => "suspendsignature", // The field in the database that this option relates to "length" => "suspendsigtime", // The length of suspension field in the database "select_option" => "action" // The name of the select box of this option
|
),
| ),
|
2 => array( "action" => "moderateposting", "option" => "moderateposts",
| 2 => array( "action" => "moderateposting", "option" => "moderateposts",
|
Zeile 2069 | Zeile 2127 |
---|
"length" => "suspensiontime", "select_option" => "suspost" )
|
"length" => "suspensiontime", "select_option" => "suspost" )
|
);
| );
|
$periods = array( "hours" => $lang->expire_hours, "days" => $lang->expire_days,
| $periods = array( "hours" => $lang->expire_hours, "days" => $lang->expire_days,
|
Zeile 2083 | Zeile 2141 |
---|
{ // Display the suspension info, if this user has this option suspended if($user[$option['option']])
|
{ // Display the suspension info, if this user has this option suspended if($user[$option['option']])
|
{
| {
|
if($user[$option['length']] == 0) { // User has a permanent ban
| if($user[$option['length']] == 0) { // User has a permanent ban
|
Zeile 2121 | Zeile 2179 |
---|
if($mybb->input[$string] == $key) { $selected = "selected=\"selected\"";
|
if($mybb->input[$string] == $key) { $selected = "selected=\"selected\"";
|
}
| }
|
else { $selected = ''; }
eval("\$selection_options .= \"".$templates->get("modcp_editprofile_select_option")."\";");
|
else { $selected = ''; }
eval("\$selection_options .= \"".$templates->get("modcp_editprofile_select_option")."\";");
|
}
| }
|
$select_name = $option['select_option']."_period"; switch($option['option'])
| $select_name = $option['select_option']."_period"; switch($option['option'])
|
Zeile 2146 | Zeile 2204 |
---|
}
eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");
|
}
eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");
|
|
|
$plugins->run_hooks("modcp_editprofile_end");
eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");
| $plugins->run_hooks("modcp_editprofile_end");
eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");
|
Zeile 2159 | Zeile 2217 |
---|
$perpage = intval($mybb->input['perpage']); if(!$perpage || $perpage <= 0)
|
$perpage = intval($mybb->input['perpage']); if(!$perpage || $perpage <= 0)
|
{
| {
|
$perpage = $mybb->settings['threadsperpage']; } $where = '';
| $perpage = $mybb->settings['threadsperpage']; } $where = '';
|
Zeile 2171 | Zeile 2229 |
---|
// Sort order & direction switch($mybb->input['sortby'])
|
// Sort order & direction switch($mybb->input['sortby'])
|
{
| {
|
case "lastvisit": $sortby = "lastvisit"; break;
| case "lastvisit": $sortby = "lastvisit"; break;
|
Zeile 2464 | Zeile 2522 |
---|
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)) { $post_ip_sql = "longipaddress='{$ip_range}'"; } else
| } else { $ip_range = fetch_longipv4_range($mybb->input['ipaddress']); if($ip_range)
|
{
|
{
|
$post_ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
| if(!is_array($ip_range)) { $post_ip_sql = "longipaddress='{$ip_range}'"; } else { $post_ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'"; }
|
} }
|
} }
|
|
|
$plugins->run_hooks("modcp_ipsearch_posts_start");
|
$plugins->run_hooks("modcp_ipsearch_posts_start");
|
$query = $db->query(" SELECT COUNT(pid) AS count FROM ".TABLE_PREFIX."posts WHERE {$post_ip_sql} "); $post_results = $db->fetch_field($query, "count"); }
| if($post_ip_sql) { $query = $db->query(" SELECT COUNT(pid) AS count FROM ".TABLE_PREFIX."posts 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 2495 | Zeile 2563 |
---|
$user_ip_sql = "regip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."' OR lastip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'"; } else
|
$user_ip_sql = "regip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."' OR lastip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'"; } else
|
{
| {
|
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);
|
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);
|
if(!is_array($ip_range))
| if($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]}')";
| 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]}')"; }
|
} }
|
} }
|
|
|
$plugins->run_hooks("modcp_ipsearch_users_start");
|
$plugins->run_hooks("modcp_ipsearch_users_start");
|
$query = $db->query(" SELECT COUNT(uid) AS count FROM ".TABLE_PREFIX."users WHERE {$user_ip_sql} "); $user_results = $db->fetch_field($query, "count"); }
| if($user_ip_sql) { $query = $db->query(" SELECT COUNT(uid) AS count FROM ".TABLE_PREFIX."users WHERE {$user_ip_sql} ");
$user_results = $db->fetch_field($query, "count"); } }
|
$total_results = $post_results+$user_results;
|
$total_results = $post_results+$user_results;
|
| if(!$total_results) { $total_results = 1; }
|
// Now we have the result counts, paginate $perpage = intval($mybb->input['perpage']);
| // Now we have the result counts, paginate $perpage = intval($mybb->input['perpage']);
|
Zeile 2562 | Zeile 2645 |
---|
$multipage = multipage($total_results, $perpage, $page, $page_url);
$post_limit = $perpage;
|
$multipage = multipage($total_results, $perpage, $page, $page_url);
$post_limit = $perpage;
|
if($mybb->input['search_users'] && $start <= $user_results)
| if($mybb->input['search_users'] && $user_results && $start <= $user_results)
|
{ $query = $db->query(" SELECT username, uid, regip, lastip
| { $query = $db->query(" SELECT username, uid, regip, lastip
|
Zeile 2609 | Zeile 2692 |
---|
$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'] && $post_results && (!$mybb->input['search_users'] || ($mybb->input['search_users'] && $post_limit > 0)))
|
{ $ipaddresses = $tids = $uids = array(); $query = $db->query("
| { $ipaddresses = $tids = $uids = array(); $query = $db->query("
|
Zeile 2673 | Zeile 2756 |
---|
if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":")) {
|
if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":")) {
|
$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";
| $misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".urlencode($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";
|
}
eval("\$ipsearch_results = \"".$templates->get("modcp_ipsearch_results")."\";");
| }
eval("\$ipsearch_results = \"".$templates->get("modcp_ipsearch_results")."\";");
|
Zeile 2887 | Zeile 2970 |
---|
} $plugins->run_hooks("modcp_liftban_start");
|
} $plugins->run_hooks("modcp_liftban_start");
|
| $query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'"); $username = $db->fetch_field($query, "username");
|
$updated_group = array( 'usergroup' => $ban['oldgroup'],
| $updated_group = array( 'usergroup' => $ban['oldgroup'],
|
Zeile 2895 | Zeile 2981 |
---|
); $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();
|
| log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);
|
$plugins->run_hooks("modcp_liftban_end");
|
$plugins->run_hooks("modcp_liftban_end");
|
|
|
redirect("modcp.php?action=banning", $lang->redirect_banlifted); }
| redirect("modcp.php?action=banning", $lang->redirect_banlifted); }
|
Zeile 2927 | Zeile 3014 |
---|
// Permission to edit this ban? if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
// Permission to edit this ban? if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
}
| }
|
} // Creating a new ban else { // Get the users info from their Username
|
} // Creating a new ban else { // Get the users info from their Username
|
$query = $db->simple_select("users", "uid, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
| $query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
|
$user = $db->fetch_array($query); if(!$user['uid']) { $errors[] = $lang->invalid_username;
|
$user = $db->fetch_array($query); if(!$user['uid']) { $errors[] = $lang->invalid_username;
|
} }
| } }
|
if($user['uid'] == $mybb->user['uid']) {
| if($user['uid'] == $mybb->user['uid']) {
|
Zeile 2994 | Zeile 3081 |
---|
if($mybb->input['uid']) {
|
if($mybb->input['uid']) {
|
| $username_select = $db->simple_select('users', 'username', "uid='" . (int)$mybb->input['uid'] . "'"); $user['username'] = $db->fetch_field($username_select, 'username');
|
$update_array = array(
|
$update_array = array(
|
'gid' => intval($mybb->input['usergroup']), 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['liftafter']), 'lifted' => $db->escape_string($lifted),
| 'gid' => intval($mybb->input['usergroup']), 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['liftafter']), 'lifted' => $db->escape_string($lifted),
|
'reason' => $db->escape_string($mybb->input['banreason']) );
$db->update_query('banned', $update_array, "uid='{$user['uid']}'");
|
'reason' => $db->escape_string($mybb->input['banreason']) );
$db->update_query('banned', $update_array, "uid='{$user['uid']}'");
|
} else {
| } else {
|
$insert_array = array( 'uid' => $user['uid'], 'gid' => intval($mybb->input['usergroup']),
| $insert_array = array( 'uid' => $user['uid'], 'gid' => intval($mybb->input['usergroup']),
|
Zeile 3019 | Zeile 3108 |
---|
'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['banreason']) );
|
'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['banreason']) );
|
|
|
$db->insert_query('banned', $insert_array); }
| $db->insert_query('banned', $insert_array); }
|
Zeile 3032 | Zeile 3121 |
---|
$db->update_query('users', $update_array, "uid = {$user['uid']}");
$cache->update_banned();
|
$db->update_query('users', $update_array, "uid = {$user['uid']}");
$cache->update_banned();
|
| // Log edit or add ban if($mybb->input['uid']) { log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban); } else { log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user); }
|
$plugins->run_hooks("modcp_do_banuser_end");
if($mybb->input['uid']) { redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
|
$plugins->run_hooks("modcp_do_banuser_end");
if($mybb->input['uid']) { redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
|
}
| }
|
else { redirect("modcp.php?action=banning", $lang->redirect_banuser);
| else { redirect("modcp.php?action=banning", $lang->redirect_banuser);
|
Zeile 3048 | Zeile 3147 |
---|
else { $mybb->input['action'] = "banuser";
|
else { $mybb->input['action'] = "banuser";
|
} }
| } }
|
if($mybb->input['action'] == "banuser") { add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
| if($mybb->input['action'] == "banuser") { add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
|
Zeile 3062 | Zeile 3161 |
---|
else { add_breadcrumb($lang->mcp_nav_editing_ban);
|
else { add_breadcrumb($lang->mcp_nav_editing_ban);
|
}
| }
|
$plugins->run_hooks("modcp_banuser_start");
// If incoming user ID, we are editing a ban
| $plugins->run_hooks("modcp_banuser_start");
// If incoming user ID, we are editing a ban
|
Zeile 3100 | Zeile 3199 |
---|
$username = htmlspecialchars_uni($mybb->input['username']); } eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");
|
$username = htmlspecialchars_uni($mybb->input['username']); } eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");
|
}
| }
|
// Coming back to this page from an error? if($errors) {
| // Coming back to this page from an error? if($errors) {
|
Zeile 3121 | Zeile 3220 |
---|
if($banned['bantime'] == $time) { $liftlist .= " selected=\"selected\"";
|
if($banned['bantime'] == $time) { $liftlist .= " selected=\"selected\"";
|
}
| }
|
$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 == '---') {
|
Zeile 3146 | Zeile 3245 |
---|
} $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>";
|
} $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>";
|
|
|
$plugins->run_hooks("modcp_banuser_end"); eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser);
|
$plugins->run_hooks("modcp_banuser_end"); 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']); $plugins->run_hooks("modcp_do_modnotes_start");
|
if($mybb->input['action'] == "do_modnotes") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); $plugins->run_hooks("modcp_do_modnotes_start");
|
|
|
// Update Moderator Notes cache $update_cache = array( "modmessage" => $mybb->input['modnotes'] ); $cache->update("modnotes", $update_cache);
|
// Update Moderator Notes cache $update_cache = array( "modmessage" => $mybb->input['modnotes'] ); $cache->update("modnotes", $update_cache);
|
|
|
$plugins->run_hooks("modcp_do_modnotes_end"); redirect("modcp.php", $lang->redirect_modnotes);
| $plugins->run_hooks("modcp_do_modnotes_end"); redirect("modcp.php", $lang->redirect_modnotes);
|
Zeile 3201 | Zeile 3300 |
---|
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
|
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
|
} else
| } else
|
{ $latest_attachment = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>"; }
| { $latest_attachment = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>"; }
|
Zeile 3269 | Zeile 3368 |
---|
else { $latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";
|
else { $latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";
|
| }
$where = ''; if($tflist) { $where = "WHERE (t.fid <> 0 {$tflist}) OR (!l.fid)";
|
}
$query = $db->query("
| }
$query = $db->query("
|
Zeile 3278 | Zeile 3383 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)
|
| {$where}
|
ORDER BY l.dateline DESC LIMIT 5 ");
|
ORDER BY l.dateline DESC LIMIT 5 ");
|
|
|
while($logitem = $db->fetch_array($query)) { $information = '';
|
while($logitem = $db->fetch_array($query)) { $information = '';
|
$logitem['action'] = $logitem['action'];
| $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 3293 | Zeile 3400 |
---|
if($logitem['tsubject']) { $information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
|
if($logitem['tsubject']) { $information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
|
}
| }
|
if($logitem['fname']) { $information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";
|
if($logitem['fname']) { $information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($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>";
|
Zeile 3305 | Zeile 3412 |
---|
// Edited a user? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
|
// Edited a user? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
|
{
| {
|
$data = unserialize($logitem['data']); if($data['uid']) {
| $data = unserialize($logitem['data']); if($data['uid']) {
|
Zeile 3406 | Zeile 3513 |
---|
eval("\$modcp = \"".$templates->get("modcp")."\";"); output_page($modcp); }
|
eval("\$modcp = \"".$templates->get("modcp")."\";"); output_page($modcp); }
|
| |
?>
| ?>
|