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 5761 2012-03-22 15:22:01Z Tomm $
| * $Id$
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 76 | Zeile 76 |
---|
{ $flist .= " AND fid NOT IN ({$unviewableforums})"; $tflist .= " AND t.fid NOT IN ({$unviewableforums})";
|
{ $flist .= " AND fid NOT IN ({$unviewableforums})"; $tflist .= " AND t.fid NOT IN ({$unviewableforums})";
|
| $unviewableforums = str_replace("'", '', $unviewableforums); $unviewableforums = explode(',', $unviewableforums);
|
}
// 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
| $plugins->run_hooks("modcp_start");
// Make navigation
|
Zeile 102 | Zeile 105 |
---|
$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})"; }
| $sql = "rid IN ({$rids})"; }
|
Zeile 112 | Zeile 115 |
---|
$cache->update_reportedposts(); $page = intval($mybb->input['page']);
|
$cache->update_reportedposts(); $page = intval($mybb->input['page']);
|
|
|
redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked); }
| redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked); }
|
Zeile 123 | Zeile 126 |
---|
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'];
| // Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage'];
|
Zeile 136 | Zeile 139 |
---|
$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']) { $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; } }
| 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);
| $postcount = intval($report_count); $pages = $postcount / $perpage; $pages = ceil($pages);
|
Zeile 160 | Zeile 163 |
---|
}
if($page > $pages || $page <= 0)
|
}
if($page > $pages || $page <= 0)
|
{ $page = 1; }
| { $page = 1; }
|
if($page && $page > 0) { $start = ($page-1) * $perpage;
|
if($page && $page > 0) { $start = ($page-1) * $perpage;
|
} else
| } else
|
{ $start = 0; $page = 1;
| { $start = 0; $page = 1;
|
Zeile 179 | Zeile 182 |
---|
if($postcount > $perpage) { eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
if($postcount > $perpage) { eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
}
$query = $db->simple_select("forums", "fid, name"); while($forum = $db->fetch_array($query)) { $forums[$forum['fid']] = $forum['name']; }
| }
$query = $db->simple_select("forums", "fid, name"); while($forum = $db->fetch_array($query)) { $forums[$forum['fid']] = $forum['name']; }
|
$plugins->run_hooks("modcp_reports_start");
|
$plugins->run_hooks("modcp_reports_start");
|
|
|
$reports = ''; $query = $db->query(" SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
| $reports = ''; $query = $db->query(" SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
|
Zeile 201 | Zeile 204 |
---|
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); }
if($mybb->input['action'] == "allreports")
|
eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";"); output_page($reportedposts); }
if($mybb->input['action'] == "allreports")
|
{
| {
|
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 242 | Zeile 251 |
---|
if($mybb->input['page'] != "last") { $page = intval($mybb->input['page']);
|
if($mybb->input['page'] != "last") { $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");
|
|
|
if($mybb->input['rid']) { $mybb->input['rid'] = intval($mybb->input['rid']);
| if($mybb->input['rid']) { $mybb->input['rid'] = intval($mybb->input['rid']);
|
Zeile 255 | Zeile 264 |
---|
if(($result % $perpage) == 0) { $page = $result / $perpage;
|
if(($result % $perpage) == 0) { $page = $result / $perpage;
|
}
| }
|
else { $page = intval($result / $perpage) + 1;
| else { $page = intval($result / $perpage) + 1;
|
Zeile 264 | Zeile 273 |
---|
$postcount = intval($warnings); $pages = $postcount / $perpage; $pages = ceil($pages);
|
$postcount = intval($warnings); $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 290 | Zeile 299 |
---|
if($postcount > $perpage) { eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
|
if($postcount > $perpage) { 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 309 | Zeile 311 |
---|
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 "); 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 {
| LIMIT {$start}, {$perpage} ");
$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['threadsubject'] = $lang->na; $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']);
if($report['threadsubject']) { $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject'])); $report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>"; } else { $report['threadsubject'] = $lang->na;
| $reportdate = my_date($mybb->settings['dateformat'], $report['dateline']); $reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
if($report['reportstatus'] == 0) { $trow = "trow_shaded"; } if($report['threadsubject']) { $report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject'])); $report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>"; }
eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");
|
}
|
}
|
eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";"); }
if(!$allreports) { eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");
| |
}
|
}
|
$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 364 | Zeile 364 |
---|
if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
|
if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
|
}
$where = '';
| }
$where = '';
|
// Searching for entries by a particular user if($mybb->input['uid']) { $where .= " AND l.uid='".intval($mybb->input['uid'])."'";
|
// 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'])
| // Searching for entries in a specific forum if($mybb->input['fid'])
|
Zeile 405 | Zeile 405 |
---|
$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) WHERE 1=1 {$where}{$tflist}
| 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}{$tflist}
|
"); $rescount = $db->fetch_field($query, "count");
| "); $rescount = $db->fetch_field($query, "count");
|
Zeile 416 | Zeile 416 |
---|
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;
| $postcount = intval($rescount); $pages = $postcount / $perpage;
|
Zeile 428 | Zeile 428 |
---|
}
if($page > $pages || $page <= 0)
|
}
if($page > $pages || $page <= 0)
|
{
| {
|
$page = 1; }
| $page = 1; }
|
Zeile 440 | Zeile 440 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
$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)
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&perpage=$perpage&uid={$mybb->input['uid']}&fid={$mybb->input['fid']}&sortby={$mybb->input['sortby']}&order={$mybb->input['order']}"); if($postcount > $perpage)
|
{
| {
|
eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";"); } $query = $db->query("
| eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";"); } $query = $db->query("
|
Zeile 476 | Zeile 476 |
---|
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />"; } if($logitem['psubject'])
|
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />"; } if($logitem['psubject'])
|
{
| {
|
$information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>"; }
| $information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>"; }
|
Zeile 543 | Zeile 543 |
---|
{ 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(); } $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();
| $db->delete_query("announcements", "aid='{$aid}'"); $cache->update_forumsdisplay();
|
Zeile 557 | Zeile 557 |
---|
}
if($mybb->input['action'] == "delete_announcement")
|
}
if($mybb->input['action'] == "delete_announcement")
|
{
| {
|
$aid = intval($mybb->input['aid']); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
| $aid = intval($mybb->input['aid']); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
|
Zeile 565 | Zeile 565 |
---|
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
if(!$announcement['aid'])
|
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
if(!$announcement['aid'])
|
{
| {
|
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(); }
|
Zeile 583 | Zeile 583 |
---|
if($mybb->input['action'] == "do_new_announcement") { verify_post_check($mybb->input['my_post_key']);
|
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))) { error_no_permission();
| $announcement_fid = intval($mybb->input['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();
|
}
if(!trim($mybb->input['title']))
| }
if(!trim($mybb->input['title']))
|
Zeile 596 | Zeile 596 |
---|
}
if(!trim($mybb->input['message']))
|
}
if(!trim($mybb->input['message']))
|
{
| {
|
$errors[] = $lang->error_missing_message; }
if(!trim($mybb->input['fid']))
|
$errors[] = $lang->error_missing_message; }
if(!trim($mybb->input['fid']))
|
{
| {
|
$errors[] = $lang->error_missing_forum; }
| $errors[] = $lang->error_missing_forum; }
|
Zeile 623 | Zeile 623 |
---|
{ $enddate[0] = 12+$enddate[0]; if($enddate[0] >= 24)
|
{ $enddate[0] = 12+$enddate[0]; if($enddate[0] >= 24)
|
{
| {
|
$enddate[0] = "00"; } }
| $enddate[0] = "00"; } }
|
Zeile 695 | Zeile 695 |
---|
{ add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");
|
{ add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");
|
$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid))) { error_no_permission(); }
// Deal with inline errors if(is_array($errors)) { $errors = inline_error($errors); // Set $announcement to input stuff $announcement['subject'] = $mybb->input['title']; $announcement['message'] = $mybb->input['message']; $announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies']; $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
| $announcement_fid = intval($mybb->input['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(); }
// Deal with inline errors if(is_array($errors)) { $errors = inline_error($errors); // Set $announcement to input stuff $announcement['subject'] = $mybb->input['title']; $announcement['message'] = $mybb->input['message']; $announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies']; $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
|
{ $mybb->input['starttime_month'] = 1; }
| { $mybb->input['starttime_month'] = 1; }
|
Zeile 753 | Zeile 753 |
---|
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"; }
| { $startdateday .= "<option value=\"$i\">$i</option>\n"; }
|
Zeile 830 | Zeile 830 |
---|
}
if($mybb->input['endtime_type'] == 2 || !isset($mybb->input['endtime_type']))
|
}
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 864 | Zeile 864 |
---|
}
// 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 905 | Zeile 905 |
---|
if($enddate[0] >= 24) { $enddate[0] = "00";
|
if($enddate[0] >= 24) { $enddate[0] = "00";
|
} }
| } }
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1;
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1;
|
}
| }
|
$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])); if($startdate < 0 || $startdate == false)
| $startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])); if($startdate < 0 || $startdate == false)
|
Zeile 945 | Zeile 945 |
---|
// Proceed to update if no errors if(!$errors)
|
// Proceed to update if no errors if(!$errors)
|
{
| {
|
$update_announcement = array( 'uid' => $mybb->user['uid'], 'subject' => $db->escape_string($mybb->input['title']),
| $update_announcement = array( 'uid' => $mybb->user['uid'], 'subject' => $db->escape_string($mybb->input['title']),
|
Zeile 969 | Zeile 969 |
---|
$mybb->input['action'] = 'edit_announcement'; } }
|
$mybb->input['action'] = 'edit_announcement'; } }
|
|
|
if($mybb->input['action'] == "edit_announcement") { $announcement_fid = intval($mybb->input['fid']); $aid = intval($mybb->input['aid']);
|
if($mybb->input['action'] == "edit_announcement") { $announcement_fid = intval($mybb->input['fid']); $aid = intval($mybb->input['aid']);
|
|
|
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");
| add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");
|
Zeile 983 | Zeile 983 |
---|
$announcement = $db->fetch_array($query);
if(!$announcement['fid'])
|
$announcement = $db->fetch_array($query);
if(!$announcement['fid'])
|
{
| {
|
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']) {
| if(!$announcement['startdate']) {
|
Zeile 999 | Zeile 999 |
---|
$makeshift_end = false; if(!$announcement['enddate'])
|
$makeshift_end = false; if(!$announcement['enddate'])
|
{
| {
|
$makeshift_end = true; $makeshift_time = TIME_NOW; if($announcement['startdate'])
| $makeshift_end = true; $makeshift_time = TIME_NOW; if($announcement['startdate'])
|
Zeile 1022 | Zeile 1022 |
---|
$announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies'];
|
$announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies'];
|
|
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) {
| $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) {
|
Zeile 1190 | Zeile 1190 |
---|
$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 1935 | Zeile 1935 |
---|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>\n";
|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>\n";
|
} if(!$profilefield['length'])
| } if(!$profilefield['length'])
|
{ $profilefield['length'] = 3; }
| { $profilefield['length'] = 3; }
|
Zeile 2506 | Zeile 2506 |
---|
else { $ip_range = fetch_longipv4_range($mybb->input['ipaddress']);
|
else { $ip_range = fetch_longipv4_range($mybb->input['ipaddress']);
|
if(!is_array($ip_range))
| if($ip_range)
|
{
|
{
|
$post_ip_sql = "longipaddress='{$ip_range}'"; } else { $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
| }
// Searching user IP addresses
|
Zeile 2529 | Zeile 2539 |
---|
{ // IPv6 IP if(strpos($mybb->input['ipaddress'], ":") !== false)
|
{ // IPv6 IP if(strpos($mybb->input['ipaddress'], ":") !== false)
|
{
| {
|
$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']);
|
$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']);
|
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 2600 | Zeile 2625 |
---|
$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 2647 | Zeile 2672 |
---|
$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 2711 | Zeile 2736 |
---|
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")."\";");
|