Zeile 11 | Zeile 11 |
---|
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,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit,modcp_awaitingmoderation,modcp_banuser_bangroups_hidden"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread,modcp_awaitingthreads,modcp_banuser_bangroups"; $templatelist .= ",modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty,modcp_awaitingposts,modcp_nav_editprofile";
| $templatelist = "modcp_reports,modcp_reports_report,modcp_reports_selectall,modcp_reports_multipage,modcp_reports_allreport,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit,modcp_awaitingmoderation"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread,modcp_awaitingthreads,preview"; $templatelist .= ",modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty,modcp_awaitingposts,modcp_nav_editprofile,modcp_nav_banning";
|
$templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp_modlogs_nologs,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, modcp_nav_forums_posts";
|
$templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp_modlogs_nologs,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, modcp_nav_forums_posts";
|
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result,modcp_nav_modqueue,modcp_banuser_liftlist";
| $templatelist .= ",codebuttons,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result,modcp_nav_modqueue,modcp_banuser_liftlist";
|
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info,modcp_nav_announcements,modcp_modqueue_post_link"; $templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned,modcp_modqueue_thread_link";
|
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info,modcp_nav_announcements,modcp_modqueue_post_link"; $templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned,modcp_modqueue_thread_link";
|
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,modcp_announcements_forum_nomod,modcp_announcements_announcement"; $templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,modcp_editprofile_away,modcp_awaitingattachments,modcp_modqueue_attachment_link,modcp_latestfivemodactions,modcp_nav_banning"; $templatelist .= ",postbit_online,postbit_avatar,postbit_find,postbit_pm,postbit_email,postbit_author_user,announcement_edit,announcement_quickdelete,postbit,preview,postmodcp_nav_announcements,modcp_nav_reportcenter,modcp_nav_modlogs"; $templatelist .= ",modcp_awaitingmoderation_none,modcp_banning_edit,modcp_banuser_bangroups_group,modcp_banuser_lift,modcp_modlogs_result_announcement,modcp_modlogs_result_forum,modcp_modlogs_result_post,modcp_modlogs_result_thread,modcp_modlogs_user";
| $templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,modcp_announcements_forum_nomod,modcp_announcements_announcement,usercp_profile_away,modcp_modlogs_user,modcp_editprofile_away"; $templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,modcp_awaitingattachments,modcp_modqueue_attachment_link"; $templatelist .= ",postbit_groupimage,postbit_userstar,postbit_online,postbit_offline,postbit_away,postbit_avatar,postbit_find,postbit_pm,postbit_email,postbit_www,postbit_author_user,announcement_edit,announcement_quickdelete"; $templatelist .= ",modcp_awaitingmoderation_none,modcp_banning_edit,modcp_banuser_bangroups_group,modcp_banuser_lift,modcp_modlogs_result_announcement,modcp_modlogs_result_forum,modcp_modlogs_result_post,modcp_modlogs_result_thread";
|
$templatelist .= ",modcp_nav_warninglogs,modcp_nav_ipsearch,modcp_nav_users,modcp_announcements_day,modcp_announcements_month_start,modcp_announcements_month_end,modcp_announcements_announcement_expired,modcp_announcements_announcement_active";
|
$templatelist .= ",modcp_nav_warninglogs,modcp_nav_ipsearch,modcp_nav_users,modcp_announcements_day,modcp_announcements_month_start,modcp_announcements_month_end,modcp_announcements_announcement_expired,modcp_announcements_announcement_active";
|
$templatelist .= ",modcp_modqueue_link_forum,modcp_modqueue_link_thread,usercp_profile_day,usercp_profile_away,modcp_ipsearch_result_regip,modcp_ipsearch_result_lastip,modcp_ipsearch_result_post,modcp_ipsearch_results_information,usercp_profile_profilefields_text"; $templatelist .= ",usercp_profile_profilefields_select_option,usercp_profile_profilefields_multiselect,usercp_profile_profilefields_select,usercp_profile_profilefields_textarea,usercp_profile_profilefields_radio,usercp_profile_profilefields_checkbox";
| $templatelist .= ",modcp_modqueue_link_forum,modcp_modqueue_link_thread,usercp_profile_day,modcp_ipsearch_result_regip,modcp_ipsearch_result_lastip,modcp_ipsearch_result_post,modcp_ipsearch_results_information,usercp_profile_profilefields_text"; $templatelist .= ",usercp_profile_profilefields_select_option,usercp_profile_profilefields_multiselect,usercp_profile_profilefields_select,usercp_profile_profilefields_textarea,usercp_profile_profilefields_radio,postbit"; $templatelist .= ",modcp_banning_remaining,postmodcp_nav_announcements,modcp_nav_reportcenter,modcp_nav_modlogs,modcp_latestfivemodactions,modcp_banuser_bangroups_hidden,modcp_banuser_bangroups,usercp_profile_profilefields_checkbox";
|
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 51 | Zeile 52 |
---|
$mybb->settings['threadsperpage'] = 20; }
|
$mybb->settings['threadsperpage'] = 20; }
|
$errors = '';
| $tflist = $flist = $tflist_queue_threads = $flist_queue_threads = $tflist_queue_posts = $flist_queue_posts = $tflist_queue_attach = $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(); if($mybb->usergroup['issupermod'] != 1) {
|
// SQL for fetching items only related to forums this user moderates $moderated_forums = array(); if($mybb->usergroup['issupermod'] != 1) {
|
$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");
| $query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");
|
|
|
$flist = $flist_queue_threads = $flist_queue_posts = $flist_queue_attach = $flist_reports = $flist_modlog = null;
| |
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0; while($forum = $db->fetch_array($query)) {
| $numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0; while($forum = $db->fetch_array($query)) {
|
Zeile 171 | Zeile 172 |
---|
$tflist = " AND t.fid IN (0{$flist})"; $flist = " AND fid IN (0{$flist})"; }
|
$tflist = " AND t.fid IN (0{$flist})"; $flist = " AND fid IN (0{$flist})"; }
|
} else { $flist = $tflist = '';
| |
}
// Retrieve a list of unviewable forums $unviewableforums = get_unviewable_forums(); $inactiveforums = get_inactive_forums();
|
}
// Retrieve a list of unviewable forums $unviewableforums = get_unviewable_forums(); $inactiveforums = get_inactive_forums();
|
| $unviewablefids1 = $unviewablefids2 = array();
|
|
|
if($unviewableforums && !is_super_admin($mybb->user['uid']))
| if($unviewableforums)
|
{ $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})";
|
$unviewablefids = explode(',', $unviewableforums); foreach($unviewablefids as $key => $fid) { $unviewablefids[$key] = (int)$fid; } unset($fid);
| $unviewablefids1 = explode(',', $unviewableforums);
|
}
if($inactiveforums)
| }
if($inactiveforums)
|
Zeile 199 | Zeile 192 |
---|
$flist .= " AND fid NOT IN ({$inactiveforums})"; $tflist .= " AND t.fid NOT IN ({$inactiveforums})";
|
$flist .= " AND fid NOT IN ({$inactiveforums})"; $tflist .= " AND t.fid NOT IN ({$inactiveforums})";
|
$unviewablefids = explode(',', $inactiveforums); foreach($unviewablefids as &$fid) { $fid = (int)$fid; } unset($fid);
| $unviewablefids2 = explode(',', $inactiveforums);
|
}
|
}
|
$unviewableforums = $unviewablefids;
| $unviewableforums = array_merge($unviewablefids1, $unviewablefids2);
|
if(!isset($collapsedimg['modcpforums'])) { $collapsedimg['modcpforums'] = '';
|
if(!isset($collapsedimg['modcpforums'])) { $collapsedimg['modcpforums'] = '';
|
}
| }
|
if(!isset($collapsed['modcpforums_e'])) {
| if(!isset($collapsed['modcpforums_e'])) {
|
Zeile 234 | Zeile 222 |
---|
if(($numannouncements > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canmanageannounce'] == 1) { eval("\$nav_announcements = \"".$templates->get("modcp_nav_announcements")."\";");
|
if(($numannouncements > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canmanageannounce'] == 1) { eval("\$nav_announcements = \"".$templates->get("modcp_nav_announcements")."\";");
|
}
| }
|
if(($nummodqueuethreads > 0 || $nummodqueueposts > 0 || $nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canmanagemodqueue'] == 1) {
| if(($nummodqueuethreads > 0 || $nummodqueueposts > 0 || $nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canmanagemodqueue'] == 1) {
|
Zeile 249 | Zeile 237 |
---|
if(($nummodlogs > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canviewmodlogs'] == 1) { eval("\$nav_modlogs = \"".$templates->get("modcp_nav_modlogs")."\";");
|
if(($nummodlogs > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canviewmodlogs'] == 1) { eval("\$nav_modlogs = \"".$templates->get("modcp_nav_modlogs")."\";");
|
}
| }
|
if($mybb->usergroup['caneditprofiles'] == 1) { eval("\$nav_editprofile = \"".$templates->get("modcp_nav_editprofile")."\";"); }
if($mybb->usergroup['canbanusers'] == 1)
|
if($mybb->usergroup['caneditprofiles'] == 1) { eval("\$nav_editprofile = \"".$templates->get("modcp_nav_editprofile")."\";"); }
if($mybb->usergroup['canbanusers'] == 1)
|
{
| {
|
eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");
|
eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");
|
}
| }
|
if($mybb->usergroup['canviewwarnlogs'] == 1) { eval("\$nav_warninglogs = \"".$templates->get("modcp_nav_warninglogs")."\";");
|
if($mybb->usergroup['canviewwarnlogs'] == 1) { eval("\$nav_warninglogs = \"".$templates->get("modcp_nav_warninglogs")."\";");
|
}
| }
|
if($mybb->usergroup['canuseipsearch'] == 1) { eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";");
|
if($mybb->usergroup['canuseipsearch'] == 1) { eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";");
|
}
$plugins->run_hooks("modcp_nav");
| }
$plugins->run_hooks("modcp_nav");
|
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
| $expaltext = (in_array("modcpforums", $collapse)) ? "[+]" : "[-]";
|
eval("\$modcp_nav_forums_posts = \"".$templates->get("modcp_nav_forums_posts")."\";"); }
if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch)) {
|
eval("\$modcp_nav_forums_posts = \"".$templates->get("modcp_nav_forums_posts")."\";"); }
if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch)) {
|
| $expaltext = (in_array("modcpusers", $collapse)) ? "[+]" : "[-]";
|
eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";"); }
| eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";"); }
|
Zeile 295 | Zeile 285 |
---|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$mybb->input['reports'] = $mybb->get_input('reports', 2); if(empty($mybb->input['reports'])) {
| $mybb->input['reports'] = $mybb->get_input('reports', MyBB::INPUT_ARRAY); if(empty($mybb->input['reports']) && empty($mybb->cookies['inlinereports'])) {
|
error($lang->error_noselected_reports);
|
error($lang->error_noselected_reports);
|
}
| }
$message = $lang->redirect_reportsmarked;
if(isset($mybb->cookies['inlinereports'])) { if($mybb->cookies['inlinereports'] == '|ALL|') { $message = $lang->redirect_allreportsmarked; $sql = "1=1"; if(isset($mybb->cookies['inlinereports_removed'])) { $inlinereportremovedlist = explode("|", $mybb->cookies['inlinereports_removed']); $reports = array_map("intval", $inlinereportremovedlist); $rids = implode("','", $reports); $sql = "rid NOT IN ('0','{$rids}')"; } } else { $inlinereportlist = explode("|", $mybb->cookies['inlinereports']); $reports = array_map("intval", $inlinereportlist);
if(!count($reports)) { error($lang->error_noselected_reports); }
$rids = implode("','", $reports);
|
|
|
$sql = '1=1'; if(empty($mybb->input['allbox']))
| $sql = "rid IN ('0','{$rids}')"; } } else
|
{ $mybb->input['reports'] = array_map("intval", $mybb->input['reports']); $rids = implode("','", $mybb->input['reports']);
|
{ $mybb->input['reports'] = array_map("intval", $mybb->input['reports']); $rids = implode("','", $mybb->input['reports']);
|
|
|
$sql = "rid IN ('0','{$rids}')"; }
|
$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();
|
$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}"); $cache->update_reportedcontent();
|
$page = $mybb->get_input('page', 1);
| my_unsetcookie('inlinereports'); my_unsetcookie('inlinereports_removed');
$page = $mybb->get_input('page', MyBB::INPUT_INT);
|
|
|
redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked);
| redirect("modcp.php?action=reports&page={$page}", $message);
|
}
if($mybb->input['action'] == "reports")
| }
if($mybb->input['action'] == "reports")
|
Zeile 363 | Zeile 385 |
---|
unset($fid); }
|
unset($fid); }
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
$postcount = (int)$report_count; $pages = $postcount / $perpage;
| $postcount = (int)$report_count; $pages = $postcount / $perpage;
|
Zeile 396 | Zeile 418 |
---|
// Reports $reports = ''; $query = $db->query("
|
// Reports $reports = ''; $query = $db->query("
|
SELECT r.*, u.username
| SELECT r.*, u.username, rr.title
|
FROM ".TABLE_PREFIX."reportedcontent r LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid = u.uid)
|
FROM ".TABLE_PREFIX."reportedcontent r LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid = u.uid)
|
| LEFT JOIN ".TABLE_PREFIX."reportreasons rr ON (r.reasonid = rr.rid)
|
WHERE r.reportstatus = '0'{$tflist_reports} ORDER BY r.reports DESC LIMIT {$start}, {$perpage}
| WHERE r.reportstatus = '0'{$tflist_reports} ORDER BY r.reports DESC LIMIT {$start}, {$perpage}
|
Zeile 502 | Zeile 525 |
---|
} }
|
} }
|
| $lang->page_selected = $lang->sprintf($lang->page_selected, count($reportcache)); $lang->select_all = $lang->sprintf($lang->select_all, (int)$report_count); $lang->all_selected = $lang->sprintf($lang->all_selected, (int)$report_count); eval("\$selectall = \"".$templates->get("modcp_reports_selectall")."\";");
$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 520 | Zeile 551 |
---|
{ case 'post': $post = get_post_link($report['id'])."#pid{$report['id']}";
|
{ case 'post': $post = get_post_link($report['id'])."#pid{$report['id']}";
|
$user = build_profile_link($postcache[$report['id']]['username'], $postcache[$report['id']]['uid']);
| $user = build_profile_link(htmlspecialchars_uni($postcache[$report['id']]['username']), $postcache[$report['id']]['uid']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);
$thread_link = get_thread_link($postcache[$report['id']]['tid']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);
$thread_link = get_thread_link($postcache[$report['id']]['tid']);
|
$thread_subject = htmlspecialchars_uni($postcache[$report['id']]['subject']);
| $thread_subject = htmlspecialchars_uni($parser->parse_badwords($postcache[$report['id']]['subject']));
|
$report_data['content'] .= $lang->sprintf($lang->report_info_post_thread, $thread_link, $thread_subject);
break; case 'profile':
|
$report_data['content'] .= $lang->sprintf($lang->report_info_post_thread, $thread_link, $thread_subject);
break; case 'profile':
|
$user = build_profile_link($usercache[$report['id']]['username'], $usercache[$report['id']]['uid']);
| $user = build_profile_link(htmlspecialchars_uni($usercache[$report['id']]['username']), $usercache[$report['id']]['uid']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_profile, $user); break; case 'reputation': $reputation_link = "reputation.php?uid={$usercache[$report['id3']]['uid']}#rid{$report['id']}";
|
$report_data['content'] = $lang->sprintf($lang->report_info_profile, $user); break; case 'reputation': $reputation_link = "reputation.php?uid={$usercache[$report['id3']]['uid']}#rid{$report['id']}";
|
$bad_user = build_profile_link($usercache[$report['id2']]['username'], $usercache[$report['id2']]['uid']);
| $bad_user = build_profile_link(htmlspecialchars_uni($usercache[$report['id2']]['username']), $usercache[$report['id2']]['uid']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_reputation, $reputation_link, $bad_user);
|
$report_data['content'] = $lang->sprintf($lang->report_info_reputation, $reputation_link, $bad_user);
|
$good_user = build_profile_link($usercache[$report['id3']]['username'], $usercache[$report['id3']]['uid']);
| $good_user = build_profile_link(htmlspecialchars_uni($usercache[$report['id3']]['username']), $usercache[$report['id3']]['uid']);
|
$report_data['content'] .= $lang->sprintf($lang->report_info_rep_profile, $good_user); break; }
// Report reason and comment
|
$report_data['content'] .= $lang->sprintf($lang->report_info_rep_profile, $good_user); break; }
// Report reason and comment
|
$report_data['comment'] = $lang->na; $report_string = "report_reason_{$report['reason']}";
if(isset($lang->$report_string)) { $report_data['comment'] = $lang->$report_string; } else if(!empty($report['reason'])) { $report_data['comment'] = htmlspecialchars_uni($report['reason']); }
| if($report['reasonid'] > 0) { $reason = htmlspecialchars_uni($lang->parse($report['title']));
if(empty($report['reason'])) { eval("\$report_data['comment'] = \"".$templates->get("modcp_reports_report_comment")."\";"); } else { $comment = htmlspecialchars_uni($report['reason']); eval("\$report_data['comment'] = \"".$templates->get("modcp_reports_report_comment_extra")."\";"); } } else { $report_data['comment'] = $lang->na; }
|
$report_reports = 1; if($report['reports']) { $report_data['reports'] = my_number_format($report['reports']);
|
$report_reports = 1; if($report['reports']) { $report_data['reports'] = my_number_format($report['reports']);
|
}
| }
|
if($report['lastreporter']) { if(is_array($usercache[$report['lastreporter']])) {
|
if($report['lastreporter']) { if(is_array($usercache[$report['lastreporter']])) {
|
$lastreport_user = build_profile_link($usercache[$report['lastreporter']]['username'], $report['lastreporter']);
| $lastreport_user = build_profile_link(htmlspecialchars_uni($usercache[$report['lastreporter']]['username']), $report['lastreporter']);
|
} elseif($usercache[$report['lastreporter']] > 0) {
|
} elseif($usercache[$report['lastreporter']] > 0) {
|
$lastreport_user = $lang->na_deleted;
| $lastreport_user = htmlspecialchars_uni($lang->na_deleted);
|
}
$lastreport_date = my_date('relative', $report['lastreport']); $report_data['lastreporter'] = $lang->sprintf($lang->report_info_lastreporter, $lastreport_date, $lastreport_user);
|
}
$lastreport_date = my_date('relative', $report['lastreport']); $report_data['lastreporter'] = $lang->sprintf($lang->report_info_lastreporter, $lastreport_date, $lastreport_user);
|
| }
$inlinecheck = ''; if(isset($mybb->cookies['inlinereports']) && my_strpos($mybb->cookies['inlinereports'], "|{$report['rid']}|") !== false) { $inlinecheck = " checked=\"checked\""; ++$inlinecount;
|
}
$plugins->run_hooks("modcp_reports_report"); eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";"); }
|
}
$plugins->run_hooks("modcp_reports_report"); eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";"); }
|
}
| }
|
$plugins->run_hooks("modcp_reports_end");
eval("\$reportedcontent = \"".$templates->get("modcp_reports")."\";"); output_page($reportedcontent); }
|
$plugins->run_hooks("modcp_reports_end");
eval("\$reportedcontent = \"".$templates->get("modcp_reports")."\";"); output_page($reportedcontent); }
|
|
|
if($mybb->input['action'] == "allreports") { if($mybb->usergroup['canmanagereportedcontent'] == 0)
| if($mybb->input['action'] == "allreports") { if($mybb->usergroup['canmanagereportedcontent'] == 0)
|
Zeile 598 | Zeile 643 |
---|
add_breadcrumb($lang->report_center, "modcp.php?action=reports"); add_breadcrumb($lang->all_reports, "modcp.php?action=allreports");
|
add_breadcrumb($lang->report_center, "modcp.php?action=reports"); add_breadcrumb($lang->all_reports, "modcp.php?action=allreports");
|
|
|
if(!$mybb->settings['threadsperpage']) { $mybb->settings['threadsperpage'] = 20;
| if(!$mybb->settings['threadsperpage']) { $mybb->settings['threadsperpage'] = 20;
|
Zeile 608 | Zeile 653 |
---|
$perpage = $mybb->settings['threadsperpage']; if($mybb->get_input('page') != "last") {
|
$perpage = $mybb->settings['threadsperpage']; if($mybb->get_input('page') != "last") {
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])
| }
if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])
|
Zeile 633 | Zeile 678 |
---|
if(isset($mybb->input['rid'])) {
|
if(isset($mybb->input['rid'])) {
|
$mybb->input['rid'] = $mybb->get_input('rid', 1);
| $mybb->input['rid'] = $mybb->get_input('rid', MyBB::INPUT_INT);
|
$query = $db->simple_select("reportedcontent", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'"); $result = $db->fetch_field($query, "count"); if(($result % $perpage) == 0)
| $query = $db->simple_select("reportedcontent", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'"); $result = $db->fetch_field($query, "count"); if(($result % $perpage) == 0)
|
Zeile 680 | Zeile 725 |
---|
$plugins->run_hooks("modcp_allreports_start");
$query = $db->query("
|
$plugins->run_hooks("modcp_allreports_start");
$query = $db->query("
|
SELECT r.*, u.username, p.username AS postusername, up.uid AS postuid, t.subject AS threadsubject, pr.username AS profileusername
| SELECT r.*, u.username, p.username AS postusername, up.uid AS postuid, t.subject AS threadsubject, prrep.username AS repusername, pr.username AS profileusername, rr.title
|
FROM ".TABLE_PREFIX."reportedcontent r LEFT JOIN ".TABLE_PREFIX."posts p ON (r.id=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid) LEFT JOIN ".TABLE_PREFIX."users pr ON (pr.uid=r.id)
|
FROM ".TABLE_PREFIX."reportedcontent r LEFT JOIN ".TABLE_PREFIX."posts p ON (r.id=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid) LEFT JOIN ".TABLE_PREFIX."users pr ON (pr.uid=r.id)
|
| LEFT JOIN ".TABLE_PREFIX."users prrep ON (prrep.uid=r.id2) LEFT JOIN ".TABLE_PREFIX."reportreasons rr ON (r.reasonid = rr.rid)
|
{$wflist_reports} ORDER BY r.dateline DESC LIMIT {$start}, {$perpage}
| {$wflist_reports} ORDER BY r.dateline DESC LIMIT {$start}, {$perpage}
|
Zeile 706 | Zeile 753 |
---|
if($report['type'] == 'post') { $post = get_post_link($report['id'])."#pid{$report['id']}";
|
if($report['type'] == 'post') { $post = get_post_link($report['id'])."#pid{$report['id']}";
|
$user = build_profile_link($report['postusername'], $report['postuid']);
| $user = build_profile_link(htmlspecialchars_uni($report['postusername']), $report['postuid']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);
$thread_link = get_thread_link($report['id2']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);
$thread_link = get_thread_link($report['id2']);
|
$thread_subject = htmlspecialchars_uni($report['threadsubject']);
| $thread_subject = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
|
$report_data['content'] .= $lang->sprintf($lang->report_info_post_thread, $thread_link, $thread_subject); } else if($report['type'] == 'profile') {
|
$report_data['content'] .= $lang->sprintf($lang->report_info_post_thread, $thread_link, $thread_subject); } else if($report['type'] == 'profile') {
|
$user = build_profile_link($report['profileusername'], $report['id']);
| $user = build_profile_link(htmlspecialchars_uni($report['profileusername']), $report['id']);
|
$report_data['content'] = $lang->sprintf($lang->report_info_profile, $user); } else if($report['type'] == 'reputation') {
|
$report_data['content'] = $lang->sprintf($lang->report_info_profile, $user); } else if($report['type'] == 'reputation') {
|
$user = build_profile_link($report['profileusername'], $report['id3']);
| $user = build_profile_link(htmlspecialchars_uni($report['repusername']), $report['id2']);
|
$reputation_link = "reputation.php?uid={$report['id3']}#rid{$report['id']}"; $report_data['content'] = $lang->sprintf($lang->report_info_reputation, $reputation_link, $user); }
// Report reason and comment
|
$reputation_link = "reputation.php?uid={$report['id3']}#rid{$report['id']}"; $report_data['content'] = $lang->sprintf($lang->report_info_reputation, $reputation_link, $user); }
// Report reason and comment
|
$report_data['comment'] = $lang->na; $report_string = "report_reason_{$report['reason']}";
| if($report['reasonid'] > 0) { $reason = htmlspecialchars_uni($lang->parse($report['title']));
if(empty($report['reason'])) { eval("\$report_data['comment'] = \"".$templates->get("modcp_reports_report_comment")."\";"); } else { $comment = htmlspecialchars_uni($report['reason']); eval("\$report_data['comment'] = \"".$templates->get("modcp_reports_report_comment_extra")."\";"); } } else { $report_data['comment'] = $lang->na; }
|
$report['reporterlink'] = get_profile_link($report['uid']); if(!$report['username'])
| $report['reporterlink'] = get_profile_link($report['uid']); if(!$report['username'])
|
Zeile 735 | Zeile 798 |
---|
$report['username'] = $lang->na_deleted; $report['reporterlink'] = $post; }
|
$report['username'] = $lang->na_deleted; $report['reporterlink'] = $post; }
|
if(isset($lang->$report_string)) { $report_data['comment'] = $lang->$report_string; } else if(!empty($report['reason'])) { $report_data['comment'] = htmlspecialchars_uni($report['reason']); }
| $report['username'] = htmlspecialchars_uni($report['username']);
|
$report_data['reports'] = my_number_format($report['reports']); $report_data['time'] = my_date('relative', $report['dateline']);
| $report_data['reports'] = my_number_format($report['reports']); $report_data['time'] = my_date('relative', $report['dateline']);
|
Zeile 773 | Zeile 828 |
---|
add_breadcrumb($lang->mcp_nav_modlogs, "modcp.php?action=modlogs");
|
add_breadcrumb($lang->mcp_nav_modlogs, "modcp.php?action=modlogs");
|
$perpage = $mybb->get_input('perpage', 1);
| $perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);
|
if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
| if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
|
Zeile 782 | Zeile 837 |
---|
$where = '';
// Searching for entries by a particular user
|
$where = '';
// Searching for entries by a particular user
|
if($mybb->get_input('uid', 1))
| if($mybb->get_input('uid', MyBB::INPUT_INT))
|
{
|
{
|
$where .= " AND l.uid='".$mybb->get_input('uid', 1)."'";
| $where .= " AND l.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";
|
}
// Searching for entries in a specific forum
|
}
// Searching for entries in a specific forum
|
if($mybb->get_input('fid', 1))
| if($mybb->get_input('fid', MyBB::INPUT_INT))
|
{
|
{
|
$where .= " AND t.fid='".$mybb->get_input('fid', 1)."'";
| $where .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";
|
}
$mybb->input['sortby'] = $mybb->get_input('sortby');
| }
$mybb->input['sortby'] = $mybb->get_input('sortby');
|
Zeile 830 | Zeile 885 |
---|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
$postcount = (int)$rescount;
| }
$postcount = (int)$rescount;
|
Zeile 860 | Zeile 915 |
---|
$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) {
|
$mybb->input[$field] = $mybb->get_input($field, 1);
| $mybb->input[$field] = $mybb->get_input($field, MyBB::INPUT_INT);
|
if(!empty($mybb->input[$field])) { $page_url .= "&{$field}=".$mybb->input[$field];
| if(!empty($mybb->input[$field])) { $page_url .= "&{$field}=".$mybb->input[$field];
|
Zeile 899 | Zeile 954 |
---|
$logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date('relative', $logitem['dateline']); $trow = alt_trow();
|
$logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date('relative', $logitem['dateline']); $trow = alt_trow();
|
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']); $logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
| if($logitem['username']) { $logitem['username'] = htmlspecialchars_uni($logitem['username']); $username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']); $logitem['profilelink'] = build_profile_link($username, $logitem['uid']); } else { $username = $logitem['profilelink'] = $logitem['username'] = htmlspecialchars_uni($lang->na_deleted); }
|
$logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));
if($logitem['tsubject']) {
|
$logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));
if($logitem['tsubject']) {
|
$logitem['tsubject'] = htmlspecialchars_uni($logitem['tsubject']);
| $logitem['tsubject'] = htmlspecialchars_uni($parser->parse_badwords($logitem['tsubject']));
|
$logitem['thread'] = get_thread_link($logitem['tid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";"); } if($logitem['fname'])
|
$logitem['thread'] = get_thread_link($logitem['tid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";"); } if($logitem['fname'])
|
{
| {
|
$logitem['forum'] = get_forum_link($logitem['fid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_forum")."\";"); } if($logitem['psubject']) {
|
$logitem['forum'] = get_forum_link($logitem['fid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_forum")."\";"); } if($logitem['psubject']) {
|
$logitem['psubject'] = htmlspecialchars_uni($logitem['psubject']);
| $logitem['psubject'] = htmlspecialchars_uni($parser->parse_badwords($logitem['psubject']));
|
$logitem['post'] = get_post_link($logitem['pid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_post")."\";");
|
$logitem['post'] = get_post_link($logitem['pid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_post")."\";");
|
}
| }
|
// Edited a user or managed announcement? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
| // Edited a user or managed announcement? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
|
Zeile 927 | Zeile 990 |
---|
$data = my_unserialize($logitem['data']); if(!empty($data['uid'])) {
|
$data = my_unserialize($logitem['data']); if(!empty($data['uid'])) {
|
| $data['username'] = htmlspecialchars_uni($data['username']);
|
$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(!empty($data['aid'])) {
|
if(!empty($data['aid'])) {
|
$data['subject'] = htmlspecialchars_uni($data['subject']);
| $data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject']));
|
$data['announcement'] = get_announcement_link($data['aid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";"); } }
|
$data['announcement'] = get_announcement_link($data['aid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";"); } }
|
| $plugins->run_hooks("modcp_modlogs_result");
|
eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";");
|
eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";");
|
}
| }
|
if(!$results) { eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";");
|
if(!$results) { eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";");
|
}
$plugins->run_hooks("modcp_modlogs_filter");
| }
$plugins->run_hooks("modcp_modlogs_filter");
|
// Fetch filter options $sortbysel = array('username' => '', 'forum' => '', 'thread' => '', 'dateline' => '');
| // Fetch filter options $sortbysel = array('username' => '', 'forum' => '', 'thread' => '', 'dateline' => '');
|
Zeile 965 | Zeile 1031 |
---|
if(!$user['username']) { $user['username'] = $lang->na_deleted;
|
if(!$user['username']) { $user['username'] = $lang->na_deleted;
|
}
| }
|
$selected = '';
|
$selected = '';
|
if($mybb->get_input('uid', 1) == $user['uid'])
| if($mybb->get_input('uid', MyBB::INPUT_INT) == $user['uid'])
|
{ $selected = " selected=\"selected\""; }
| { $selected = " selected=\"selected\""; }
|
Zeile 977 | Zeile 1043 |
---|
eval("\$user_options .= \"".$templates->get("modcp_modlogs_user")."\";"); }
|
eval("\$user_options .= \"".$templates->get("modcp_modlogs_user")."\";"); }
|
$forum_select = build_forum_jump("", $mybb->get_input('fid', 1), 1, '', 0, true, '', "fid");
| $forum_select = build_forum_jump("", $mybb->get_input('fid', MyBB::INPUT_INT), 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->get_input('my_post_key'));
|
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)))
| 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();
|
{ 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();
|
$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); }
| redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement); }
|
Zeile 1025 | Zeile 1091 |
---|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);
|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);
|
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
| $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
if(!$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($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_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); }
|
Zeile 1048 | Zeile 1114 |
---|
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(); }
$announcement_fid = $mybb->get_input('fid', 1); 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(); }
$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(); }
|
$errors = array();
$mybb->input['title'] = $mybb->get_input('title');
|
$errors = array();
$mybb->input['title'] = $mybb->get_input('title');
|
if(!trim($mybb->input['title'])) {
| if(!trim($mybb->input['title'])) {
|
$errors[] = $lang->error_missing_title; }
| $errors[] = $lang->error_missing_title; }
|
Zeile 1073 | Zeile 1139 |
---|
}
if(!$announcement_fid)
|
}
if(!$announcement_fid)
|
{
| {
|
$errors[] = $lang->error_missing_forum; }
| $errors[] = $lang->error_missing_forum; }
|
Zeile 1083 | Zeile 1149 |
---|
$startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']); $enddate = @explode(":", $enddate[0]);
|
$startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']); $enddate = @explode(":", $enddate[0]);
|
|
|
if(stristr($mybb->input['starttime_time'], "pm")) { $startdate[0] = 12+$startdate[0];
| if(stristr($mybb->input['starttime_time'], "pm")) { $startdate[0] = 12+$startdate[0];
|
Zeile 1094 | Zeile 1160 |
---|
}
if(stristr($mybb->input['endtime_time'], "pm"))
|
}
if(stristr($mybb->input['endtime_time'], "pm"))
|
{
| {
|
$enddate[0] = 12+$enddate[0]; if($enddate[0] >= 24) {
| $enddate[0] = 12+$enddate[0]; if($enddate[0] >= 24) {
|
Zeile 1105 | Zeile 1171 |
---|
$mybb->input['starttime_month'] = $mybb->get_input('starttime_month'); $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
|
$mybb->input['starttime_month'] = $mybb->get_input('starttime_month'); $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
|
{
| {
|
$mybb->input['starttime_month'] = '01'; }
|
$mybb->input['starttime_month'] = '01'; }
|
$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, (int)$mybb->input['starttime_month'], $mybb->get_input('starttime_day', 1), $mybb->get_input('starttime_year', 1)); if(!checkdate((int)$mybb->input['starttime_month'], (int)$mybb->input['starttime_day'], (int)$mybb->input['starttime_year']) || $startdate < 0 || $startdate == false)
| $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false)
|
{ $errors[] = $lang->error_invalid_start_date; }
|
{ $errors[] = $lang->error_invalid_start_date; }
|
if($mybb->get_input('endtime_type', 1) == 2)
| if($mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2)
|
{ $enddate = '0'; $mybb->input['endtime_month'] = '01';
|
{ $enddate = '0'; $mybb->input['endtime_month'] = '01';
|
}
| }
|
else { $mybb->input['endtime_month'] = $mybb->get_input('endtime_month'); if(!in_array($mybb->input['endtime_month'], $months))
|
else { $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, (int)$mybb->input['endtime_month'], $mybb->get_input('endtime_day', 1), $mybb->get_input('endtime_year', 1)); if(!checkdate((int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']) || $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;
|
}
| }
|
if($enddate <= $startdate) { $errors[] = $lang->error_end_before_start; }
|
if($enddate <= $startdate) { $errors[] = $lang->error_end_before_start; }
|
}
| }
|
|
|
if($mybb->get_input('allowhtml', 1) == 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', 1) == 1)
| if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1)
|
{ $allowmycode = 1;
|
{ $allowmycode = 1;
|
}
| }
|
else
|
else
|
{
| {
|
$allowmycode = 0;
|
$allowmycode = 0;
|
} if($mybb->get_input('allowsmilies', 1) == 1) {
| } if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) {
|
$allowsmilies = 1; } else
| $allowsmilies = 1; } else
|
Zeile 1167 | Zeile 1235 |
---|
$plugins->run_hooks("modcp_do_new_announcement_start");
if(!$errors)
|
$plugins->run_hooks("modcp_do_new_announcement_start");
if(!$errors)
|
{
| {
|
if(isset($mybb->input['preview'])) { $preview = array(); $mybb->input['action'] = 'new_announcement';
|
if(isset($mybb->input['preview'])) { $preview = array(); $mybb->input['action'] = 'new_announcement';
|
}
| }
|
else { $insert_announcement = array(
| else { $insert_announcement = array(
|
Zeile 1188 | Zeile 1256 |
---|
); $aid = $db->insert_query("announcements", $insert_announcement);
|
); $aid = $db->insert_query("announcements", $insert_announcement);
|
log_moderator_action(array("aid" => $aid, "subject" => $db->escape_string($mybb->input['title'])), $lang->announcement_added);
| log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);
|
$plugins->run_hooks("modcp_do_new_announcement_end");
$cache->update_forumsdisplay();
| $plugins->run_hooks("modcp_do_new_announcement_end");
$cache->update_forumsdisplay();
|
Zeile 1199 | Zeile 1267 |
---|
else { $mybb->input['action'] = 'new_announcement';
|
else { $mybb->input['action'] = 'new_announcement';
|
}
| }
|
}
if($mybb->input['action'] == "new_announcement")
| }
if($mybb->input['action'] == "new_announcement")
|
Zeile 1210 | Zeile 1278 |
---|
}
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=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', 1);
| 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)))
| 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(); }
|
Zeile 1229 | Zeile 1297 |
---|
else { $errors = '';
|
else { $errors = '';
|
}
| }
|
// Set $announcement to input stuff $announcement['subject'] = $mybb->input['title']; $announcement['message'] = $mybb->input['message'];
| // Set $announcement to input stuff $announcement['subject'] = $mybb->input['title']; $announcement['message'] = $mybb->input['message'];
|
Zeile 1240 | Zeile 1308 |
---|
$startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
|
$startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
|
$startday = $mybb->get_input('starttime_day', 1);
| $startday = $mybb->get_input('starttime_day', MyBB::INPUT_INT);
|
$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']); $endmonth = $mybb->input['endtime_month']; $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
|
$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']); $endmonth = $mybb->input['endtime_month']; $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
|
$endday = $mybb->get_input('endtime_day', 1);
| $endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT);
|
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
} else { // Note: dates are in GMT timezone $starttime_time = gmdate("g:i a", TIME_NOW); $endtime_time = gmdate("g:i a", TIME_NOW); $startday = $endday = gmdate("j", TIME_NOW); $startmonth = $endmonth = gmdate("m", TIME_NOW); $startdateyear = gmdate("Y", TIME_NOW);
| } else { $localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$starttime_time = gmdate($mybb->settings['timeformat'], $localized_time); $endtime_time = gmdate($mybb->settings['timeformat'], $localized_time); $startday = $endday = gmdate("j", $localized_time); $startmonth = $endmonth = gmdate("m", $localized_time); $startdateyear = gmdate("Y", $localized_time);
|
$announcement = array( 'subject' => '', 'message' => '',
|
$announcement = array( 'subject' => '', 'message' => '',
|
'allowhtml' => 1,
| 'allowhtml' => 0,
|
'allowmycode' => 1, 'allowsmilies' => 1 );
$enddateyear = $startdateyear+1; }
|
'allowmycode' => 1, 'allowsmilies' => 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")."\";"); } }
$startmonthsel = $endmonthsel = array(); foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month) { $startmonthsel[$month] = ''; $endmonthsel[$month] = ''; } $startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth = $enddatemonth = '';
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => ''); if($announcement['allowhtml']) { $html_sel['yes'] = ' checked="checked"'; } else { $html_sel['no'] = ' checked="checked"'; }
if($announcement['allowmycode']) { $mycode_sel['yes'] = ' checked="checked"'; }
| // 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[$month] = ''; $endmonthsel[$month] = ''; } $startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth = $enddatemonth = '';
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');
if($mybb->settings['announcementshtml']) { if($announcement['allowhtml']) { $html_sel['yes'] = ' checked="checked"'; } else { $html_sel['no'] = ' checked="checked"'; }
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";"); } else { $allow_html = ''; }
if($announcement['allowmycode']) { $mycode_sel['yes'] = ' checked="checked"'; }
|
else { $mycode_sel['no'] = ' checked="checked"'; }
if($announcement['allowsmilies'])
|
else { $mycode_sel['no'] = ' checked="checked"'; }
if($announcement['allowsmilies'])
|
{
| {
|
$smilies_sel['yes'] = ' checked="checked"'; } else
| $smilies_sel['yes'] = ' checked="checked"'; } else
|
Zeile 1348 | Zeile 1427 |
---|
{ $end_type_sel['finite'] = ' checked="checked"'; }
|
{ $end_type_sel['finite'] = ' checked="checked"'; }
|
|
|
// MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
| // MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
|
Zeile 1358 | Zeile 1437 |
---|
$announcementarray = array( 'aid' => 0, 'fid' => $announcement_fid,
|
$announcementarray = array( 'aid' => 0, 'fid' => $announcement_fid,
|
'uid' => $mybb->user['uid'], 'subject' => $mybb->input['title'], 'message' => $mybb->input['message'], 'allowhtml' => (int)$mybb->input['allowhtml'], 'allowmycode' => (int)$mybb->input['allowmycode'], 'allowsmilies' => (int)$mybb->input['allowsmilies'], 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'], );
$array = $mybb->user; foreach($array as $key => $element) { $announcementarray[$key] = $element; }
// Gather usergroup data from the cache // Field => Array Key $data_key = array( 'title' => 'grouptitle', 'usertitle' => 'groupusertitle', 'stars' => 'groupstars', 'starimage' => 'groupstarimage', 'image' => 'groupimage', 'namestyle' => 'namestyle', 'usereputationsystem' => 'usereputationsystem' );
foreach($data_key as $field => $key) { $announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field]; }
require_once MYBB_ROOT."inc/functions_post.php"; $postbit = build_postbit($announcementarray, 1); eval("\$preview = \"".$templates->get("previewpost")."\";");
| 'uid' => $mybb->user['uid'], 'subject' => $mybb->input['title'], 'message' => $mybb->input['message'], 'allowhtml' => $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT), 'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT), 'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'], );
$array = $mybb->user; foreach($array as $key => $element) { $announcementarray[$key] = $element; }
// Gather usergroup data from the cache // Field => Array Key $data_key = array( 'title' => 'grouptitle', 'usertitle' => 'groupusertitle', 'stars' => 'groupstars', 'starimage' => 'groupstarimage', 'image' => 'groupimage', 'namestyle' => 'namestyle', 'usereputationsystem' => 'usereputationsystem' );
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); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
} else {
| } else {
|
Zeile 1416 | Zeile 1495 |
---|
}
// Get the announcement
|
}
// Get the announcement
|
$aid = $mybb->get_input('aid', 1);
| $aid = $mybb->get_input('aid', MyBB::INPUT_INT);
|
$query = $db->simple_select("announcements", "*", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
|
$query = $db->simple_select("announcements", "*", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
|
|
|
// Check that it exists if(!$announcement) {
| // Check that it exists if(!$announcement) {
|
Zeile 1460 | Zeile 1539 |
---|
if($startdate[0] >= 24) { $startdate[0] = "00";
|
if($startdate[0] >= 24) { $startdate[0] = "00";
|
}
| }
|
}
if(stristr($mybb->input['endtime_time'], "pm"))
| }
if(stristr($mybb->input['endtime_time'], "pm"))
|
Zeile 1470 | Zeile 1549 |
---|
{ $enddate[0] = "00"; }
|
{ $enddate[0] = "00"; }
|
}
| }
|
$mybb->input['starttime_month'] = $mybb->get_input('starttime_month'); $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
| $mybb->input['starttime_month'] = $mybb->get_input('starttime_month'); $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months))
|
Zeile 1479 | Zeile 1558 |
---|
$mybb->input['starttime_month'] = '01'; }
|
$mybb->input['starttime_month'] = '01'; }
|
$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, (int)$mybb->input['starttime_month'], $mybb->get_input('starttime_day', 1), $mybb->get_input('starttime_year', 1)); if(!checkdate((int)$mybb->input['starttime_month'], (int)$mybb->input['starttime_day'], (int)$mybb->input['starttime_year']) || $startdate < 0 || $startdate == false)
| $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false)
|
{ $errors[] = $lang->error_invalid_start_date; }
|
{ $errors[] = $lang->error_invalid_start_date; }
|
if($mybb->get_input('endtime_type', 1) == "2")
| if($mybb->get_input('endtime_type', MyBB::INPUT_INT) == "2")
|
{ $enddate = '0'; $mybb->input['endtime_month'] = '01';
| { $enddate = '0'; $mybb->input['endtime_month'] = '01';
|
Zeile 1497 | Zeile 1578 |
---|
{ $mybb->input['endtime_month'] = '01'; }
|
{ $mybb->input['endtime_month'] = '01'; }
|
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, (int)$mybb->input['endtime_month'], $mybb->get_input('endtime_day', 1), $mybb->get_input('endtime_year', 1)); if(!checkdate((int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']) || $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; }
|
Zeile 1508 | Zeile 1589 |
---|
} }
|
} }
|
if($mybb->get_input('allowhtml', 1) == 1)
| if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)
|
{ $allowhtml = 1; }
| { $allowhtml = 1; }
|
Zeile 1516 | Zeile 1597 |
---|
{ $allowhtml = 0; }
|
{ $allowhtml = 0; }
|
if($mybb->get_input('allowmycode', 1) == 1)
| if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1)
|
{ $allowmycode = 1; }
| { $allowmycode = 1; }
|
Zeile 1524 | Zeile 1605 |
---|
{ $allowmycode = 0; }
|
{ $allowmycode = 0; }
|
if($mybb->get_input('allowsmilies', 1) == 1)
| if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)
|
{ $allowsmilies = 1; }
| { $allowsmilies = 1; }
|
Zeile 1557 | Zeile 1638 |
---|
); $db->update_query("announcements", $update_announcement, "aid='{$aid}'");
|
); $db->update_query("announcements", $update_announcement, "aid='{$aid}'");
|
log_moderator_action(array("aid" => $announcement['aid'], "subject" => $db->escape_string($mybb->input['title'])), $lang->announcement_edited);
| log_moderator_action(array("aid" => $announcement['aid'], "subject" => $mybb->input['title']), $lang->announcement_edited);
|
$plugins->run_hooks("modcp_do_edit_announcement_end");
| $plugins->run_hooks("modcp_do_edit_announcement_end");
|
Zeile 1578 | Zeile 1659 |
---|
error_no_permission(); }
|
error_no_permission(); }
|
$aid = (int)$mybb->input['aid'];
| $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}");
// Get announcement
|
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements"); add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");
// Get announcement
|
if(!isset($announcement))
| if(!isset($announcement) || $mybb->request_method != 'post')
|
{ $query = $db->simple_select("announcements", "*", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
| { $query = $db->simple_select("announcements", "*", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
|
Zeile 1603 | Zeile 1684 |
---|
{ // No start date? Make it now. $announcement['startdate'] = TIME_NOW;
|
{ // No start date? Make it now. $announcement['startdate'] = TIME_NOW;
|
}
| }
|
$makeshift_end = false; if(!$announcement['enddate']) {
| $makeshift_end = false; if(!$announcement['enddate']) {
|
Zeile 1617 | Zeile 1698 |
---|
// No end date? Make it a year from now. $announcement['enddate'] = $makeshift_time + (60 * 60 * 24 * 366);
|
// No end date? Make it a year from now. $announcement['enddate'] = $makeshift_time + (60 * 60 * 24 * 366);
|
}
| }
|
// Deal with inline errors if(!empty($errors) || isset($preview)) { if(!empty($errors)) { $errors = inline_error($errors);
|
// Deal with inline errors if(!empty($errors) || isset($preview)) { if(!empty($errors)) { $errors = inline_error($errors);
|
} else
| } else
|
{ $errors = ''; }
| { $errors = ''; }
|
Zeile 1640 | Zeile 1721 |
---|
$startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
|
$startmonth = $mybb->input['starttime_month']; $startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
|
$startday = $mybb->get_input('starttime_day', 1);
| $startday = $mybb->get_input('starttime_day', MyBB::INPUT_INT);
|
$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']); $endmonth = $mybb->input['endtime_month']; $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
|
$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']); $endmonth = $mybb->input['endtime_month']; $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
|
$endday = $mybb->get_input('endtime_day', 1);
| $endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT);
|
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
$errored = true; } else
|
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
$errored = true; } else
|
{ // Note: dates are in GMT timezone $starttime_time = gmdate('g:i a', $announcement['startdate']); $endtime_time = gmdate('g:i a', $announcement['enddate']);
| { $localized_time_startdate = $announcement['startdate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; $localized_time_enddate = $announcement['enddate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$starttime_time = gmdate($mybb->settings['timeformat'], $localized_time_startdate); $endtime_time = gmdate($mybb->settings['timeformat'], $localized_time_enddate);
|
|
|
$startday = gmdate('j', $announcement['startdate']); $endday = gmdate('j', $announcement['enddate']);
| $startday = gmdate('j', $localized_time_startdate); $endday = gmdate('j', $localized_time_enddate);
|
|
|
$startmonth = gmdate('m', $announcement['startdate']); $endmonth = gmdate('m', $announcement['enddate']);
| $startmonth = gmdate('m', $localized_time_startdate); $endmonth = gmdate('m', $localized_time_enddate);
|
|
|
$startdateyear = gmdate('Y', $announcement['startdate']); $enddateyear = gmdate('Y', $announcement['enddate']);
| $startdateyear = gmdate('Y', $localized_time_startdate); $enddateyear = gmdate('Y', $localized_time_enddate);
|
$errored = false; }
| $errored = false; }
|
Zeile 1675 | Zeile 1758 |
---|
{ $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
{ $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
} else { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); }
if($endday == $day)
| } else { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); }
if($endday == $day)
|
{ $selected = " selected=\"selected\"";
|
{ $selected = " selected=\"selected\"";
|
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
| eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
} else { $selected = ''; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
} else { $selected = ''; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
}
| }
|
}
$startmonthsel = $endmonthsel = array();
| }
$startmonthsel = $endmonthsel = array();
|
Zeile 1699 | Zeile 1782 |
---|
{ $startmonthsel[$month] = ''; $endmonthsel[$month] = '';
|
{ $startmonthsel[$month] = ''; $endmonthsel[$month] = '';
|
}
| }
|
$startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
|
$startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
|
|
|
$startdatemonth = $enddatemonth = '';
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
|
$startdatemonth = $enddatemonth = '';
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
|
|
|
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');
|
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');
|
if($announcement['allowhtml']) { $html_sel['yes'] = ' checked="checked"'; } else { $html_sel['no'] = ' checked="checked"';
| if($mybb->settings['announcementshtml']) { if($announcement['allowhtml']) { $html_sel['yes'] = ' checked="checked"'; } else { $html_sel['no'] = ' checked="checked"'; }
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";"); } else { $allow_html = '';
|
}
if($announcement['allowmycode'])
| }
if($announcement['allowmycode'])
|
Zeile 1728 | Zeile 1821 |
---|
else { $mycode_sel['no'] = ' checked="checked"';
|
else { $mycode_sel['no'] = ' checked="checked"';
|
}
if($announcement['allowsmilies']) { $smilies_sel['yes'] = ' checked="checked"'; } else {
| }
if($announcement['allowsmilies']) { $smilies_sel['yes'] = ' checked="checked"'; } else {
|
$smilies_sel['no'] = ' checked="checked"'; }
$end_type_sel = array('infinite' => '', 'finite' => '');
|
$smilies_sel['no'] = ' checked="checked"'; }
$end_type_sel = array('infinite' => '', 'finite' => '');
|
if(($errored && $mybb->get_input('endtime_type', 1) == 2) || (!$errored && (int)$announcement['enddate'] == 0) || $makeshift_end == true)
| 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"'; }
| { $end_type_sel['infinite'] = ' checked="checked"'; }
|
Zeile 1752 | Zeile 1845 |
---|
// 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 1761 | Zeile 1854 |
---|
'uid' => $mybb->user['uid'], 'subject' => $mybb->input['title'], 'message' => $mybb->input['message'],
|
'uid' => $mybb->user['uid'], 'subject' => $mybb->input['title'], 'message' => $mybb->input['message'],
|
'allowhtml' => (int)$mybb->input['allowhtml'], 'allowmycode' => (int)$mybb->input['allowmycode'], 'allowsmilies' => (int)$mybb->input['allowsmilies'],
| 'allowhtml' => $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT), 'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT), 'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
|
'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'], );
| 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'], );
|
Zeile 1851 | Zeile 1944 |
---|
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_active")."\";"); }
|
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_active")."\";"); }
|
$subject = htmlspecialchars_uni($announcement['subject']);
| $subject = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
eval("\$announcements_global .= \"".$templates->get("modcp_announcements_announcement_global")."\";"); }
| eval("\$announcements_global .= \"".$templates->get("modcp_announcements_announcement_global")."\";"); }
|
Zeile 1883 | Zeile 1976 |
---|
require_once MYBB_ROOT."inc/class_moderation.php"; $moderation = new Moderation;
|
require_once MYBB_ROOT."inc/class_moderation.php"; $moderation = new Moderation;
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanagemodqueue'] == 0) { error_no_permission(); }
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanagemodqueue'] == 0) { error_no_permission(); }
|
$plugins->run_hooks("modcp_do_modqueue_start");
|
$plugins->run_hooks("modcp_do_modqueue_start");
|
$mybb->input['threads'] = $mybb->get_input('threads', 2); $mybb->input['posts'] = $mybb->get_input('posts', 2); $mybb->input['attachments'] = $mybb->get_input('attachments', 2);
| $mybb->input['threads'] = $mybb->get_input('threads', MyBB::INPUT_ARRAY); $mybb->input['posts'] = $mybb->get_input('posts', MyBB::INPUT_ARRAY); $mybb->input['attachments'] = $mybb->get_input('attachments', MyBB::INPUT_ARRAY);
|
if(!empty($mybb->input['threads'])) { $threads = array_map("intval", array_keys($mybb->input['threads']));
| if(!empty($mybb->input['threads'])) { $threads = array_map("intval", array_keys($mybb->input['threads']));
|
Zeile 2056 | Zeile 2149 |
---|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
$perpage = $mybb->settings['threadsperpage'];
| }
$perpage = $mybb->settings['threadsperpage'];
|
Zeile 2108 | Zeile 2201 |
---|
{ if($thread['threadusername'] != "") {
|
{ if($thread['threadusername'] != "") {
|
| $thread['threadusername'] = htmlspecialchars_uni($thread['threadusername']);
|
$profile_link = $thread['threadusername']; } else
| $profile_link = $thread['threadusername']; } else
|
Zeile 2117 | Zeile 2211 |
---|
} else {
|
} else {
|
| $thread['username'] = htmlspecialchars_uni($thread['username']);
|
$profile_link = build_profile_link($thread['username'], $thread['uid']); }
| $profile_link = build_profile_link($thread['username'], $thread['uid']); }
|
Zeile 2175 | Zeile 2270 |
---|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
$perpage = $mybb->settings['postsperpage'];
| }
$perpage = $mybb->settings['postsperpage'];
|
Zeile 2218 | Zeile 2313 |
---|
{ $altbg = alt_trow(); $post['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($post['threadsubject']));
|
{ $altbg = alt_trow(); $post['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($post['threadsubject']));
|
| $post['subject'] = htmlspecialchars_uni($parser->parse_badwords($post['subject']));
|
$post['threadlink'] = get_thread_link($post['tid']); $post['postlink'] = get_post_link($post['pid'], $post['tid']); $forum_link = get_forum_link($post['fid']);
| $post['threadlink'] = get_thread_link($post['tid']); $post['postlink'] = get_post_link($post['pid'], $post['tid']); $forum_link = get_forum_link($post['fid']);
|
Zeile 2228 | Zeile 2324 |
---|
{ if($post['postusername'] != "") {
|
{ if($post['postusername'] != "") {
|
| $post['postusername'] = htmlspecialchars_uni($post['postusername']);
|
$profile_link = $post['postusername']; } else
| $profile_link = $post['postusername']; } else
|
Zeile 2237 | Zeile 2334 |
---|
} else {
|
} else {
|
| $post['username'] = htmlspecialchars_uni($post['username']);
|
$profile_link = build_profile_link($post['username'], $post['uid']); }
| $profile_link = build_profile_link($post['username'], $post['uid']); }
|
Zeile 2299 | Zeile 2397 |
---|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
$perpage = $mybb->settings['postsperpage'];
| }
$perpage = $mybb->settings['postsperpage'];
|
Zeile 2350 | Zeile 2448 |
---|
$attachdate = my_date('relative', $attachment['dateuploaded']);
|
$attachdate = my_date('relative', $attachment['dateuploaded']);
|
$attachment['postsubject'] = htmlspecialchars_uni($attachment['postsubject']);
| $attachment['postsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['postsubject']));
|
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
$attachment['threadsubject'] = htmlspecialchars_uni($attachment['threadsubject']);
| $attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));
|
$attachment['filesize'] = get_friendly_size($attachment['filesize']);
$link = get_post_link($attachment['pid'], $attachment['tid']) . "#pid{$attachment['pid']}"; $thread_link = get_thread_link($attachment['tid']);
|
$attachment['filesize'] = get_friendly_size($attachment['filesize']);
$link = get_post_link($attachment['pid'], $attachment['tid']) . "#pid{$attachment['pid']}"; $thread_link = get_thread_link($attachment['tid']);
|
| $attachment['username'] = htmlspecialchars_uni($attachment['username']);
|
$profile_link = build_profile_link($attachment['username'], $attachment['uid']);
eval("\$attachments .= \"".$templates->get("modcp_modqueue_attachments_attachment")."\";");
| $profile_link = build_profile_link($attachment['username'], $attachment['uid']);
eval("\$attachments .= \"".$templates->get("modcp_modqueue_attachments_attachment")."\";");
|
Zeile 2427 | Zeile 2526 |
---|
$plugins->run_hooks("modcp_do_editprofile_start");
|
$plugins->run_hooks("modcp_do_editprofile_start");
|
if($mybb->get_input('away', 1) == 1 && $mybb->settings['allowaway'] != 0)
| if($mybb->get_input('away', MyBB::INPUT_INT) == 1 && $mybb->settings['allowaway'] != 0)
|
{ $awaydate = TIME_NOW; if(!empty($mybb->input['awayday'])) { // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year
|
{ $awaydate = TIME_NOW; if(!empty($mybb->input['awayday'])) { // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year
|
if(!$mybb->get_input('awaymonth', 1))
| if(!$mybb->get_input('awaymonth', MyBB::INPUT_INT))
|
{ $mybb->input['awaymonth'] = my_date('n', $awaydate); }
|
{ $mybb->input['awaymonth'] = my_date('n', $awaydate); }
|
if(!$mybb->get_input('awayyear', 1))
| if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))
|
{ $mybb->input['awayyear'] = my_date('Y', $awaydate); }
| { $mybb->input['awayyear'] = my_date('Y', $awaydate); }
|
Zeile 2484 | Zeile 2583 |
---|
// Set the data for the new user. $updated_user = array( "uid" => $user['uid'],
|
// Set the data for the new user. $updated_user = array( "uid" => $user['uid'],
|
"profile_fields" => $mybb->get_input('profile_fields', 2),
| "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY),
|
"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 2498 | Zeile 2595 |
---|
);
$updated_user['birthday'] = array(
|
);
$updated_user['birthday'] = array(
|
"day" => $mybb->get_input('birthday_day', 1), "month" => $mybb->get_input('birthday_month', 1), "year" => $mybb->get_input('birthday_year', 1)
| "day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT), "month" => $mybb->get_input('birthday_month', MyBB::INPUT_INT), "year" => $mybb->get_input('birthday_year', MyBB::INPUT_INT)
|
);
if(!empty($mybb->input['usertitle']))
| );
if(!empty($mybb->input['usertitle']))
|
Zeile 2519 | Zeile 2616 |
---|
// 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 2568 | Zeile 2665 |
---|
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'], 1);
| ${$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 2591 | Zeile 2688 |
---|
$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 2634 | Zeile 2730 |
---|
$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 2649 | Zeile 2745 |
---|
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'"); } log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);
|
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'"); } log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);
|
|
|
$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") { if($mybb->usergroup['caneditprofiles'] == 0)
|
if($mybb->input['action'] == "editprofile") { if($mybb->usergroup['caneditprofiles'] == 0)
|
{ error_no_permission(); }
add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");
$user = get_user($mybb->get_input('uid', 1));
| { error_no_permission(); }
add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");
$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));
|
if(!$user) { error($lang->error_nomember);
| if(!$user) { error($lang->error_nomember);
|
Zeile 2678 | Zeile 2774 |
---|
error_no_permission(); }
|
error_no_permission(); }
|
if($user['website'] == "" || $user['website'] == "http://")
| $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'] = "http://";
| $user['website'] = '';
|
}
if($user['icq'] != "0")
| }
if($user['icq'] != "0")
|
Zeile 2708 | Zeile 2820 |
---|
}
// 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 = $display_group['usertitle'];
| $defaulttitle = htmlspecialchars_uni($userperms['usertitle']);
|
} else { // Go for post count title if a group default isn't set $usertitles = $cache->read('usertitles');
|
} else { // Go for post count title if a group default isn't set $usertitles = $cache->read('usertitles');
|
|
|
foreach($usertitles as $title) {
|
foreach($usertitles as $title) {
|
if($title['posts'] <= $mybb->user['postnum'])
| if($title['posts'] <= $user['postnum'])
|
{ $defaulttitle = $title['title'];
|
{ $defaulttitle = $title['title'];
|
| break;
|
} } }
$user['usertitle'] = htmlspecialchars_uni($user['usertitle']);
|
} } }
$user['usertitle'] = htmlspecialchars_uni($user['usertitle']);
|
|
|
if(empty($user['usertitle'])) { $lang->current_custom_usertitle = '';
| if(empty($user['usertitle'])) { $lang->current_custom_usertitle = '';
|
Zeile 2785 | Zeile 2890 |
---|
$returndate = array(); $returndate[0] = $mybb->get_input('awayday'); $returndate[1] = $mybb->get_input('awaymonth');
|
$returndate = array(); $returndate[0] = $mybb->get_input('awayday'); $returndate[1] = $mybb->get_input('awaymonth');
|
$returndate[2] = $mybb->get_input('awayyear', 1);
| $returndate[2] = $mybb->get_input('awayyear', MyBB::INPUT_INT);
|
$user['awayreason'] = htmlspecialchars_uni($mybb->get_input('awayreason'));
|
$user['awayreason'] = htmlspecialchars_uni($mybb->get_input('awayreason'));
|
}
| }
|
else { $user['awayreason'] = htmlspecialchars_uni($user['awayreason']);
| else { $user['awayreason'] = htmlspecialchars_uni($user['awayreason']);
|
Zeile 2845 | Zeile 2950 |
---|
$requiredfields = ''; $customfields = '';
|
$requiredfields = ''; $customfields = '';
|
$mybb->input['profile_fields'] = $mybb->get_input('profile_fields', 2);
| $mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);
|
$pfcache = $cache->read('profilefields');
| $pfcache = $cache->read('profilefields');
|
Zeile 2853 | Zeile 2958 |
---|
{ foreach($pfcache as $profilefield) {
|
{ foreach($pfcache as $profilefield) {
|
| $userfield = $code = $select = $val = $options = $expoptions = $useropts = ''; $seloptions = array();
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
|
| $profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
|
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']); $thing = explode("\n", $profilefield['type'], "2"); $type = $thing[0]; if(isset($thing[1])) { $options = $thing[1];
|
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']); $thing = explode("\n", $profilefield['type'], "2"); $type = $thing[0]; if(isset($thing[1])) { $options = $thing[1];
|
} else { $options = '';
| |
} $field = "fid{$profilefield['fid']}";
|
} $field = "fid{$profilefield['fid']}";
|
$select = '';
| |
if($errors) { if(isset($mybb->input['profile_fields'][$field]))
|
if($errors) { if(isset($mybb->input['profile_fields'][$field]))
|
{
| {
|
$userfield = $mybb->input['profile_fields'][$field];
|
$userfield = $mybb->input['profile_fields'][$field];
|
} else { $userfield = '';
| |
} } else { $userfield = $user_fields[$field]; }
|
} } else { $userfield = $user_fields[$field]; }
|
$code = '';
| |
if($type == "multiselect") { if($errors)
| if($type == "multiselect") { if($errors)
|
Zeile 2909 | Zeile 3007 |
---|
$val = str_replace("\n", "\\n", $val);
$sel = "";
|
$val = str_replace("\n", "\\n", $val);
$sel = "";
|
if($val == $seloptions[$val])
| if(isset($seloptions[$val]) && $val == $seloptions[$val])
|
{ $sel = " selected=\"selected\""; }
| { $sel = " selected=\"selected\""; }
|
Zeile 2989 | Zeile 3087 |
---|
foreach($expoptions as $key => $val) { $checked = "";
|
foreach($expoptions as $key => $val) { $checked = "";
|
if($val == $seloptions[$val])
| if(isset($seloptions[$val]) && $val == $seloptions[$val])
|
{ $checked = " checked=\"checked\""; }
| { $checked = " checked=\"checked\""; }
|
Zeile 3024 | Zeile 3122 |
---|
eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";"); } $altbg = alt_trow();
|
eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";"); } $altbg = alt_trow();
|
$code = ""; $select = ""; $val = ""; $options = ""; $expoptions = ""; $useropts = ""; $seloptions = "";
| |
} } if($customfields)
| } } if($customfields)
|
Zeile 3038 | Zeile 3129 |
---|
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";"); }
|
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";"); }
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']); $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
|
$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']); $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
|
| $user['signature'] = htmlspecialchars_uni($user['signature']);
|
$codebuttons = build_mycode_inserter("signature");
// Do we mark the suspend signature box?
|
$codebuttons = build_mycode_inserter("signature");
// Do we mark the suspend signature box?
|
if($user['suspendsignature'] || ($mybb->get_input('suspendsignature', 1) && !empty($errors)))
| if($user['suspendsignature'] || ($mybb->get_input('suspendsignature', MyBB::INPUT_INT) && !empty($errors)))
|
{ $checked = 1; $checked_item = "checked=\"checked\"";
| { $checked = 1; $checked_item = "checked=\"checked\"";
|
Zeile 3056 | Zeile 3149 |
---|
}
// Do we mark the moderate posts box?
|
}
// Do we mark the moderate posts box?
|
if($user['moderateposts'] || ($mybb->get_input('moderateposting', 1) && !empty($errors)))
| if($user['moderateposts'] || ($mybb->get_input('moderateposting', MyBB::INPUT_INT) && !empty($errors)))
|
{ $modpost_check = 1; $modpost_checked = "checked=\"checked\"";
| { $modpost_check = 1; $modpost_checked = "checked=\"checked\"";
|
Zeile 3068 | Zeile 3161 |
---|
}
// Do we mark the suspend posts box?
|
}
// Do we mark the suspend posts box?
|
if($user['suspendposting'] || ($mybb->get_input('suspendposting', 1) && !empty($errors)))
| if($user['suspendposting'] || ($mybb->get_input('suspendposting', MyBB::INPUT_INT) && !empty($errors)))
|
{ $suspost_check = 1; $suspost_checked = "checked=\"checked\"";
| { $suspost_check = 1; $suspost_checked = "checked=\"checked\"";
|
Zeile 3113 | Zeile 3206 |
---|
$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'], 1);
| ${$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 3180 | Zeile 3274 |
---|
}
eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");
|
}
eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");
|
| $user['usernotes'] = htmlspecialchars_uni($user['usernotes']);
|
if(!isset($newtitle)) { $newtitle = '';
|
if(!isset($newtitle)) { $newtitle = '';
|
}
$plugins->run_hooks("modcp_editprofile_end");
| }
$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);
| eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";"); output_page($edituser);
|
Zeile 3197 | Zeile 3299 |
---|
if($mybb->usergroup['caneditprofiles'] == 0) { error_no_permission();
|
if($mybb->usergroup['caneditprofiles'] == 0) { error_no_permission();
|
}
| }
|
add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");
|
add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");
|
$perpage = $mybb->get_input('perpage', 1);
| $perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);
|
if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
| if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
|
Zeile 3210 | Zeile 3312 |
---|
if(isset($mybb->input['username'])) {
|
if(isset($mybb->input['username'])) {
|
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->get_input('username')))."%'";
| switch($db->type) { case 'mysql': case 'mysqli': $field = 'username'; break; default: $field = 'LOWER(username)'; break; } $where = " AND {$field} LIKE '%".my_strtolower($db->escape_string_like($mybb->get_input('username')))."%'";
|
}
// Sort order & direction
| }
// Sort order & direction
|
Zeile 3227 | Zeile 3339 |
---|
break; default: $sortby = "regdate";
|
break; default: $sortby = "regdate";
|
}
| }
|
$sortbysel = array('lastvisit' => '', 'postnum' => '', 'username' => '', 'regdate' => ''); $sortbysel[$mybb->get_input('sortby')] = " selected=\"selected\""; $order = $mybb->get_input('order');
| $sortbysel = array('lastvisit' => '', 'postnum' => '', 'username' => '', 'regdate' => ''); $sortbysel[$mybb->get_input('sortby')] = " selected=\"selected\""; $order = $mybb->get_input('order');
|
Zeile 3249 | Zeile 3361 |
---|
$pages = $user_count / $perpage; $pages = ceil($pages);
|
$pages = $user_count / $perpage; $pages = ceil($pages);
|
|
|
if($mybb->get_input('page') == "last") { $page = $pages;
| if($mybb->get_input('page') == "last") { $page = $pages;
|
Zeile 3260 | Zeile 3372 |
---|
$page = 1; } if($page)
|
$page = 1; } if($page)
|
{
| {
|
$start = ($page-1) * $perpage; } else
| $start = ($page-1) * $perpage; } else
|
Zeile 3271 | Zeile 3383 |
---|
$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)
|
{ $mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field));
| {
|
if(!empty($mybb->input[$field])) { $page_url .= "&{$field}=".$mybb->input[$field];
|
if(!empty($mybb->input[$field])) { $page_url .= "&{$field}=".$mybb->input[$field];
|
} }
| } }
|
$multipage = multipage($user_count, $perpage, $page, $page_url);
$usergroups_cache = $cache->read("usergroups");
|
$multipage = multipage($user_count, $perpage, $page, $page_url);
$usergroups_cache = $cache->read("usergroups");
|
|
|
$plugins->run_hooks("modcp_finduser_start");
// Fetch out results
| $plugins->run_hooks("modcp_finduser_start");
// Fetch out results
|
Zeile 3291 | Zeile 3402 |
---|
while($user = $db->fetch_array($query)) { $alt_row = alt_trow();
|
while($user = $db->fetch_array($query)) { $alt_row = alt_trow();
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']); $user['postnum'] = my_number_format($user['postnum']); $regdate = my_date('relative', $user['regdate']);
| $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']); $user['postnum'] = my_number_format($user['postnum']); $regdate = my_date('relative', $user['regdate']);
|
Zeile 3304 | Zeile 3416 |
---|
// We have had at least some active time, hide it instead $lastdate = $lang->lastvisit_hidden; }
|
// We have had at least some active time, hide it instead $lastdate = $lang->lastvisit_hidden; }
|
}
| }
|
else { $lastdate = my_date('relative', $user['lastvisit']); }
|
else { $lastdate = my_date('relative', $user['lastvisit']); }
|
$usergroup = $usergroups_cache[$user['usergroup']]['title'];
| $usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
|
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";"); }
// No results? if(!$users)
|
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";"); }
// No results? if(!$users)
|
{
| {
|
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";"); }
$plugins->run_hooks("modcp_finduser_end");
|
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";"); }
$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 3337 | Zeile 3450 |
---|
// Filter options $where_sql = '';
|
// Filter options $where_sql = '';
|
$mybb->input['filter'] = $mybb->get_input('filter', 2); $mybb->input['search'] = $mybb->get_input('search', 2);
| $mybb->input['filter'] = $mybb->get_input('filter', MyBB::INPUT_ARRAY); $mybb->input['search'] = $mybb->get_input('search', MyBB::INPUT_ARRAY);
|
if(!empty($mybb->input['filter']['username'])) { $search_user = get_user_by_username($mybb->input['filter']['username']);
| if(!empty($mybb->input['filter']['username'])) { $search_user = get_user_by_username($mybb->input['filter']['username']);
|
Zeile 3451 | Zeile 3564 |
---|
"; $query = $db->query($sql); $total_warnings = $db->fetch_field($query, 'count');
|
"; $query = $db->query($sql); $total_warnings = $db->fetch_field($query, 'count');
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
if($page <= 0) { $page = 1;
| if($page <= 0) { $page = 1;
|
Zeile 3462 | Zeile 3575 |
---|
$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 3497 | Zeile 3616 |
---|
while($row = $db->fetch_array($query)) { $trow = alt_trow();
|
while($row = $db->fetch_array($query)) { $trow = alt_trow();
|
| $row['username'] = htmlspecialchars_uni($row['username']);
|
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']); $username_link = build_profile_link($username, $row['uid']);
|
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']); $username_link = build_profile_link($username, $row['uid']);
|
| $row['mod_username'] = htmlspecialchars_uni($row['mod_username']);
|
$mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']); $mod_username_link = build_profile_link($mod_username, $row['mod_uid']);
|
$mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']); $mod_username_link = build_profile_link($mod_username, $row['mod_uid']);
|
$issued_date = my_date($mybb->settings['dateformat'], $row['dateline']).' '.my_date($mybb->settings['timeformat'], $row['dateline']);
| $issued_date = my_date('normal', $row['dateline']);
|
$revoked_text = ''; if($row['daterevoked'] > 0) {
| $revoked_text = ''; if($row['daterevoked'] > 0) {
|
Zeile 3510 | Zeile 3631 |
---|
} if($row['expires'] > 0) {
|
} if($row['expires'] > 0) {
|
$expire_date = my_date('relative', $row['expires'], '', 2);
| $expire_date = nice_time($row['expires']-TIME_NOW);
|
} else {
| } else {
|
Zeile 3536 | Zeile 3657 |
---|
}
$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); }
if($mybb->input['action'] == "ipsearch")
|
eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs); }
if($mybb->input['action'] == "ipsearch")
|
{
| {
|
if($mybb->usergroup['canuseipsearch'] == 0) { error_no_permission();
| if($mybb->usergroup['canuseipsearch'] == 0) { error_no_permission();
|
Zeile 3556 | Zeile 3681 |
---|
if(!is_array($groupscache)) { $groupscache = $cache->read("usergroups");
|
if(!is_array($groupscache)) { $groupscache = $cache->read("usergroups");
|
}
$ipaddressvalue = htmlspecialchars_uni($mybb->input['ipaddress']);
| }
$ipaddressvalue = htmlspecialchars_uni($mybb->input['ipaddress']);
|
$ip_range = fetch_ip_range($mybb->input['ipaddress']);
|
$ip_range = fetch_ip_range($mybb->input['ipaddress']);
|
|
|
$post_results = $user_results = 0;
// Searching post IP addresses if(isset($mybb->input['search_posts']))
|
$post_results = $user_results = 0;
// Searching post IP addresses if(isset($mybb->input['search_posts']))
|
{ if($ip_range) { if(!is_array($ip_range)) { $post_ip_sql = "ipaddress=".$db->escape_binary($ip_range); } else { $post_ip_sql = "ipaddress BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]); }
| { if($ip_range) { if(!is_array($ip_range)) { $post_ip_sql = "p.ipaddress=".$db->escape_binary($ip_range); } else { $post_ip_sql = "p.ipaddress BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]); }
|
}
|
}
|
|
|
$plugins->run_hooks("modcp_ipsearch_posts_start");
|
$plugins->run_hooks("modcp_ipsearch_posts_start");
|
|
|
if($post_ip_sql) {
|
if($post_ip_sql) {
|
$query = $db->simple_select('posts', 'COUNT(pid) AS count', "$post_ip_sql AND visible >= -1");
| $where_sql = '';
$unviewable_forums = get_unviewable_forums(true);
if($unviewable_forums) { $where_sql .= " AND p.fid NOT IN ({$unviewable_forums})"; }
if($inactiveforums) { $where_sql .= " AND p.fid NOT IN ({$inactiveforums})"; }
// Check group permissions if we can't view threads not started by us $onlyusfids = array(); $group_permissions = forum_permissions(); foreach($group_permissions as $fid => $forumpermissions) { if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $fid; } }
if(!empty($onlyusfids)) { $where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))"; }
// Moderators can view unapproved/deleted posts if($mybb->usergroup['issupermod'] != 1) { $unapprove_forums = array(); $deleted_forums = array(); $visible_sql = " AND (p.visible = 1 AND t.visible = 1)"; $query = $db->simple_select("moderators", "fid, canviewunapprove, canviewdeleted", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')"); while($moderator = $db->fetch_array($query)) { if($moderator['canviewunapprove'] == 1) { $unapprove_forums[] = $moderator['fid']; }
if($moderator['canviewdeleted'] == 1) { $deleted_forums[] = $moderator['fid']; } }
if(!empty($unapprove_forums)) { $visible_sql .= " OR (p.visible = 0 AND p.fid IN(".implode(',', $unapprove_forums).")) OR (t.visible = 0 AND t.fid IN(".implode(',', $unapprove_forums)."))"; } if(!empty($deleted_forums)) { $visible_sql .= " OR (p.visible = -1 AND p.fid IN(".implode(',', $deleted_forums).")) OR (t.visible = -1 AND t.fid IN(".implode(',', $deleted_forums)."))"; } } else { // Super moderators (and admins) $visible_sql = " AND p.visible >= -1"; }
$query = $db->query(" SELECT COUNT(p.pid) AS count FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid) WHERE {$post_ip_sql}{$where_sql}{$visible_sql} ");
|
$post_results = $db->fetch_field($query, "count"); } }
| $post_results = $db->fetch_field($query, "count"); } }
|
Zeile 3606 | Zeile 3801 |
---|
$plugins->run_hooks("modcp_ipsearch_users_start");
if($user_ip_sql)
|
$plugins->run_hooks("modcp_ipsearch_users_start");
if($user_ip_sql)
|
{ $query = $db->query(" SELECT COUNT(uid) AS count FROM ".TABLE_PREFIX."users WHERE {$user_ip_sql} ");
| { $query = $db->simple_select('users', 'COUNT(uid) AS count', $user_ip_sql);
|
$user_results = $db->fetch_field($query, "count"); } }
|
$user_results = $db->fetch_field($query, "count"); } }
|
|
|
$total_results = $post_results+$user_results;
if(!$total_results)
|
$total_results = $post_results+$user_results;
if(!$total_results)
|
{
| {
|
$total_results = 1; }
// Now we have the result counts, paginate
|
$total_results = 1; }
// Now we have the result counts, paginate
|
$perpage = $mybb->get_input('perpage', 1);
| $perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);
|
if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
| if(!$perpage || $perpage <= 0) { $perpage = $mybb->settings['threadsperpage'];
|
Zeile 3634 | Zeile 3825 |
---|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
// Figure out if we need to display multiple pages. if($mybb->get_input('page') != "last") {
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
$pages = $total_results / $perpage;
| }
$pages = $total_results / $perpage;
|
Zeile 3643 | Zeile 3834 |
---|
if($mybb->get_input('page') == "last") { $page = $pages;
|
if($mybb->get_input('page') == "last") { $page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0) { $page = 1;
| if($page > $pages || $page <= 0) { $page = 1;
|
Zeile 3658 | Zeile 3849 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
$page_url = "modcp.php?action=ipsearch&perpage={$perpage}"; foreach(array('ipaddress', 'search_users', 'search_posts') as $input) { if(!empty($mybb->input[$input])) {
|
$page_url = "modcp.php?action=ipsearch&perpage={$perpage}"; foreach(array('ipaddress', 'search_users', 'search_posts') as $input) { if(!empty($mybb->input[$input])) {
|
$page_url .= "&{$input}=".htmlspecialchars_uni($mybb->input[$input]);
| $page_url .= "&{$input}=".urlencode($mybb->input[$input]);
|
} } $multipage = multipage($total_results, $perpage, $page, $page_url);
| } } $multipage = multipage($total_results, $perpage, $page, $page_url);
|
Zeile 3674 | Zeile 3865 |
---|
$results = ''; if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results) {
|
$results = ''; if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results) {
|
$query = $db->query(" SELECT username, uid, regip, lastip FROM ".TABLE_PREFIX."users WHERE {$user_ip_sql} ORDER BY regdate DESC LIMIT {$start}, {$perpage} ");
| $query = $db->simple_select('users', 'username, uid, regip, lastip', $user_ip_sql, array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit_start' => $start, 'limit' => $perpage));
|
while($ipaddress = $db->fetch_array($query)) { $result = false;
|
while($ipaddress = $db->fetch_array($query)) { $result = false;
|
| $ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']);
|
$profile_link = build_profile_link($ipaddress['username'], $ipaddress['uid']); $trow = alt_trow(); $ip = false; if(is_array($ip_range)) {
|
$profile_link = build_profile_link($ipaddress['username'], $ipaddress['uid']); $trow = alt_trow(); $ip = false; if(is_array($ip_range)) {
|
if(strcmp($ip_range[0], $ipaddress['regip']) >= 0 && strcmp($ip_range[1], $ipaddress['regip']) <= 0)
| if(strcmp($ip_range[0], $ipaddress['regip']) <= 0 && strcmp($ip_range[1], $ipaddress['regip']) >= 0)
|
{ eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";"); $ip = my_inet_ntop($db->unescape_binary($ipaddress['regip'])); }
|
{ eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";"); $ip = my_inet_ntop($db->unescape_binary($ipaddress['regip'])); }
|
elseif(strcmp($ip_range[0], $ipaddress['lastip']) >= 0 && strcmp($ip_range[1], $ipaddress['lastip']) <= 0)
| elseif(strcmp($ip_range[0], $ipaddress['lastip']) <= 0 && strcmp($ip_range[1], $ipaddress['lastip']) >= 0)
|
{ eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";"); $ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
| { eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";"); $ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
|
Zeile 3733 | Zeile 3921 |
---|
if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0))) { $ipaddresses = $tids = $uids = array();
|
if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0))) { $ipaddresses = $tids = $uids = array();
|
|
|
$query = $db->query("
|
$query = $db->query("
|
SELECT username AS postusername, uid, subject, pid, tid, ipaddress FROM ".TABLE_PREFIX."posts WHERE {$post_ip_sql} AND visible >= -1 ORDER BY dateline DESC
| SELECT p.username AS postusername, p.uid, p.subject, p.pid, p.tid, p.ipaddress 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
|
LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query))
| LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query))
|
Zeile 3766 | Zeile 3956 |
---|
foreach($ipaddresses as $ipaddress) { $ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));
|
foreach($ipaddresses as $ipaddress) { $ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));
|
if(!$ipaddress['username']) $ipaddress['username'] = $ipaddress['postusername']; // Guest username support
| if(!$ipaddress['username']) { $ipaddress['username'] = $ipaddress['postusername']; // Guest username support } $ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']);
|
$trow = alt_trow(); if(!$ipaddress['subject']) {
| $trow = alt_trow(); if(!$ipaddress['subject']) {
|
Zeile 3774 | Zeile 3968 |
---|
}
$ipaddress['postlink'] = get_post_link($ipaddress['pid'], $ipaddress['tid']);
|
}
$ipaddress['postlink'] = get_post_link($ipaddress['pid'], $ipaddress['tid']);
|
$ipaddress['subject'] = htmlspecialchars_uni($ipaddress['subject']);
| $ipaddress['subject'] = htmlspecialchars_uni($parser->parse_badwords($ipaddress['subject']));
|
$ipaddress['profilelink'] = build_profile_link($ipaddress['username'], $ipaddress['uid']);
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_post")."\";"); eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";"); } }
|
$ipaddress['profilelink'] = build_profile_link($ipaddress['username'], $ipaddress['uid']);
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_post")."\";"); eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";"); } }
|
}
| }
|
if(!$results) { eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");
|
if(!$results) { eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");
|
}
| }
|
if($ipaddressvalue) { $lang->ipsearch_results = $lang->sprintf($lang->ipsearch_results, $ipaddressvalue);
| if($ipaddressvalue) { $lang->ipsearch_results = $lang->sprintf($lang->ipsearch_results, $ipaddressvalue);
|
Zeile 3820 | Zeile 4014 |
---|
$postsearchselect = "checked=\"checked\""; } if(isset($mybb->input['search_users']))
|
$postsearchselect = "checked=\"checked\""; } if(isset($mybb->input['search_users']))
|
{
| {
|
$usersearchselect = "checked=\"checked\""; }
|
$usersearchselect = "checked=\"checked\""; }
|
|
|
$plugins->run_hooks("modcp_ipsearch_end");
eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";"); output_page($ipsearch);
|
$plugins->run_hooks("modcp_ipsearch_end");
eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";"); output_page($ipsearch);
|
}
| }
|
if($mybb->input['action'] == "iplookup") { if($mybb->usergroup['canuseipsearch'] == 0)
|
if($mybb->input['action'] == "iplookup") { if($mybb->usergroup['canuseipsearch'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$mybb->input['ipaddress'] = $mybb->get_input('ipaddress'); $lang->ipaddress_misc_info = $lang->sprintf($lang->ipaddress_misc_info, htmlspecialchars_uni($mybb->input['ipaddress'])); $ipaddress_location = $lang->na;
| $mybb->input['ipaddress'] = $mybb->get_input('ipaddress'); $lang->ipaddress_misc_info = $lang->sprintf($lang->ipaddress_misc_info, htmlspecialchars_uni($mybb->input['ipaddress'])); $ipaddress_location = $lang->na;
|
Zeile 3865 | Zeile 4059 |
---|
{ $ipaddress_host_name = $lang->na; }
|
{ $ipaddress_host_name = $lang->na; }
|
}
$plugins->run_hooks("modcp_iplookup_end");
| }
$plugins->run_hooks("modcp_iplookup_end");
|
eval("\$iplookup = \"".$templates->get('modcp_ipsearch_misc_info', 1, 0)."\";"); echo($iplookup); exit;
| eval("\$iplookup = \"".$templates->get('modcp_ipsearch_misc_info', 1, 0)."\";"); echo($iplookup); exit;
|
Zeile 3884 | Zeile 4078 |
---|
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
if(!$mybb->settings['threadsperpage'])
|
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
if(!$mybb->settings['threadsperpage'])
|
{
| {
|
$mybb->settings['threadsperpage'] = 20; }
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage']; if($mybb->get_input('page') != "last")
|
$mybb->settings['threadsperpage'] = 20; }
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['threadsperpage']; if($mybb->get_input('page') != "last")
|
{ $page = $mybb->get_input('page', 1);
| { $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
}
$query = $db->simple_select("banned", "COUNT(uid) AS count");
| }
$query = $db->simple_select("banned", "COUNT(uid) AS count");
|
Zeile 3908 | Zeile 4102 |
---|
}
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;
| else { $start = 0;
|
Zeile 3940 | Zeile 4134 |
---|
$bannedusers = ''; while($banned = $db->fetch_array($query)) {
|
$bannedusers = ''; while($banned = $db->fetch_array($query)) {
|
| $banned['username'] = htmlspecialchars_uni($banned['username']);
|
$profile_link = build_profile_link($banned['username'], $banned['uid']);
// Only show the edit & lift links if current user created ban, or is super mod/admin
| $profile_link = build_profile_link($banned['username'], $banned['uid']);
// Only show the edit & lift links if current user created ban, or is super mod/admin
|
Zeile 3947 | Zeile 4142 |
---|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) { eval("\$edit_link = \"".$templates->get("modcp_banning_edit")."\";");
|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) { eval("\$edit_link = \"".$templates->get("modcp_banning_edit")."\";");
|
}
$admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);
| }
$admin_profile = build_profile_link(htmlspecialchars_uni($banned['adminuser']), $banned['admin']);
|
$trow = alt_trow();
if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
|
$trow = alt_trow();
if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
|
$banned['reason'] = my_wordwrap($banned['reason']);
| |
} else {
| } else {
|
Zeile 3975 | Zeile 4169 |
---|
$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
|
$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
|
| $banned_class = ''; $ban_remaining = "{$timeremaining} {$lang->ban_remaining}";
if($remaining <= 0) { $banned_class = "imminent_banned"; $ban_remaining = $lang->ban_ending_imminently; }
|
if($remaining < 3600) {
|
if($remaining < 3600) {
|
$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
| $banned_class = "high_banned";
|
} else if($remaining < 86400) {
|
} else if($remaining < 86400) {
|
$timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";
| $banned_class = "moderate_banned";
|
} else if($remaining < 604800)
|
} else if($remaining < 604800)
|
{ $timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>"; }
| { $banned_class = "low_banned"; }
|
else {
|
else {
|
$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
| $banned_class = "normal_banned";
|
}
|
}
|
| eval('$timeremaining = "'.$templates->get('modcp_banning_remaining').'";');
|
}
eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");
| }
eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");
|
Zeile 4017 | Zeile 4221 |
---|
error_no_permission(); }
|
error_no_permission(); }
|
$query = $db->simple_select("banned", "*", "uid='".$mybb->get_input('uid', 1)."'");
| $query = $db->simple_select("banned", "*", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'");
|
$ban = $db->fetch_array($query);
if(!$ban)
| $ban = $db->fetch_array($query);
if(!$ban)
|
Zeile 4044 | Zeile 4248 |
---|
$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(); 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 4064 | Zeile 4267 |
---|
}
// Editing an existing ban
|
}
// Editing an existing ban
|
if($mybb->get_input('uid', 1))
| if($mybb->get_input('uid', MyBB::INPUT_INT))
|
{ // Get the users info from their uid $query = $db->query("
| { // Get the users info from their uid $query = $db->query("
|
Zeile 4087 | Zeile 4290 |
---|
error_no_permission(); } }
|
error_no_permission(); } }
|
| $errors = array();
|
// Creating a new ban if(!$existing_ban)
| // Creating a new ban if(!$existing_ban)
|
Zeile 4123 | Zeile 4328 |
---|
// Check banned group $usergroups_cache = $cache->read('usergroups');
|
// Check banned group $usergroups_cache = $cache->read('usergroups');
|
$usergroup = $usergroups_cache[$mybb->get_input('usergroup', 1)]; $query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".$mybb->get_input('usergroup', 1)."'");
| $usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];
|
if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup'])) {
| if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup'])) {
|
Zeile 4165 | Zeile 4369 |
---|
if($existing_ban) { $update_array = array(
|
if($existing_ban) { $update_array = array(
|
'gid' => $mybb->get_input('usergroup', 1), 'admin' => (int)$user['uid'],
| 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
|
'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->get_input('liftafter')), 'lifted' => $db->escape_string($lifted),
| 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->get_input('liftafter')), 'lifted' => $db->escape_string($lifted),
|
Zeile 4179 | Zeile 4382 |
---|
{ $insert_array = array( 'uid' => $user['uid'],
|
{ $insert_array = array( 'uid' => $user['uid'],
|
'gid' => $mybb->get_input('usergroup', 1),
| 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
|
'oldgroup' => (int)$user['usergroup'], 'oldadditionalgroups' => (string)$user['additionalgroups'], 'olddisplaygroup' => (int)$user['displaygroup'],
| 'oldgroup' => (int)$user['usergroup'], 'oldadditionalgroups' => (string)$user['additionalgroups'], 'olddisplaygroup' => (int)$user['displaygroup'],
|
Zeile 4195 | Zeile 4398 |
---|
// Move the user to the banned group $update_array = array(
|
// Move the user to the banned group $update_array = array(
|
'usergroup' => $mybb->get_input('usergroup', 1),
| 'usergroup' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
|
'displaygroup' => 0, 'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
'displaygroup' => 0, '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)
|
{
| {
|
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);
|
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);
|
} else {
| } else {
|
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user); }
|
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user); }
|
|
|
$plugins->run_hooks("modcp_do_banuser_end");
if($existing_ban)
|
$plugins->run_hooks("modcp_do_banuser_end");
if($existing_ban)
|
{
| {
|
redirect("modcp.php?action=banning", $lang->redirect_banuser_updated); } else
| redirect("modcp.php?action=banning", $lang->redirect_banuser_updated); } else
|
Zeile 4236 | Zeile 4437 |
---|
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
if($mybb->usergroup['canbanusers'] == 0)
|
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
if($mybb->usergroup['canbanusers'] == 0)
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
}
| }
|
|
|
$mybb->input['uid'] = $mybb->get_input('uid', 1);
| $mybb->input['uid'] = $mybb->get_input('uid', MyBB::INPUT_INT);
|
if($mybb->input['uid'])
|
if($mybb->input['uid'])
|
{ add_breadcrumb($lang->mcp_nav_ban_user); } else
| |
{ add_breadcrumb($lang->mcp_nav_editing_ban);
|
{ add_breadcrumb($lang->mcp_nav_editing_ban);
|
| } else { add_breadcrumb($lang->mcp_nav_ban_user);
|
}
$plugins->run_hooks("modcp_banuser_start");
| }
$plugins->run_hooks("modcp_banuser_start");
|
Zeile 4257 | Zeile 4458 |
---|
// If incoming user ID, we are editing a ban if($mybb->input['uid'])
|
// If incoming user ID, we are editing a ban if($mybb->input['uid'])
|
{ $query = $db->query("
| { $query = $db->query("
|
SELECT b.*, u.username, u.uid FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
| SELECT b.*, u.username, u.uid FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
|
Zeile 4267 | Zeile 4468 |
---|
$banned = $db->fetch_array($query); if($banned['username']) {
|
$banned = $db->fetch_array($query); if($banned['username']) {
|
$username = htmlspecialchars_uni($banned['username']);
| $username = $banned['username'] = htmlspecialchars_uni($banned['username']);
|
$banreason = htmlspecialchars_uni($banned['reason']); $uid = $mybb->input['uid']; $user = get_user($banned['uid']); $lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
|
$banreason = htmlspecialchars_uni($banned['reason']); $uid = $mybb->input['uid']; $user = get_user($banned['uid']); $lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
|
}
| } }
// Permission to edit this ban? if($banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission();
|
}
// New ban! if(!$banuser_username) { if($mybb->input['uid'])
|
}
// New ban! if(!$banuser_username) { if($mybb->input['uid'])
|
{
| {
|
$user = get_user($mybb->input['uid']);
|
$user = get_user($mybb->input['uid']);
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$username = $user['username']; } else
| $username = $user['username']; } else
|
Zeile 4293 | Zeile 4501 |
---|
// Coming back to this page from an error? if($errors)
|
// Coming back to this page from an error? if($errors)
|
{
| {
|
$errors = inline_error($errors); $banned = array( "bantime" => $mybb->get_input('liftafter'), "reason" => $mybb->get_input('reason'),
|
$errors = inline_error($errors); $banned = array( "bantime" => $mybb->get_input('liftafter'), "reason" => $mybb->get_input('reason'),
|
"gid" => $mybb->get_input('gid', 1)
| "gid" => $mybb->get_input('gid', MyBB::INPUT_INT)
|
); $banreason = htmlspecialchars_uni($mybb->get_input('banreason')); }
| ); $banreason = htmlspecialchars_uni($mybb->get_input('banreason')); }
|
Zeile 4314 | Zeile 4522 |
---|
}
$thattime = '';
|
}
$thattime = '';
|
if($time != '---' && !isset($banned['dateline']))
| if($time != '---')
|
{
|
{
|
$thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $banned['dateline']));
| $dateline = TIME_NOW; if(isset($banned['dateline'])) { $dateline = $banned['dateline']; }
$thatime = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time, $dateline));
|
$thattime = " ({$thatime})"; }
| $thattime = " ({$thatime})"; }
|
Zeile 4324 | Zeile 4538 |
---|
}
$bangroup_option = $bangroups = '';
|
}
$bangroup_option = $bangroups = '';
|
$numgroups = 0;
| $numgroups = $banned_group = 0;
|
$groupscache = $cache->read("usergroups");
foreach($groupscache as $key => $group)
| $groupscache = $cache->read("usergroups");
foreach($groupscache as $key => $group)
|
Zeile 4339 | Zeile 4553 |
---|
$group['title'] = htmlspecialchars_uni($group['title']); eval("\$bangroup_option .= \"".$templates->get("modcp_banuser_bangroups_group")."\";");
|
$group['title'] = htmlspecialchars_uni($group['title']); eval("\$bangroup_option .= \"".$templates->get("modcp_banuser_bangroups_group")."\";");
|
| $banned_group = $group['gid'];
|
++$numgroups; } }
|
++$numgroups; } }
|
if($numgroups > 1)
| if($numgroups == 0) { error($lang->no_banned_group); } elseif($numgroups > 1)
|
{ eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups")."\";"); }
| { eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups")."\";"); }
|
Zeile 4352 | Zeile 4571 |
---|
eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups_hidden")."\";"); }
|
eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups_hidden")."\";"); }
|
if(!empty($user['uid']))
| if(!empty($banned['uid']))
|
{ eval("\$lift_link = \"".$templates->get("modcp_banuser_lift")."\";");
|
{ eval("\$lift_link = \"".$templates->get("modcp_banuser_lift")."\";");
|
$uid = $user['uid'];
| $uid = $banned['uid'];
|
} else {
| } else {
|
Zeile 4426 | Zeile 4645 |
---|
"); $attachment = $db->fetch_array($query); $attachment['date'] = my_date('relative', $attachment['dateuploaded']);
|
"); $attachment = $db->fetch_array($query); $attachment['date'] = my_date('relative', $attachment['dateuploaded']);
|
| $attachment['username'] = htmlspecialchars_uni($attachment['username']);
|
$attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']); $attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']); $unapproved_attachments = my_number_format($unapproved_attachments);
eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
|
$attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']); $attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']); $unapproved_attachments = my_number_format($unapproved_attachments);
eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
|
}
| }
|
else { eval("\$latest_attachment = \"".$templates->get("modcp_awaitingmoderation_none")."\";");
| else { eval("\$latest_attachment = \"".$templates->get("modcp_awaitingmoderation_none")."\";");
|
Zeile 4463 | Zeile 4683 |
---|
"); $post = $db->fetch_array($query); $post['date'] = my_date('relative', $post['dateline']);
|
"); $post = $db->fetch_array($query); $post['date'] = my_date('relative', $post['dateline']);
|
| $post['username'] = htmlspecialchars_uni($post['username']);
|
$post['profilelink'] = build_profile_link($post['username'], $post['uid']); $post['link'] = get_post_link($post['pid'], $post['tid']); $post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']);
| $post['profilelink'] = build_profile_link($post['username'], $post['uid']); $post['link'] = get_post_link($post['pid'], $post['tid']); $post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']);
|
Zeile 4494 | Zeile 4715 |
---|
$query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible='0' {$flist_queue_threads}", array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => 1)); $thread = $db->fetch_array($query); $thread['date'] = my_date('relative', $thread['dateline']);
|
$query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible='0' {$flist_queue_threads}", array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => 1)); $thread = $db->fetch_array($query); $thread['date'] = my_date('relative', $thread['dateline']);
|
| $thread['username'] = htmlspecialchars_uni($thread['username']);
|
$thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); $thread['link'] = get_thread_link($thread['tid']); $thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']);
| $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); $thread['link'] = get_thread_link($thread['tid']); $thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']);
|
Zeile 4527 | Zeile 4749 |
---|
$where = ''; if($tflist_modlog) {
|
$where = ''; if($tflist_modlog) {
|
$where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (!l.fid)";
| $where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (l.fid <> 0)";
|
}
$query = $db->query("
| }
$query = $db->query("
|
Zeile 4544 | Zeile 4766 |
---|
$modlogresults = ''; while($logitem = $db->fetch_array($query))
|
$modlogresults = ''; while($logitem = $db->fetch_array($query))
|
{
| {
|
$information = ''; $logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date('relative', $logitem['dateline']); $trow = alt_trow();
|
$information = ''; $logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date('relative', $logitem['dateline']); $trow = alt_trow();
|
| $logitem['username'] = htmlspecialchars_uni($logitem['username']);
|
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']); $logitem['profilelink'] = build_profile_link($username, $logitem['uid']); $logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));
if($logitem['tsubject']) {
|
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']); $logitem['profilelink'] = build_profile_link($username, $logitem['uid']); $logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));
if($logitem['tsubject']) {
|
$logitem['tsubject'] = htmlspecialchars_uni($logitem['tsubject']);
| $logitem['tsubject'] = htmlspecialchars_uni($parser->parse_badwords($logitem['tsubject']));
|
$logitem['thread'] = get_thread_link($logitem['tid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";");
|
$logitem['thread'] = get_thread_link($logitem['tid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";");
|
}
| }
|
if($logitem['fname']) { $logitem['forum'] = get_forum_link($logitem['fid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_forum")."\";"); } if($logitem['psubject'])
|
if($logitem['fname']) { $logitem['forum'] = get_forum_link($logitem['fid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_forum")."\";"); } if($logitem['psubject'])
|
{ $logitem['psubject'] = htmlspecialchars_uni($logitem['psubject']);
| { $logitem['psubject'] = htmlspecialchars_uni($parser->parse_badwords($logitem['psubject']));
|
$logitem['post'] = get_post_link($logitem['pid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_post")."\";"); }
| $logitem['post'] = get_post_link($logitem['pid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_post")."\";"); }
|
Zeile 4578 | Zeile 4801 |
---|
if($data['uid']) { $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
|
if($data['uid']) { $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
|
}
| }
|
if($data['aid']) {
|
if($data['aid']) {
|
$data['subject'] = htmlspecialchars_uni($data['subject']);
| $data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject']));
|
$data['announcement'] = get_announcement_link($data['aid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";"); } }
|
$data['announcement'] = get_announcement_link($data['aid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";"); } }
|
| $plugins->run_hooks("modcp_modlogs_result");
|
eval("\$modlogresults .= \"".$templates->get("modcp_modlogs_result")."\";"); }
| eval("\$modlogresults .= \"".$templates->get("modcp_modlogs_result")."\";"); }
|
Zeile 4599 | Zeile 4824 |
---|
}
$query = $db->query("
|
}
$query = $db->query("
|
SELECT b.*, a.username AS adminuser, u.username, (b.lifted-".TIME_NOW.") AS remaining
| SELECT b.*, a.username AS adminuser, u.username
|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users a ON (b.admin=a.uid) WHERE b.bantime != '---' AND b.bantime != 'perm'
|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users a ON (b.admin=a.uid) WHERE b.bantime != '---' AND b.bantime != 'perm'
|
ORDER BY remaining ASC
| ORDER BY lifted ASC
|
LIMIT 5 ");
|
LIMIT 5 ");
|
| $banned_cache = array(); while($banned = $db->fetch_array($query)) { $banned['remaining'] = $banned['lifted']-TIME_NOW; $banned_cache[$banned['remaining'].$banned['uid']] = $banned;
unset($banned); }
|
// Get the banned users $bannedusers = '';
|
// Get the banned users $bannedusers = '';
|
while($banned = $db->fetch_array($query))
| foreach($banned_cache as $banned)
|
{
|
{
|
| $banned['username'] = htmlspecialchars_uni($banned['username']);
|
$profile_link = build_profile_link($banned['username'], $banned['uid']);
// Only show the edit & lift links if current user created ban, or is super mod/admin
| $profile_link = build_profile_link($banned['username'], $banned['uid']);
// Only show the edit & lift links if current user created ban, or is super mod/admin
|
Zeile 4619 | Zeile 4854 |
---|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) { eval("\$edit_link = \"".$templates->get("modcp_banning_edit")."\";");
|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) { eval("\$edit_link = \"".$templates->get("modcp_banning_edit")."\";");
|
}
$admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);
| }
$admin_profile = build_profile_link(htmlspecialchars_uni($banned['adminuser']), $banned['admin']);
|
$trow = alt_trow();
if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
|
$trow = alt_trow();
if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
|
$banned['reason'] = my_wordwrap($banned['reason']); }
| }
|
else { $banned['reason'] = $lang->na;
|
else { $banned['reason'] = $lang->na;
|
}
if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
| }
if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
|
{ $banlength = $lang->permanent; $timeremaining = $lang->na;
| { $banlength = $lang->permanent; $timeremaining = $lang->na;
|
Zeile 4646 | Zeile 4880 |
---|
$remaining = $banned['remaining'];
$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
|
$remaining = $banned['remaining'];
$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
|
| $banned_class = ''; $ban_remaining = "{$timeremaining} {$lang->ban_remaining}";
|
if($remaining <= 0)
|
if($remaining <= 0)
|
{ $timeremaining = "<span style=\"color: red;\">({$lang->ban_ending_imminently})</span>"; }
| { $banned_class = "imminent_banned"; $ban_remaining = $lang->ban_ending_imminently; }
|
else if($remaining < 3600) {
|
else if($remaining < 3600) {
|
$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>"; } else if($remaining < 86400) { $timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";
| $banned_class = "high_banned"; } else if($remaining < 86400) { $banned_class = "moderate_banned";
|
} else if($remaining < 604800)
|
} else if($remaining < 604800)
|
{ $timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>"; }
| { $banned_class = "low_banned"; }
|
else {
|
else {
|
$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
| $banned_class = "normal_banned";
|
}
|
}
|
| eval('$timeremaining = "'.$templates->get('modcp_banning_remaining').'";');
|
}
eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");
| }
eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");
|