Zeile 56 | Zeile 56 |
---|
$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = ''; // SQL for fetching items only related to forums this user moderates $moderated_forums = array();
|
$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = ''; // SQL for fetching items only related to forums this user moderates $moderated_forums = array();
|
| $numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
|
if($mybb->usergroup['issupermod'] != 1) { $query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");
|
if($mybb->usergroup['issupermod'] != 1) { $query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");
|
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
| |
while($forum = $db->fetch_array($query)) {
|
while($forum = $db->fetch_array($query)) {
|
// For Announcements if($forum['canmanageannouncements'] == 1) { ++$numannouncements; }
| $moderated_forums[] = $forum['fid']; $children = get_child_list($forum['fid']); if(is_array($children)) { $moderated_forums = array_merge($moderated_forums, $children); } } $moderated_forums = array_unique($moderated_forums);
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0; foreach($moderated_forums as $moderated_forum) { // For Announcements if(is_moderator($moderated_forum, 'canmanageannouncements')) { ++$numannouncements; }
|
// For the Mod Queues
|
// For the Mod Queues
|
if($forum['canapproveunapprovethreads'] == 1)
| if(is_moderator($moderated_forum, 'canapproveunapprovethreads'))
|
{
|
{
|
$flist_queue_threads .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_queue_threads .= ",'".implode("','", $children)."'"; }
| $flist_queue_threads .= ",'{$moderated_forum}'";
|
++$nummodqueuethreads; }
|
++$nummodqueuethreads; }
|
if($forum['canapproveunapproveposts'] == 1) { $flist_queue_posts .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_queue_posts .= ",'".implode("','", $children)."'"; } ++$nummodqueueposts; }
if($forum['canapproveunapproveattachs'] == 1)
| if(is_moderator($moderated_forum, 'canapproveunapproveposts')) { $flist_queue_posts .= ",'{$moderated_forum}'"; ++$nummodqueueposts; }
if(is_moderator($moderated_forum, 'canapproveunapproveattachs'))
|
{
|
{
|
$flist_queue_attach .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_queue_attach .= ",'".implode("','", $children)."'"; }
| $flist_queue_attach .= ",'{$moderated_forum}'";
|
++$nummodqueueattach; }
// For Reported posts
|
++$nummodqueueattach; }
// For Reported posts
|
if($forum['canmanagereportedposts'] == 1)
| if(is_moderator($moderated_forum, 'canmanagereportedposts'))
|
{
|
{
|
$flist_reports .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_reports .= ",'".implode("','", $children)."'"; }
| $flist_reports .= ",'{$moderated_forum}'";
|
++$numreportedposts; }
// For the Mod Log
|
++$numreportedposts; }
// For the Mod Log
|
if($forum['canviewmodlog'] == 1)
| if(is_moderator($moderated_forum, 'canviewmodlog'))
|
{
|
{
|
$flist_modlog .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_modlog .= ",'".implode("','", $children)."'"; }
| $flist_modlog .= ",'{$moderated_forum}'";
|
++$nummodlogs;
|
++$nummodlogs;
|
}
$flist .= ",'{$forum['fid']}'";
| }
|
|
|
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist .= ",'".implode("','", $children)."'"; } $moderated_forums[] = $forum['fid'];
| $flist .= ",'{$moderated_forum}'";
|
} if($flist_queue_threads) {
| } if($flist_queue_threads) {
|
Zeile 247 | Zeile 221 |
---|
if($mybb->usergroup['canbanusers'] == 1) { eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");
|
if($mybb->usergroup['canbanusers'] == 1) { eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");
|
}
| }
|
if($mybb->usergroup['canviewwarnlogs'] == 1)
|
if($mybb->usergroup['canviewwarnlogs'] == 1)
|
{
| {
|
eval("\$nav_warninglogs = \"".$templates->get("modcp_nav_warninglogs")."\";"); }
if($mybb->usergroup['canuseipsearch'] == 1)
|
eval("\$nav_warninglogs = \"".$templates->get("modcp_nav_warninglogs")."\";"); }
if($mybb->usergroup['canuseipsearch'] == 1)
|
{
| {
|
eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";"); }
|
eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";"); }
|
|
|
$plugins->run_hooks("modcp_nav");
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
$plugins->run_hooks("modcp_nav");
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
| $expaltext = (in_array("modcpforums", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
|
eval("\$modcp_nav_forums_posts = \"".$templates->get("modcp_nav_forums_posts")."\";");
|
eval("\$modcp_nav_forums_posts = \"".$templates->get("modcp_nav_forums_posts")."\";");
|
}
| }
|
if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch)) {
|
if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch)) {
|
| $expaltext = (in_array("modcpusers", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
|
eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";"); }
| eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";"); }
|
Zeile 291 | Zeile 267 |
---|
}
$message = $lang->redirect_reportsmarked;
|
}
$message = $lang->redirect_reportsmarked;
|
|
|
if(isset($mybb->cookies['inlinereports'])) { if($mybb->cookies['inlinereports'] == '|ALL|') {
| if(isset($mybb->cookies['inlinereports'])) { if($mybb->cookies['inlinereports'] == '|ALL|') {
|
Zeile 309 | Zeile 285 |
---|
{ $inlinereportlist = explode("|", $mybb->cookies['inlinereports']); $reports = array_map("intval", $inlinereportlist);
|
{ $inlinereportlist = explode("|", $mybb->cookies['inlinereports']); $reports = array_map("intval", $inlinereportlist);
|
|
|
if(!count($reports)) { error($lang->error_noselected_reports); }
|
if(!count($reports)) { error($lang->error_noselected_reports); }
|
|
|
$rids = implode("','", $reports);
$sql = "rid IN ('0','{$rids}')";
|
$rids = implode("','", $reports);
$sql = "rid IN ('0','{$rids}')";
|
} } else
| } } else
|
{ $mybb->input['reports'] = array_map("intval", $mybb->input['reports']); $rids = implode("','", $mybb->input['reports']);
$sql = "rid IN ('0','{$rids}')";
|
{ $mybb->input['reports'] = array_map("intval", $mybb->input['reports']); $rids = implode("','", $mybb->input['reports']);
$sql = "rid IN ('0','{$rids}')";
|
}
| }
|
$plugins->run_hooks("modcp_do_reports");
|
$plugins->run_hooks("modcp_do_reports");
|
|
|
$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}"); $cache->update_reportedcontent();
my_unsetcookie('inlinereports'); my_unsetcookie('inlinereports_removed');
|
$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}"); $cache->update_reportedcontent();
my_unsetcookie('inlinereports'); my_unsetcookie('inlinereports_removed');
|
$page = $mybb->get_input('page', MyBB::INPUT_INT);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
redirect("modcp.php?action=reports&page={$page}", $message); }
if($mybb->input['action'] == "reports") { if($mybb->usergroup['canmanagereportedcontent'] == 0)
|
redirect("modcp.php?action=reports&page={$page}", $message); }
if($mybb->input['action'] == "reports") { if($mybb->usergroup['canmanagereportedcontent'] == 0)
|
{
| {
|
error_no_permission(); }
| error_no_permission(); }
|
Zeile 371 | Zeile 347 |
---|
else { $query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");
|
else { $query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");
|
|
|
$report_count = 0; while($fid = $db->fetch_field($query, 'id3')) {
| $report_count = 0; while($fid = $db->fetch_field($query, 'id3')) {
|
Zeile 390 | Zeile 366 |
---|
$pages = ceil($pages);
if($page > $pages || $page <= 0)
|
$pages = ceil($pages);
if($page > $pages || $page <= 0)
|
{ $page = 1; }
| { $page = 1; }
|
if($page && $page > 0) { $start = ($page-1) * $perpage; } else
|
if($page && $page > 0) { $start = ($page-1) * $perpage; } else
|
{
| {
|
$start = 0; $page = 1; }
| $start = 0; $page = 1; }
|
Zeile 414 | Zeile 390 |
---|
$plugins->run_hooks("modcp_reports_start");
// Reports
|
$plugins->run_hooks("modcp_reports_start");
// Reports
|
$reports = '';
| $reports = $selectall = ''; $inlinecount = 0;
|
$query = $db->query(" SELECT r.*, u.username, rr.title FROM ".TABLE_PREFIX."reportedcontent r
| $query = $db->query(" SELECT r.*, u.username, rr.title FROM ".TABLE_PREFIX."reportedcontent r
|
Zeile 530 | Zeile 508 |
---|
$plugins->run_hooks('modcp_reports_intermediate');
|
$plugins->run_hooks('modcp_reports_intermediate');
|
$inlinecount = 0;
| |
// Now that we have all of the information needed, display the reports foreach($reportcache as $report) {
| // Now that we have all of the information needed, display the reports foreach($reportcache as $report) {
|
Zeile 540 | Zeile 517 |
---|
{ // Assume a post $report['type'] = 'post';
|
{ // Assume a post $report['type'] = 'post';
|
}
| }
|
// Report Information $report_data = array();
| // Report Information $report_data = array();
|
Zeile 686 | Zeile 663 |
---|
else { $page = (int)$result / $perpage + 1;
|
else { $page = (int)$result / $perpage + 1;
|
}
| }
|
} $postcount = (int)$report_count; $pages = $postcount / $perpage;
| } $postcount = (int)$report_count; $pages = $postcount / $perpage;
|
Zeile 908 | Zeile 885 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
$page_url = 'modcp.php?action=modlogs&perpage='.$perpage; foreach(array('uid', 'fid') as $field) {
| $page_url = 'modcp.php?action=modlogs&perpage='.$perpage; foreach(array('uid', 'fid') as $field) {
|
Zeile 1048 | Zeile 1025 |
---|
}
if($mybb->input['action'] == "do_delete_announcement")
|
}
if($mybb->input['action'] == "do_delete_announcement")
|
{ verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission(); }
$aid = $mybb->get_input('aid'); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement) { error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission(); }
| { verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission(); }
$aid = $mybb->get_input('aid'); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement) { error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission(); }
|
$plugins->run_hooks("modcp_do_delete_announcement");
|
$plugins->run_hooks("modcp_do_delete_announcement");
|
|
|
$db->delete_query("announcements", "aid='{$aid}'"); log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted); $cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);
|
$db->delete_query("announcements", "aid='{$aid}'"); log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted); $cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);
|
}
| }
|
if($mybb->input['action'] == "delete_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
| if($mybb->input['action'] == "delete_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
Zeile 1086 | Zeile 1063 |
---|
}
$aid = $mybb->get_input('aid');
|
}
$aid = $mybb->get_input('aid');
|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
| $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
|
$announcement = $db->fetch_array($query); $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
$announcement = $db->fetch_array($query); $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
|
|
if(!$announcement) { error($lang->error_invalid_announcement);
|
if(!$announcement) { error($lang->error_invalid_announcement);
|
}
| }
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission();
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission();
|
Zeile 1112 | Zeile 1089 |
---|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0)
|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT); if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
| $announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT); if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
|
Zeile 1132 | Zeile 1109 |
---|
$mybb->input['message'] = $mybb->get_input('message'); if(!trim($mybb->input['message']))
|
$mybb->input['message'] = $mybb->get_input('message'); if(!trim($mybb->input['message']))
|
{
| {
|
$errors[] = $lang->error_missing_message; }
| $errors[] = $lang->error_missing_message; }
|
Zeile 1187 | Zeile 1164 |
---|
$mybb->input['endtime_month'] = '01'; } else
|
$mybb->input['endtime_month'] = '01'; } else
|
{
| {
|
$mybb->input['endtime_month'] = $mybb->get_input('endtime_month'); if(!in_array($mybb->input['endtime_month'], $months)) {
| $mybb->input['endtime_month'] = $mybb->get_input('endtime_month'); if(!in_array($mybb->input['endtime_month'], $months)) {
|
Zeile 1206 | Zeile 1183 |
---|
}
if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)
|
}
if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)
|
{
| {
|
$allowhtml = 1;
|
$allowhtml = 1;
|
}
| }
|
else
|
else
|
{
| {
|
$allowhtml = 0;
|
$allowhtml = 0;
|
}
| }
|
if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1) { $allowmycode = 1;
|
if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1) { $allowmycode = 1;
|
} else {
| } else {
|
$allowmycode = 0;
|
$allowmycode = 0;
|
}
| }
|
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) { $allowsmilies = 1;
|
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) { $allowsmilies = 1;
|
} else
| } else
|
{ $allowsmilies = 0; }
| { $allowsmilies = 0; }
|
Zeile 1253 | Zeile 1230 |
---|
'allowsmilies' => $allowsmilies ); $aid = $db->insert_query("announcements", $insert_announcement);
|
'allowsmilies' => $allowsmilies ); $aid = $db->insert_query("announcements", $insert_announcement);
|
|
|
log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);
$plugins->run_hooks("modcp_do_new_announcement_end");
| log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);
$plugins->run_hooks("modcp_do_new_announcement_end");
|
Zeile 1271 | Zeile 1248 |
---|
if($mybb->input['action'] == "new_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
if($mybb->input['action'] == "new_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
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 = $mybb->get_input('fid', MyBB::INPUT_INT);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
|
$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
// Deal with inline errors if(!empty($errors) || isset($preview))
|
// Deal with inline errors if(!empty($errors) || isset($preview))
|
{
| {
|
if(!empty($errors))
|
if(!empty($errors))
|
{
| {
|
$errors = inline_error($errors);
|
$errors = inline_error($errors);
|
} else {
| } else {
|
$errors = ''; }
| $errors = ''; }
|
Zeile 1312 | Zeile 1289 |
---|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT); $endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT); $endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
}
| }
|
else { $localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
| else { $localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
|
Zeile 1334 | Zeile 1311 |
---|
$enddateyear = $startdateyear+1; }
|
$enddateyear = $startdateyear+1; }
|
// Generate form elements $startdateday = $enddateday = ''; for($day = 1; $day <= 31; ++$day) { if($startday == $day) { $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); }
if($endday == $day) { $selected = " selected=\"selected\""; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } }
| // Generate form elements $startdateday = $enddateday = ''; for($day = 1; $day <= 31; ++$day) { if($startday == $day) { $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); }
if($endday == $day) { $selected = " selected=\"selected\""; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } }
|
$startmonthsel = $endmonthsel = array(); foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month) {
| $startmonthsel = $endmonthsel = array(); foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month) {
|
Zeile 1504 | Zeile 1481 |
---|
}
// 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'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission(); }
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission(); }
|
$errors = array();
| $errors = array();
|
Zeile 1516 | Zeile 1493 |
---|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
}
| }
|
$mybb->input['message'] = $mybb->get_input('message'); if(!trim($mybb->input['message'])) {
| $mybb->input['message'] = $mybb->get_input('message'); if(!trim($mybb->input['message'])) {
|
Zeile 1554 | Zeile 1531 |
---|
if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = '01';
|
if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = '01';
|
}
| }
|
$localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
| $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
|
Zeile 1573 | Zeile 1550 |
---|
{ $mybb->input['endtime_month'] = $mybb->get_input('endtime_month'); if(!in_array($mybb->input['endtime_month'], $months))
|
{ $mybb->input['endtime_month'] = $mybb->get_input('endtime_month'); if(!in_array($mybb->input['endtime_month'], $months))
|
{
| {
|
$mybb->input['endtime_month'] = '01';
|
$mybb->input['endtime_month'] = '01';
|
}
| }
|
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) || $enddate < 0 || $enddate == false)
|
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) || $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 1598 | Zeile 1575 |
---|
if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1) { $allowmycode = 1;
|
if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1) { $allowmycode = 1;
|
} else {
| } else {
|
$allowmycode = 0;
|
$allowmycode = 0;
|
}
| }
|
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) { $allowsmilies = 1;
|
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) { $allowsmilies = 1;
|
} else
| } else
|
{ $allowsmilies = 0; }
|
{ $allowsmilies = 0; }
|
|
|
$plugins->run_hooks("modcp_do_edit_announcement_start");
// Proceed to update if no errors if(!$errors)
|
$plugins->run_hooks("modcp_do_edit_announcement_start");
// Proceed to update if no errors if(!$errors)
|
{
| {
|
if(isset($mybb->input['preview'])) { $preview = array();
| if(isset($mybb->input['preview'])) { $preview = array();
|
Zeile 1643 | Zeile 1620 |
---|
$cache->update_forumsdisplay(); redirect("modcp.php?action=announcements", $lang->redirect_edit_announcement); }
|
$cache->update_forumsdisplay(); redirect("modcp.php?action=announcements", $lang->redirect_edit_announcement); }
|
}
| }
|
else
|
else
|
{
| {
|
$mybb->input['action'] = 'edit_announcement';
|
$mybb->input['action'] = 'edit_announcement';
|
}
| }
|
}
|
}
|
|
|
if($mybb->input['action'] == "edit_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
if($mybb->input['action'] == "edit_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
{ error_no_permission(); }
$aid = $mybb->get_input('aid', MyBB::INPUT_INT);
| { error_no_permission(); }
$aid = $mybb->get_input('aid', MyBB::INPUT_INT);
|
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 1806 | Zeile 1783 |
---|
}
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
|
}
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
|
} else {
| } else {
|
$allow_html = '';
|
$allow_html = '';
|
}
| }
|
if($announcement['allowmycode']) { $mycode_sel['yes'] = ' checked="checked"';
|
if($announcement['allowmycode']) { $mycode_sel['yes'] = ' checked="checked"';
|
} else
| } else
|
{ $mycode_sel['no'] = ' checked="checked"'; }
| { $mycode_sel['no'] = ' checked="checked"'; }
|
Zeile 1824 | Zeile 1801 |
---|
if($announcement['allowsmilies']) { $smilies_sel['yes'] = ' checked="checked"';
|
if($announcement['allowsmilies']) { $smilies_sel['yes'] = ' checked="checked"';
|
} else
| } else
|
{ $smilies_sel['no'] = ' checked="checked"'; }
| { $smilies_sel['no'] = ' checked="checked"'; }
|
Zeile 1834 | Zeile 1811 |
---|
if(($errored && $mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2) || (!$errored && (int)$announcement['enddate'] == 0) || $makeshift_end == true) { $end_type_sel['infinite'] = ' checked="checked"';
|
if(($errored && $mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2) || (!$errored && (int)$announcement['enddate'] == 0) || $makeshift_end == true) { $end_type_sel['infinite'] = ' checked="checked"';
|
}
| }
|
else { $end_type_sel['finite'] = ' checked="checked"';
| else { $end_type_sel['finite'] = ' checked="checked"';
|
Zeile 1843 | Zeile 1820 |
---|
// MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
|
// MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
|
|
|
if(isset($preview)) { $announcementarray = array(
| if(isset($preview)) { $announcementarray = array(
|
Zeile 1880 | Zeile 1857 |
---|
foreach($data_key as $field => $key) { $announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field];
|
foreach($data_key as $field => $key) { $announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field];
|
}
| }
|
require_once MYBB_ROOT."inc/functions_post.php"; $postbit = build_postbit($announcementarray, 3);
| require_once MYBB_ROOT."inc/functions_post.php"; $postbit = build_postbit($announcementarray, 3);
|
Zeile 1933 | Zeile 1910 |
---|
foreach($global_announcements as $aid => $announcement) { $trow = alt_trow();
|
foreach($global_announcements as $aid => $announcement) { $trow = alt_trow();
|
if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
| if((isset($announcement['startdate']) && $announcement['startdate'] > TIME_NOW) || (isset($announcement['enddate']) && $announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
|
{ eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";"); }
| { eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";"); }
|
Zeile 2303 | Zeile 2280 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid
|
ORDER BY p.dateline DESC
| ORDER BY p.dateline DESC, p.pid DESC
|
LIMIT {$start}, {$perpage} "); $posts = '';
| LIMIT {$start}, {$perpage} "); $posts = '';
|
Zeile 2585 | Zeile 2562 |
---|
"profile_fields_editable" => true, "website" => $mybb->get_input('website'), "icq" => $mybb->get_input('icq'),
|
"profile_fields_editable" => true, "website" => $mybb->get_input('website'), "icq" => $mybb->get_input('icq'),
|
"aim" => $mybb->get_input('aim'), "yahoo" => $mybb->get_input('yahoo'),
| |
"skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'), "signature" => $mybb->get_input('signature'),
| "skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'), "signature" => $mybb->get_input('signature'),
|
Zeile 2616 | Zeile 2591 |
---|
// Set the data of the user in the datahandler. $userhandler->set_data($updated_user);
|
// Set the data of the user in the datahandler. $userhandler->set_data($updated_user);
|
$errors = '';
| $errors = array();
|
// Validate the user and get any errors that might have occurred. if(!$userhandler->validate_user())
| // Validate the user and get any errors that might have occurred. if(!$userhandler->validate_user())
|
Zeile 2665 | Zeile 2640 |
---|
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']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);
| ${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);
|
$mybb->input[$option['period']] = $mybb->get_input($option['period']); if(empty($mybb->input[$option['action']])) {
| $mybb->input[$option['period']] = $mybb->get_input($option['period']); if(empty($mybb->input[$option['action']])) {
|
Zeile 2688 | Zeile 2663 |
---|
$string = $option['action']."_error"; $errors[] = $lang->$string; }
|
$string = $option['action']."_error"; $errors[] = $lang->$string; }
|
if(!is_array($errors))
| else
|
{ $suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);
| { $suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);
|
Zeile 2704 | Zeile 2678 |
---|
elseif($suspend_length && $suspend_length != "-1") { // Temporary ban on action
|
elseif($suspend_length && $suspend_length != "-1") { // Temporary ban on action
|
$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;
| $extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;
|
} } elseif(!$user[$option['update_field']])
| } } elseif(!$user[$option['update_field']])
|
Zeile 2726 | Zeile 2700 |
---|
// Those with javascript turned off will be able to select both - cheeky! // Check to make sure we're not moderating AND suspending posting
|
// Those with javascript turned off will be able to select both - cheeky! // Check to make sure we're not moderating AND suspending posting
|
if(isset($extra_user_updates) && $extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])
| if(isset($extra_user_updates) && !empty($extra_user_updates['moderateposts']) && !empty($extra_user_updates['suspendposting']))
|
{ $errors[] = $lang->suspendmoderate_error; }
|
{ $errors[] = $lang->suspendmoderate_error; }
|
if(is_array($errors))
| if(is_array($errors) && !empty($errors))
|
{ $mybb->input['action'] = "editprofile"; }
| { $mybb->input['action'] = "editprofile"; }
|
Zeile 2773 | Zeile 2747 |
---|
if(!modcp_can_manage_user($user['uid'])) { error_no_permission();
|
if(!modcp_can_manage_user($user['uid'])) { error_no_permission();
|
| }
$userperms = user_permissions($user['uid']);
// Set display group $displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
if(!$user['displaygroup']) { $user['displaygroup'] = $user['usergroup']; }
$display_group = usergroup_displaygroup($user['displaygroup']); if(is_array($display_group)) { $userperms = array_merge($userperms, $display_group);
|
}
if(!my_validate_url($user['website'])) { $user['website'] = '';
|
}
if(!my_validate_url($user['website'])) { $user['website'] = '';
|
}
| }
|
if($user['icq'] != "0")
|
if($user['icq'] != "0")
|
{
| {
|
$user['icq'] = (int)$user['icq']; }
| $user['icq'] = (int)$user['icq']; }
|
Zeile 2792 | Zeile 2782 |
---|
if(!isset($birthday[1])) { $birthday[1] = '';
|
if(!isset($birthday[1])) { $birthday[1] = '';
|
}
| }
|
if(!isset($birthday[2])) { $birthday[2] = '';
| if(!isset($birthday[2])) { $birthday[2] = '';
|
Zeile 2802 | Zeile 2792 |
---|
else { $errors = inline_error($errors);
|
else { $errors = inline_error($errors);
|
}
| }
|
// Sanitize all input
|
// Sanitize all input
|
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field) {
| foreach(array('usertitle', 'website', 'icq', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field) {
|
$mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field)); }
|
$mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field)); }
|
// 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']))
| // Custom user title if(!empty($userperms['usertitle']))
|
{
|
{
|
$defaulttitle = htmlspecialchars_uni($display_group['usertitle']);
| $defaulttitle = htmlspecialchars_uni($userperms['usertitle']);
|
} else {
| } else {
|
Zeile 2925 | Zeile 2907 |
---|
if(isset($returndate[1])) { $returndatemonthsel[$returndate[1]] = " selected=\"selected\"";
|
if(isset($returndate[1])) { $returndatemonthsel[$returndate[1]] = " selected=\"selected\"";
|
}
| }
|
if(!isset($returndate[2])) { $returndate[2] = '';
| if(!isset($returndate[2])) { $returndate[2] = '';
|
Zeile 2938 | Zeile 2920 |
---|
$plugins->run_hooks("modcp_editprofile_start");
// Fetch profile fields
|
$plugins->run_hooks("modcp_editprofile_start");
// Fetch profile fields
|
| $user_fields = array();
|
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
|
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
|
$user_fields = $db->fetch_array($query);
| if($db->num_rows($query) > 0) { $user_fields = $db->fetch_array($query); }
|
$requiredfields = ''; $customfields = ''; $mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);
|
$requiredfields = ''; $customfields = ''; $mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);
|
|
|
$pfcache = $cache->read('profilefields');
if(is_array($pfcache))
| $pfcache = $cache->read('profilefields');
if(is_array($pfcache))
|
Zeile 2970 | Zeile 2956 |
---|
$userfield = $mybb->input['profile_fields'][$field]; } }
|
$userfield = $mybb->input['profile_fields'][$field]; } }
|
else
| elseif(isset($user_fields[$field]))
|
{ $userfield = $user_fields[$field]; }
| { $userfield = $user_fields[$field]; }
|
Zeile 3199 | Zeile 3185 |
---|
$suspendsignature_info = $moderateposts_info = $suspendposting_info = ''; $action_options = $modpost_options = $suspost_options = '';
|
$suspendsignature_info = $moderateposts_info = $suspendposting_info = ''; $action_options = $modpost_options = $suspost_options = '';
|
| $modopts = array();
|
foreach($moderator_options as $option) {
|
foreach($moderator_options as $option) {
|
$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);
| ${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);
|
// 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']]) {
|
Zeile 3273 | Zeile 3260 |
---|
{ $newtitle = ''; }
|
{ $newtitle = ''; }
|
| $birthday_year = $mybb->input['birthday_year']; $user_website = $mybb->input['website']; $user_icq = $mybb->input['icq']; $user_skype = $mybb->input['skype']; $user_google = $mybb->input['google'];
|
$plugins->run_hooks("modcp_editprofile_end");
eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";"); output_page($edituser); }
|
$plugins->run_hooks("modcp_editprofile_end");
eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";"); output_page($edituser); }
|
|
|
if($mybb->input['action'] == "finduser") { if($mybb->usergroup['caneditprofiles'] == 0) { error_no_permission();
|
if($mybb->input['action'] == "finduser") { if($mybb->usergroup['caneditprofiles'] == 0) { error_no_permission();
|
}
| }
|
add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");
$perpage = $mybb->get_input('perpage', MyBB::INPUT_INT); if(!$perpage || $perpage <= 0)
|
add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");
$perpage = $mybb->get_input('perpage', MyBB::INPUT_INT); if(!$perpage || $perpage <= 0)
|
{
| {
|
$perpage = $mybb->settings['threadsperpage']; } $where = '';
| $perpage = $mybb->settings['threadsperpage']; } $where = '';
|
Zeile 3319 | Zeile 3312 |
---|
break; case "postnum": $sortby = "postnum";
|
break; case "postnum": $sortby = "postnum";
|
break;
| break;
|
case "username": $sortby = "username"; break;
| case "username": $sortby = "username"; break;
|
Zeile 3343 | Zeile 3336 |
---|
if($mybb->get_input('page') != "last") { $page = $mybb->get_input('page');
|
if($mybb->get_input('page') != "last") { $page = $mybb->get_input('page');
|
}
| }
|
$pages = $user_count / $perpage; $pages = ceil($pages);
if($mybb->get_input('page') == "last")
|
$pages = $user_count / $perpage; $pages = ceil($pages);
if($mybb->get_input('page') == "last")
|
{
| {
|
$page = $pages; }
if($page > $pages || $page <= 0)
|
$page = $pages; }
if($page > $pages || $page <= 0)
|
{ $page = 1; }
| { $page = 1; }
|
if($page)
|
if($page)
|
{
| {
|
$start = ($page-1) * $perpage; }
|
$start = ($page-1) * $perpage; }
|
else { $start = 0; $page = 1; }
| else { $start = 0; $page = 1; }
|
$page_url = 'modcp.php?action=finduser'; foreach(array('username', 'sortby', 'order') as $field)
| $page_url = 'modcp.php?action=finduser'; foreach(array('username', 'sortby', 'order') as $field)
|
Zeile 3420 | Zeile 3413 |
---|
$plugins->run_hooks("modcp_finduser_end");
|
$plugins->run_hooks("modcp_finduser_end");
|
| $username = htmlspecialchars_uni($mybb->get_input('username'));
|
eval("\$finduser = \"".$templates->get("modcp_finduser")."\";"); output_page($finduser); }
| eval("\$finduser = \"".$templates->get("modcp_finduser")."\";"); output_page($finduser); }
|
Zeile 3543 | Zeile 3537 |
---|
SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1 {$where_sql}
| LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1 {$where_sql}
|
"; $query = $db->query($sql); $total_warnings = $db->fetch_field($query, 'count'); $page = $mybb->get_input('page', MyBB::INPUT_INT); if($page <= 0)
|
"; $query = $db->query($sql); $total_warnings = $db->fetch_field($query, 'count'); $page = $mybb->get_input('page', MyBB::INPUT_INT); if($page <= 0)
|
{
| {
|
$page = 1; } $per_page = 20;
| $page = 1; } $per_page = 20;
|
Zeile 3560 | Zeile 3554 |
---|
$per_page = (int)$mybb->input['filter']['per_page']; } $start = ($page-1) * $per_page;
|
$per_page = (int)$mybb->input['filter']['per_page']; } $start = ($page-1) * $per_page;
|
| $pages = ceil($total_warnings / $per_page); if($page > $pages) { $start = 0; $page = 1; }
|
// Build the base URL for pagination links $url = 'modcp.php?action=warninglogs'; if(is_array($mybb->input['filter']) && count($mybb->input['filter']))
| // Build the base URL for pagination links $url = 'modcp.php?action=warninglogs'; if(is_array($mybb->input['filter']) && count($mybb->input['filter']))
|
Zeile 3589 | Zeile 3589 |
---|
LIMIT {$start}, {$per_page} "; $query = $db->query($sql);
|
LIMIT {$start}, {$per_page} "; $query = $db->query($sql);
|
|
|
$warning_list = ''; while($row = $db->fetch_array($query)) {
| $warning_list = ''; while($row = $db->fetch_array($query)) {
|
Zeile 3607 | Zeile 3607 |
---|
{ $revoked_date = my_date('relative', $row['daterevoked']); eval("\$revoked_text = \"".$templates->get("modcp_warninglogs_warning_revoked")."\";");
|
{ $revoked_date = my_date('relative', $row['daterevoked']); eval("\$revoked_text = \"".$templates->get("modcp_warninglogs_warning_revoked")."\";");
|
}
| }
|
if($row['expires'] > 0) { $expire_date = nice_time($row['expires']-TIME_NOW); } else
|
if($row['expires'] > 0) { $expire_date = nice_time($row['expires']-TIME_NOW); } else
|
{
| {
|
$expire_date = $lang->never; } $title = $row['title'];
| $expire_date = $lang->never; } $title = $row['title'];
|
Zeile 3636 | Zeile 3636 |
---|
}
$plugins->run_hooks("modcp_warninglogs_end");
|
}
$plugins->run_hooks("modcp_warninglogs_end");
|
| $filter_username = $mybb->input['filter']['username']; $filter_modusername = $mybb->input['filter']['mod_username']; $filter_reason = $mybb->input['filter']['reason'];
|
eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs);
| eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs);
|
Zeile 3650 | Zeile 3654 |
---|
add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");
|
add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");
|
| $ipsearch_results = $ipaddressvalue = '';
|
$mybb->input['ipaddress'] = $mybb->get_input('ipaddress'); if($mybb->input['ipaddress']) {
| $mybb->input['ipaddress'] = $mybb->get_input('ipaddress'); if($mybb->input['ipaddress']) {
|
Zeile 3902 | Zeile 3907 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid) WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid) WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
|
ORDER BY p.dateline desc
| ORDER BY p.dateline DESC, p.pid DESC
|
LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query))
| LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query))
|
Zeile 4217 | Zeile 4222 |
---|
$updated_group = array( 'usergroup' => $ban['oldgroup'],
|
$updated_group = array( 'usergroup' => $ban['oldgroup'],
|
'additionalgroups' => $ban['oldadditionalgroups'],
| 'additionalgroups' => $db->escape_string($ban['oldadditionalgroups']),
|
'displaygroup' => $ban['olddisplaygroup'] ); $db->update_query("users", $updated_group, "uid='{$ban['uid']}'"); $db->delete_query("banned", "uid='{$ban['uid']}'");
|
'displaygroup' => $ban['olddisplaygroup'] ); $db->update_query("users", $updated_group, "uid='{$ban['uid']}'"); $db->delete_query("banned", "uid='{$ban['uid']}'");
|
$cache->update_banned();
| |
$cache->update_moderators(); log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);
| $cache->update_moderators(); log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);
|
Zeile 4243 | Zeile 4247 |
---|
}
// Editing an existing ban
|
}
// Editing an existing ban
|
| $existing_ban = false;
|
if($mybb->get_input('uid', MyBB::INPUT_INT)) { // Get the users info from their uid
| if($mybb->get_input('uid', MyBB::INPUT_INT)) { // Get the users info from their uid
|
Zeile 4254 | Zeile 4259 |
---|
"); $user = $db->fetch_array($query);
|
"); $user = $db->fetch_array($query);
|
$existing_ban = false;
| |
if($user['uid']) { $existing_ban = true;
| if($user['uid']) { $existing_ban = true;
|
Zeile 4288 | Zeile 4292 |
---|
if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_cannotbanself;
|
if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_cannotbanself;
|
}
| }
|
// Have permissions to ban this user? if(!modcp_can_manage_user($user['uid']))
| // Have permissions to ban this user? if(!modcp_can_manage_user($user['uid']))
|
Zeile 4314 | Zeile 4318 |
---|
// If this is a new ban, we check the user isn't already part of a banned group if(!$existing_ban && $user['uid']) {
|
// If this is a new ban, we check the user isn't already part of a banned group if(!$existing_ban && $user['uid']) {
|
$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'"); if($db->fetch_field($query, "uid"))
| $query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'", array('limit' => 1)); if($db->num_rows($query) > 0)
|
{ $errors[] = $lang->error_useralreadybanned; }
| { $errors[] = $lang->error_useralreadybanned; }
|
Zeile 4360 | Zeile 4364 |
---|
'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => (int)$user['usergroup'],
|
'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => (int)$user['usergroup'],
|
'oldadditionalgroups' => (string)$user['additionalgroups'],
| 'oldadditionalgroups' => $db->escape_string($user['additionalgroups']),
|
'olddisplaygroup' => (int)$user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW,
| 'olddisplaygroup' => (int)$user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW,
|
Zeile 4379 | Zeile 4383 |
---|
'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
$cache->update_banned();
| |
// Log edit or add ban if($existing_ban)
| // Log edit or add ban if($existing_ban)
|
Zeile 4404 | Zeile 4406 |
---|
} } // Otherwise has errors, throw back to ban page
|
} } // Otherwise has errors, throw back to ban page
|
else
| else
|
{ $mybb->input['action'] = "banuser"; }
| { $mybb->input['action'] = "banuser"; }
|
Zeile 4442 | Zeile 4444 |
---|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}'
|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}'
|
");
| ");
|
$banned = $db->fetch_array($query);
|
$banned = $db->fetch_array($query);
|
if($banned['username'])
| if(!empty($banned['username']))
|
{ $username = $banned['username'] = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']);
| { $username = $banned['username'] = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']);
|
Zeile 4452 | Zeile 4454 |
---|
$user = get_user($banned['uid']); $lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
|
$user = get_user($banned['uid']); $lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
|
} }
| } }
|
// Permission to edit this ban?
|
// Permission to edit this ban?
|
if($banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
| if(!empty($banned) && $banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
// New ban! if(!$banuser_username)
|
{ error_no_permission(); }
// New ban! if(!$banuser_username)
|
{
| {
|
if($mybb->input['uid']) { $user = get_user($mybb->input['uid']);
| if($mybb->input['uid']) { $user = get_user($mybb->input['uid']);
|
Zeile 4518 | Zeile 4520 |
---|
$bangroup_option = $bangroups = ''; $numgroups = $banned_group = 0; $groupscache = $cache->read("usergroups");
|
$bangroup_option = $bangroups = ''; $numgroups = $banned_group = 0; $groupscache = $cache->read("usergroups");
|
|
|
foreach($groupscache as $key => $group) { if($group['isbannedgroup'])
| foreach($groupscache as $key => $group) { if($group['isbannedgroup'])
|
Zeile 4528 | Zeile 4530 |
---|
{ $selected = " selected=\"selected\""; }
|
{ $selected = " selected=\"selected\""; }
|
|
|
$group['title'] = htmlspecialchars_uni($group['title']); eval("\$bangroup_option .= \"".$templates->get("modcp_banuser_bangroups_group")."\";"); $banned_group = $group['gid'];
| $group['title'] = htmlspecialchars_uni($group['title']); eval("\$bangroup_option .= \"".$templates->get("modcp_banuser_bangroups_group")."\";"); $banned_group = $group['gid'];
|
Zeile 4537 | Zeile 4539 |
---|
}
if($numgroups == 0)
|
}
if($numgroups == 0)
|
{
| {
|
error($lang->no_banned_group);
|
error($lang->no_banned_group);
|
}
| }
|
elseif($numgroups > 1)
|
elseif($numgroups > 1)
|
{
| {
|
eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups")."\";"); } else { eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups_hidden")."\";");
|
eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups")."\";"); } else { eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups_hidden")."\";");
|
}
| }
|
if(!empty($banned['uid'])) {
| if(!empty($banned['uid'])) {
|
Zeile 4564 | Zeile 4566 |
---|
eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser);
|
eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser);
|
}
| }
|
if($mybb->input['action'] == "do_modnotes") { // Verify incoming POST request
| if($mybb->input['action'] == "do_modnotes") { // Verify incoming POST request
|
Zeile 4593 | Zeile 4595 |
---|
if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)) { if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)) { if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
{
| {
|
$bgcolor = "trow1"; } else
| $bgcolor = "trow1"; } else
|
Zeile 4656 | Zeile 4658 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
|
ORDER BY p.dateline DESC
| ORDER BY p.dateline DESC, p.pid DESC
|
LIMIT 1 "); $post = $db->fetch_array($query);
| LIMIT 1 "); $post = $db->fetch_array($query);
|
Zeile 4776 | Zeile 4778 |
---|
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) { $data = my_unserialize($logitem['data']);
|
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) { $data = my_unserialize($logitem['data']);
|
if($data['uid'])
| if(isset($data['uid']))
|
{ $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid'])); }
|
{ $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid'])); }
|
if($data['aid'])
| if(isset($data['aid']))
|
{ $data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject'])); $data['announcement'] = get_announcement_link($data['aid']);
| { $data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject'])); $data['announcement'] = get_announcement_link($data['aid']);
|
Zeile 4895 | Zeile 4897 |
---|
eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";"); }
|
eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";"); }
|
$modnotes = $cache->read("modnotes"); $modnotes = htmlspecialchars_uni($modnotes['modmessage']);
| $modnotes = ''; $modnotes_cache = $cache->read("modnotes"); if($modnotes_cache !== false) { $modnotes = htmlspecialchars_uni($modnotes_cache['modmessage']); }
|
$plugins->run_hooks("modcp_end");
| $plugins->run_hooks("modcp_end");
|