Vergleich modcp.php - 1.6.0 - 1.6.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: modcp.php 5120 2010-07-26 20:10:05Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'modcp.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'modcp.php');


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport";
$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";
$templatelist .= ",modcp_banning_multipage,modcp_banning_nobanned,modcp_banning_auser,modcp_banning_error";
$templatelist .= ",modcp_banning_edit,modcp_banning_banned_user,modcp_nav,modcp_modlogs_noresults,modcp";
$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements";
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields";
$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs";
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature_info,modcp_editprofile_signature_options,modcp_editprofile_signature";


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit";
$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread";
$templatelist .= ",modcp_banning_multipage,modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty";
$templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp,modcp_modqueue_posts,modcp_modqueue_attachments_attachment,modcp_modqueue_attachments_empty,modcp_modqueue_attachments,modcp_editprofile_suspensions_info";
$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements,modcp_editprofile_select_option,modcp_editprofile_select,modcp_finduser_noresults";
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info";
$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned";
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,modcp_announcements_forum_nomod,modcp_announcements_announcement,multipage_prevpage";
$templatelist .= ",multipage_start,multipage_page_current,multipage_page,multipage_end,multipage_nextpage,multipage";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_user.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_user.php";

Zeile 39Zeile 40
if($mybb->user['uid'] == 0 || $mybb->usergroup['canmodcp'] != 1)
{
error_no_permission();

if($mybb->user['uid'] == 0 || $mybb->usergroup['canmodcp'] != 1)
{
error_no_permission();

 
}

if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;
}

if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

}

$errors = '';

}

$errors = '';

Zeile 46Zeile 57
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{

$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{

	$query = $db->simple_select("moderators", "*", "id='{$mybb->user['uid']}' AND isgroup = '0'");

	$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");

	while($forum = $db->fetch_array($query))
{
$flist .= ",'{$forum['fid']}'";

	while($forum = $db->fetch_array($query))
{
$flist .= ",'{$forum['fid']}'";

		



		$children = get_child_list($forum['fid']);
if(!empty($children))
{

		$children = get_child_list($forum['fid']);
if(!empty($children))
{

Zeile 67Zeile 78
else
{
$flist = $tflist = '';

else
{
$flist = $tflist = '';

 
}

// Retrieve a list of unviewable forums
$unviewableforums = get_unviewable_forums();

if($unviewableforums && !is_super_admin($mybb->user['uid']))
{
$flist .= " AND fid NOT IN ({$unviewableforums})";
$tflist .= " AND t.fid NOT IN ({$unviewableforums})";

$unviewableforums = str_replace("'", '', $unviewableforums);
$unviewableforums = explode(',', $unviewableforums);
}
else
{
$unviewableforums = array();

}

// Fetch the Mod CP menu

}

// Fetch the Mod CP menu

Zeile 87Zeile 114
		error($lang->error_noselected_reports);
}


		error($lang->error_noselected_reports);
}


	$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode($mybb->input['reports'], "','");
$rids = "'0','{$rids}'";








	$sql = '1=1';
if(!$mybb->input['allbox'])
{
$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode($mybb->input['reports'], "','");
$rids = "'0','{$rids}'";

$sql = "rid IN ({$rids})";
}


	$plugins->run_hooks("modcp_do_reports");

	$plugins->run_hooks("modcp_do_reports");


$db->update_query("reportedposts", array('reportstatus' => 1), "rid IN ({$rids}){$flist}");


$db->update_query("reportedposts", array('reportstatus' => 1), "{$sql}{$flist}");

	$cache->update_reportedposts();

	$cache->update_reportedposts();

	



	$page = intval($mybb->input['page']);

	$page = intval($mybb->input['page']);

	



	redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked);
}


	redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked);
}


Zeile 106Zeile 139
	add_breadcrumb($lang->mcp_nav_reported_posts, "modcp.php?action=reports");

if(!$mybb->settings['threadsperpage'])

	add_breadcrumb($lang->mcp_nav_reported_posts, "modcp.php?action=reports");

if(!$mybb->settings['threadsperpage'])

	{

	{

		$mybb->settings['threadsperpage'] = 20;
}


		$mybb->settings['threadsperpage'] = 20;
}


Zeile 115Zeile 148
	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	}


	}


	$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "reportstatus ='0'");
$report_count = $db->fetch_field($query, "count");

$mybb->input['rid'] = intval($mybb->input['rid']);

	$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "reportstatus ='0'");
$report_count = $db->fetch_field($query, "count");

$mybb->input['rid'] = intval($mybb->input['rid']);





	if($mybb->input['rid'])
{
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'");

	if($mybb->input['rid'])
{
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'");

Zeile 136Zeile 169
		}
}
$postcount = intval($report_count);

		}
}
$postcount = intval($report_count);

	$pages = $postcount / $perpage;
$pages = ceil($pages);

if($mybb->input['page'] == "last")
{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;

	$pages = $postcount / $perpage;
$pages = ceil($pages);

if($mybb->input['page'] == "last")
{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;

	}

if($page && $page > 0)
{
$start = ($page-1) * $perpage;

	}

if($page && $page > 0)
{
$start = ($page-1) * $perpage;

	}

	}

	else
{
$start = 0;

	else
{
$start = 0;

Zeile 171Zeile 204
	{
$forums[$forum['fid']] = $forum['name'];
}

	{
$forums[$forum['fid']] = $forum['name'];
}

	



	$plugins->run_hooks("modcp_reports_start");

$reports = '';

	$plugins->run_hooks("modcp_reports_start");

$reports = '';

Zeile 186Zeile 219
		ORDER BY r.dateline DESC
LIMIT {$start}, {$perpage}
");

		ORDER BY r.dateline DESC
LIMIT {$start}, {$perpage}
");

	while($report = $db->fetch_array($query))







if(!$db->num_rows($query))
{
eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";");
}
else

	{

	{

		$trow = alt_trow();
if(is_moderator($report['fid']))

		while($report = $db->fetch_array($query))


		{

		{

			$trow = 'trow_shaded';




























			$trow = alt_trow();
if(is_moderator($report['fid']))
{
$trow = 'trow_shaded';
}

$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);

$report['posterlink'] = get_profile_link($report['postuid']);
if(!$report['postuid'])
{
$report['posterlink'] = $report['postlink'];
$report['postusername'] = $lang->guest;
}

$report['reporterlink'] = get_profile_link($report['uid']);
if($report['uid'] > 0 && !$report['username'])
{
$report['reporterlink'] = $report['postlink'];
$report['username'] = $lang->na_deleted;
}

$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));

eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");

		}

		}

		$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);
$report['posterlink'] = get_profile_link($report['postuid']);
$report['reporterlink'] = get_profile_link($report['uid']);
$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");
}
if(!$reports)
{
eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";");

 
	}


	}


	$plugins->run_hooks("modcp_reports");

	$plugins->run_hooks("modcp_reports_end");


eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";");
output_page($reportedposts);


eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";");
output_page($reportedposts);

Zeile 247Zeile 299
		}
}
$postcount = intval($warnings);

		}
}
$postcount = intval($warnings);

	$pages = $postcount / $perpage;
$pages = ceil($pages);

if($mybb->input['page'] == "last")
{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;
}

	$pages = $postcount / $perpage;
$pages = ceil($pages);

if($mybb->input['page'] == "last")
{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;
}


if($page)


if($page)

	{

	{

		$start = ($page-1) * $perpage;
}
else

		$start = ($page-1) * $perpage;
}
else

Zeile 277Zeile 329
		eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
}


		eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
}


	$query = $db->simple_select("forums", "fid, name");
while($forum = $db->fetch_array($query))
{
$forums[$forum['fid']] = $forum['name'];
}


 
	$plugins->run_hooks("modcp_allreports_start");


	$plugins->run_hooks("modcp_allreports_start");


	$reports = '';

 
	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r

	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r

Zeile 294Zeile 339
		LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
ORDER BY r.dateline DESC

		LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
ORDER BY r.dateline DESC

		LIMIT $start, $perpage
");
while($report = $db->fetch_array($query))
{
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);
$report['posterlink'] = get_profile_link($report['postuid']);
$report['reporterlink'] = get_profile_link($report['uid']);

$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);

if($report['reportstatus'] == 0)
{
$trow = "trow_shaded";
}
else
{
$trow = alt_trow();
}

$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);

if($report['threadsubject'])
{
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";
}
else

		LIMIT {$start}, {$perpage}
");

$allreports = '';
if(!$db->num_rows($query))
{
eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");
}
else
{
while($report = $db->fetch_array($query))



















		{

		{

			$report['threadsubject'] = $lang->na;
}


































			$trow = alt_trow();

$report['threadlink'] = get_thread_link($report['tid']);

$report['posterlink'] = get_profile_link($report['postuid']);
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);

$report['reporterlink'] = get_profile_link($report['uid']);
if($report['uid'] > 0 && !$report['username'])
{
$report['reporterlink'] = $report['postlink'];
$report['username'] = $lang->na_deleted;
}

$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);

if($report['reportstatus'] == 0)
{
$trow = "trow_shaded";
}

// No subject? Set it to N/A
if($report['threadsubject'] == '')
{
$report['threadsubject'] = $lang->na;
}
else
{
// Only parse bad words and sanitize subject if there is one...
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
}

$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";





		eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");
}

if(!$allreports)
{
eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");

			eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");
}





	}


	}


	$plugins->run_hooks("modcp_reports");

	$plugins->run_hooks("modcp_allreports_end");


eval("\$allreportedposts = \"".$templates->get("modcp_reports_allreports")."\";");
output_page($allreportedposts);


eval("\$allreportedposts = \"".$templates->get("modcp_reports_allreports")."\";");
output_page($allreportedposts);

Zeile 349Zeile 405
	if(!$perpage || $perpage <= 0)
{
$perpage = $mybb->settings['threadsperpage'];

	if(!$perpage || $perpage <= 0)
{
$perpage = $mybb->settings['threadsperpage'];

	}


	}


	$where = '';

// Searching for entries by a particular user
if($mybb->input['uid'])

	$where = '';

// Searching for entries by a particular user
if($mybb->input['uid'])

	{

	{

		$where .= " AND l.uid='".intval($mybb->input['uid'])."'";
}

// Searching for entries in a specific forum
if($mybb->input['fid'])

		$where .= " AND l.uid='".intval($mybb->input['uid'])."'";
}

// Searching for entries in a specific forum
if($mybb->input['fid'])

	{

	{

		$where .= " AND t.fid='".intval($mybb->input['fid'])."'";
}


		$where .= " AND t.fid='".intval($mybb->input['fid'])."'";
}


Zeile 373Zeile 429
			break;
case "forum":
$sortby = "f.name";

			break;
case "forum":
$sortby = "f.name";

			break;

			break;

		case "thread":
$sortby = "t.subject";
break;
default:
$sortby = "l.dateline";

		case "thread":
$sortby = "t.subject";
break;
default:
$sortby = "l.dateline";

	}

	}

	$order = $mybb->input['order'];
if($order != "asc")
{
$order = "desc";
}

	$order = $mybb->input['order'];
if($order != "asc")
{
$order = "desc";
}

	



	$plugins->run_hooks("modcp_modlogs_start");

$query = $db->query("

	$plugins->run_hooks("modcp_modlogs_start");

$query = $db->query("

Zeile 393Zeile 449
		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)

		WHERE 1=1 {$where}

		WHERE 1=1 {$where}{$tflist}

	");
$rescount = $db->fetch_field($query, "count");


	");
$rescount = $db->fetch_field($query, "count");


Zeile 433Zeile 489
		eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
}
$query = $db->query("

		eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
}
$query = $db->query("

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)
WHERE 1=1 {$where}

		WHERE 1=1 {$where}{$tflist}


		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';

 
		$logitem['action'] = htmlspecialchars_uni($logitem['action']);

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();

Zeile 453Zeile 509
		$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])
{

		$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])
{

			$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

			$information = "<strong>{$lang->thread}:</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

		}
if($logitem['fname'])
{
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";
}

		}
if($logitem['fname'])
{
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";
}

		if($logitem['psubject'])
{
$information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";
}

// Edited a user?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])


// Edited a user or managed announcement?
if(!$logitem['tsubject'] || !$logitem['fname'])





		{
$data = unserialize($logitem['data']);
if($data['uid'])

		{
$data = unserialize($logitem['data']);
if($data['uid'])

			{

			{

				$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));

				$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));

 
			}
if($data['aid'])
{
$information = "<strong>{$lang->announcement}:</strong> <a href=\"".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";

			}
}

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");

// Fetch filter options

	$plugins->run_hooks("modcp_modlogs_filter");

// Fetch filter options

Zeile 500Zeile 556
		{
$user['username'] = $lang->na_deleted;
}

		{
$user['username'] = $lang->na_deleted;
}

		



		$selected = '';
if($mybb->input['uid'] == $user['uid'])
{

		$selected = '';
if($mybb->input['uid'] == $user['uid'])
{

Zeile 513Zeile 569

eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";");
output_page($modlogs);


eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";");
output_page($modlogs);

}


}


if($mybb->input['action'] == "do_delete_announcement")

if($mybb->input['action'] == "do_delete_announcement")

{

{

	verify_post_check($mybb->input['my_post_key']);

$aid = intval($mybb->input['aid']);

	verify_post_check($mybb->input['my_post_key']);

$aid = intval($mybb->input['aid']);

Zeile 524Zeile 580
	$announcement = $db->fetch_array($query);

if(!$announcement['aid'])

	$announcement = $db->fetch_array($query);

if(!$announcement['aid'])

	{
error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
{
error_no_permission();
}

$plugins->run_hooks("modcp_do_delete_announcement");

$db->delete_query("announcements", "aid='{$aid}'");

redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);
}

if($mybb->input['action'] == "delete_announcement")
{
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

if(!$announcement['aid'])
{

	{























		error($lang->error_invalid_announcement);

		error($lang->error_invalid_announcement);

	}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))

	}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

	{
error_no_permission();

	{
error_no_permission();

	}





























	}

$plugins->run_hooks("modcp_do_delete_announcement");

$db->delete_query("announcements", "aid='{$aid}'");
log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted);
$cache->update_forumsdisplay();

redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);
}

if($mybb->input['action'] == "delete_announcement")
{
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");

$announcement = $db->fetch_array($query);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);

if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);
}

if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}


	$plugins->run_hooks("modcp_delete_announcement");

	$plugins->run_hooks("modcp_delete_announcement");





	eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";");
output_page($announcements);
}

if($mybb->input['action'] == "do_new_announcement")

	eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";");
output_page($announcements);
}

if($mybb->input['action'] == "do_new_announcement")

{
verify_post_check($mybb->input['my_post_key']);

$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
{
error_no_permission();
}

if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;
}

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;
}

$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)
{
$startdate[0] = "00";
}
}

if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];

{
verify_post_check($mybb->input['my_post_key']);

$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}

if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;
}

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;
}

$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)
{
$startdate[0] = "00";
}
}

if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];

		if($enddate[0] >= 24)
{
$enddate[0] = "00";
}
}

		if($enddate[0] >= 24)
{
$enddate[0] = "00";
}
}

	
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');

	if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));

	if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));

	
if($startdate < 0 || $startdate == false)
{

	if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
{


		$errors[] = $lang->error_invalid_start_date;
}


		$errors[] = $lang->error_invalid_start_date;
}


Zeile 632Zeile 692
			$mybb->input['endtime_month'] = 1;
}
$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));

			$mybb->input['endtime_month'] = 1;
}
$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));

		if($enddate < 0 || $enddate == false)

		if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)

		{
$errors[] = $lang->error_invalid_end_date;
}

		{
$errors[] = $lang->error_invalid_end_date;
}

		elseif($enddate < $startdate)

		if($enddate <= $startdate)

		{
$errors[] = $lang->error_end_before_start;
}
}

		{
$errors[] = $lang->error_end_before_start;
}
}

	



	$plugins->run_hooks("modcp_do_new_announcement_start");

if(!$errors)

	$plugins->run_hooks("modcp_do_new_announcement_start");

if(!$errors)

Zeile 656Zeile 716
			'allowhtml' => $db->escape_string($mybb->input['allowhtml']),
'allowmycode' => $db->escape_string($mybb->input['allowmycode']),
'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']),

			'allowhtml' => $db->escape_string($mybb->input['allowhtml']),
'allowmycode' => $db->escape_string($mybb->input['allowmycode']),
'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']),

		);


		);


		$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);


		$plugins->run_hooks("modcp_do_new_announcement_end");

		$plugins->run_hooks("modcp_do_new_announcement_end");

		



$cache->update_forumsdisplay();

		redirect("modcp.php?action=announcements", $lang->redirect_add_announcement);
}
else

		redirect("modcp.php?action=announcements", $lang->redirect_add_announcement);
}
else

Zeile 676Zeile 738
	add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");

$announcement_fid = intval($mybb->input['fid']);

	add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");

$announcement_fid = intval($mybb->input['fid']);


if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))


if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

	{
error_no_permission();
}

	{
error_no_permission();
}

Zeile 686Zeile 748
	if(is_array($errors))
{
$errors = inline_error($errors);

	if(is_array($errors))
{
$errors = inline_error($errors);

		



		// Set $announcement to input stuff
$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		// Set $announcement to input stuff
$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');

		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

		}


		}


		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}

		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}

		



		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

		$starttime_time = htmlspecialchars($mybb->input['starttime_time']);

		$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);

		$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);

		$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);

		$endtime_time = htmlspecialchars($mybb->input['endtime_time']);
}
else

		$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
}
else

	{
// Note: dates are in GMT timezone
$starttime_time = gmdate("g:i a", TIME_NOW);

	{
// Note: dates are in GMT timezone
$starttime_time = gmdate("g:i a", TIME_NOW);

Zeile 820Zeile 882
	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	



	$plugins->run_hooks("modcp_new_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";");

	$plugins->run_hooks("modcp_new_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";");

Zeile 830Zeile 892
if($mybb->input['action'] == "do_edit_announcement")
{
verify_post_check($mybb->input['my_post_key']);

if($mybb->input['action'] == "do_edit_announcement")
{
verify_post_check($mybb->input['my_post_key']);





	// Get the announcement
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

	// Get the announcement
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);





	// Check that it exists
if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

	// Check that it exists
if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

	}

	}


// Mod has permissions to edit this announcement


// Mod has permissions to edit this announcement

	if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))

	if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

	{
error_no_permission();

	{
error_no_permission();

	}

	}


// Basic error checking
if(!trim($mybb->input['title']))


// Basic error checking
if(!trim($mybb->input['title']))

Zeile 860Zeile 922
	}

if(!trim($mybb->input['fid']))

	}

if(!trim($mybb->input['fid']))

	{

	{

		$errors[] = $lang->error_missing_forum;
}


		$errors[] = $lang->error_missing_forum;
}


Zeile 875Zeile 937
		if($startdate[0] >= 24)
{
$startdate[0] = "00";

		if($startdate[0] >= 24)
{
$startdate[0] = "00";

		}
}


		}
}


	if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];
if($enddate[0] >= 24)

	if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];
if($enddate[0] >= 24)

		{

		{

			$enddate[0] = "00";
}
}


			$enddate[0] = "00";
}
}


	$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');			

	$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');

	if(!in_array($mybb->input['starttime_month'], $months))

	if(!in_array($mybb->input['starttime_month'], $months))

	{

	{

		$mybb->input['starttime_month'] = 1;
}

$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));

		$mybb->input['starttime_month'] = 1;
}

$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));

	if($startdate < 0 || $startdate == false)

	if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)

	{
$errors[] = $lang->error_invalid_start_date;
}

	{
$errors[] = $lang->error_invalid_start_date;
}

Zeile 904Zeile 966
		$enddate = '0';
}
else

		$enddate = '0';
}
else

	{		

	{

		if(!in_array($mybb->input['endtime_month'], $months))

		if(!in_array($mybb->input['endtime_month'], $months))

		{

		{

			$mybb->input['endtime_month'] = 1;

			$mybb->input['endtime_month'] = 1;

		}
$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
if($enddate < 0 || $enddate == false)
{

		}
$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)
{

			$errors[] = $lang->error_invalid_end_date;
}

			$errors[] = $lang->error_invalid_end_date;
}

		elseif($enddate < $startdate)

		elseif($enddate <= $startdate)

		{
$errors[] = $lang->error_end_before_start;
}
}

		{
$errors[] = $lang->error_end_before_start;
}
}

	



	$plugins->run_hooks("modcp_do_edit_announcement_start");

// Proceed to update if no errors

	$plugins->run_hooks("modcp_do_edit_announcement_start");

// Proceed to update if no errors

Zeile 937Zeile 999
		);

$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);


		$plugins->run_hooks("modcp_do_edit_announcement_end");

		$plugins->run_hooks("modcp_do_edit_announcement_end");

		



$cache->update_forumsdisplay();

		redirect("modcp.php?action=announcements", $lang->redirect_edit_announcement);
}
else

		redirect("modcp.php?action=announcements", $lang->redirect_edit_announcement);
}
else

Zeile 964Zeile 1029
	{
error($lang->error_invalid_announcement);
}

	{
error($lang->error_invalid_announcement);
}

	if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))

	if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

	{
error_no_permission();

	{
error_no_permission();

 
	}

if(!$announcement['startdate'])
{
// No start date? Make it now.
$announcement['startdate'] = TIME_NOW;
}

$makeshift_end = false;
if(!$announcement['enddate'])
{
$makeshift_end = true;
$makeshift_time = TIME_NOW;
if($announcement['startdate'])
{
$makeshift_time = $announcement['startdate'];
}

// No end date? Make it a year from now.
$announcement['enddate'] = $makeshift_time + (60 * 60 * 24 * 366);

	}

// Deal with inline errors
if(is_array($errors))
{
$errors = inline_error($errors);

	}

// Deal with inline errors
if(is_array($errors))
{
$errors = inline_error($errors);





		// Set $announcement to input stuff
$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		// Set $announcement to input stuff
$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');

		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

		}


		}


		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}

		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}

		



		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

		$starttime_time = htmlspecialchars($mybb->input['starttime_time']);

		$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);

		$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);

		$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);

		$endtime_time = htmlspecialchars($mybb->input['endtime_time']);

		$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);


$errored = true;
}


$errored = true;
}

Zeile 1071Zeile 1156
	$enddatemonth .= "<option value=\"11\" {$endmonthsel['11']}>{$lang->november}</option>\n";
$startdatemonth .= "<option value=\"12\" {$startmonthsel['12']}>{$lang->december}</option>\n";
$enddatemonth .= "<option value=\"12\" {$endmonthsel['12']}>{$lang->december}</option>\n";

	$enddatemonth .= "<option value=\"11\" {$endmonthsel['11']}>{$lang->november}</option>\n";
$startdatemonth .= "<option value=\"12\" {$startmonthsel['12']}>{$lang->december}</option>\n";
$enddatemonth .= "<option value=\"12\" {$endmonthsel['12']}>{$lang->december}</option>\n";





	$title = htmlspecialchars_uni($announcement['subject']);
$message = htmlspecialchars_uni($announcement['message']);

$html_sel = $mycode_sel = $smilies_sel = array();
if($announcement['allowhtml'])

	$title = htmlspecialchars_uni($announcement['subject']);
$message = htmlspecialchars_uni($announcement['message']);

$html_sel = $mycode_sel = $smilies_sel = array();
if($announcement['allowhtml'])

	{

	{

		$html_sel['yes'] = ' checked="checked"';
}
else

		$html_sel['yes'] = ' checked="checked"';
}
else

Zeile 1092Zeile 1177
	else
{
$mycode_sel['no'] = ' checked="checked"';

	else
{
$mycode_sel['no'] = ' checked="checked"';

	}

	}


if($announcement['allowsmilies'])
{
$smilies_sel['yes'] = ' checked="checked"';


if($announcement['allowsmilies'])
{
$smilies_sel['yes'] = ' checked="checked"';

	}
else

	}
else

	{
$smilies_sel['no'] = ' checked="checked"';
}


	{
$smilies_sel['no'] = ' checked="checked"';
}


	if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0))

	if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0) || $makeshift_end == true)

	{
$end_type_sel['infinite'] = ' checked="checked"';
}

	{
$end_type_sel['infinite'] = ' checked="checked"';
}

Zeile 1115Zeile 1200
	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	



	$plugins->run_hooks("modcp_edit_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";");

	$plugins->run_hooks("modcp_edit_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";");

Zeile 1148Zeile 1233
				$trow = alt_trow();
if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
{

				$trow = alt_trow();
if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
{

					$icon = "<img src=\"images/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\"  style=\"vertical-align: middle;\" /> ";

					$icon = "<img src=\"{$theme['imgdir']}/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\"  style=\"vertical-align: middle;\" /> ";

				}
else
{

				}
else
{

					$icon = "<img src=\"images/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\"  style=\"vertical-align: middle;\" /> ";

					$icon = "<img src=\"{$theme['imgdir']}/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\"  style=\"vertical-align: middle;\" /> ";

				}

$subject = htmlspecialchars_uni($announcement['subject']);

				}

$subject = htmlspecialchars_uni($announcement['subject']);

Zeile 1171Zeile 1256
	{
// Moderator is not super, so don't show global annnouncemnets
$announcements_global = '';

	{
// Moderator is not super, so don't show global annnouncemnets
$announcements_global = '';

	}

fetch_forum_announcements();


	}

fetch_forum_announcements();


	if(!$announcements_forum)
{
eval("\$announcements_forum = \"".$templates->get("modcp_no_announcements_forum")."\";");
}

	if(!$announcements_forum)
{
eval("\$announcements_forum = \"".$templates->get("modcp_no_announcements_forum")."\";");
}

	



	$plugins->run_hooks("modcp_announcements");

	$plugins->run_hooks("modcp_announcements");

	



	eval("\$announcements = \"".$templates->get("modcp_announcements")."\";");
output_page($announcements);
}

	eval("\$announcements = \"".$templates->get("modcp_announcements")."\";");
output_page($announcements);
}

Zeile 1193Zeile 1278

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

	
$plugins->run_hooks("modcp_do_modqueue_start");


$plugins->run_hooks("modcp_do_modqueue_start");


if(is_array($mybb->input['threads']))
{
// Fetch threads
$query = $db->simple_select("threads", "tid", "tid IN (".implode(",", array_map("intval", array_keys($mybb->input['threads'])))."){$flist}");
while($thread = $db->fetch_array($query))


if(is_array($mybb->input['threads']))
{
// Fetch threads
$query = $db->simple_select("threads", "tid", "tid IN (".implode(",", array_map("intval", array_keys($mybb->input['threads'])))."){$flist}");
while($thread = $db->fetch_array($query))

		{

		{

			$action = $mybb->input['threads'][$thread['tid']];
if($action == "approve")
{
$threads_to_approve[] = $thread['tid'];
}
else if($action == "delete")

			$action = $mybb->input['threads'][$thread['tid']];
if($action == "approve")
{
$threads_to_approve[] = $thread['tid'];
}
else if($action == "delete")

			{

			{

				$threads_to_delete[] = $thread['tid'];
}
}

				$threads_to_delete[] = $thread['tid'];
}
}

Zeile 1221Zeile 1306
		{
foreach($threads_to_delete as $tid)
{

		{
foreach($threads_to_delete as $tid)
{

				$moderation->delete_thread($thread['tid']);

				$moderation->delete_thread($tid);

			}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
}

			}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
}

		



		$plugins->run_hooks("modcp_do_modqueue_end");

		$plugins->run_hooks("modcp_do_modqueue_end");

		



		redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated);

		redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated);

	}

	}

	else if(is_array($mybb->input['posts']))
{
// Fetch posts
$query = $db->simple_select("posts", "pid", "pid IN (".implode(",", array_map("intval", array_keys($mybb->input['posts'])))."){$flist}");
while($post = $db->fetch_array($query))

	else if(is_array($mybb->input['posts']))
{
// Fetch posts
$query = $db->simple_select("posts", "pid", "pid IN (".implode(",", array_map("intval", array_keys($mybb->input['posts'])))."){$flist}");
while($post = $db->fetch_array($query))

		{

		{

			$action = $mybb->input['posts'][$post['pid']];
if($action == "approve")
{
$posts_to_approve[] = $post['pid'];

			$action = $mybb->input['posts'][$post['pid']];
if($action == "approve")
{
$posts_to_approve[] = $post['pid'];

			}
else if($action == "delete")

			}
else if($action == "delete")

			{
$moderation->delete_post($post['pid']);
}
}
if(is_array($posts_to_approve))

			{
$moderation->delete_post($post['pid']);
}
}
if(is_array($posts_to_approve))

		{

		{

			$moderation->approve_posts($posts_to_approve);
}
log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);

			$moderation->approve_posts($posts_to_approve);
}
log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);

		



		$plugins->run_hooks("modcp_do_modqueue_end");

		$plugins->run_hooks("modcp_do_modqueue_end");

		



		redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
}
else if(is_array($mybb->input['attachments']))

		redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
}
else if(is_array($mybb->input['attachments']))

Zeile 1277Zeile 1362
				remove_attachment($attachment['pid'], '', $attachment['aid']);
}
}

				remove_attachment($attachment['pid'], '', $attachment['aid']);
}
}

		



		$plugins->run_hooks("modcp_do_modqueue_end");

		$plugins->run_hooks("modcp_do_modqueue_end");

		



		redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated);
}
}

		redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated);
}
}

Zeile 1323Zeile 1408
			$page = 1;
}


			$page = 1;
}


		$multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&amp;type=threads");

		$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");


$query = $db->query("


$query = $db->query("

			SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid

			SELECT t.tid, t.dateline, t.fid, t.subject, t.username AS threadusername, p.message AS postmessage, u.username AS username, t.uid

			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
WHERE t.visible='0' {$tflist}
ORDER BY t.lastpost DESC

			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
WHERE t.visible='0' {$tflist}
ORDER BY t.lastpost DESC

			LIMIT {$start}, {$perpage}
");

			LIMIT {$start}, {$perpage}
");

		while($thread = $db->fetch_array($query))
{
$altbg = alt_trow();

		while($thread = $db->fetch_array($query))
{
$altbg = alt_trow();

Zeile 1343Zeile 1428
			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date($mybb->settings['dateformat'], $thread['dateline']);
$threadtime = my_date($mybb->settings['timeformat'], $thread['dateline']);

			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date($mybb->settings['dateformat'], $thread['dateline']);
$threadtime = my_date($mybb->settings['timeformat'], $thread['dateline']);

			$profile_link = build_profile_link($thread['username'], $thread['uid']);


















if($thread['username'] == "")
{
if($thread['threadusername'] != "")
{
$profile_link = $thread['threadusername'];
}
else
{
$profile_link = $lang->guest;
}
}
else
{
$profile_link = build_profile_link($thread['username'], $thread['uid']);
}


			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
$forum = "<strong>{$lang->meta_forum} <a href=\"{$thread['forumlink']}\">{$forum_name}</a></strong>";
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");

			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
$forum = "<strong>{$lang->meta_forum} <a href=\"{$thread['forumlink']}\">{$forum_name}</a></strong>";
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");

Zeile 1357Zeile 1458
		if($threads)
{
add_breadcrumb($lang->mcp_nav_modqueue_threads, "modcp.php?action=modqueue&amp;type=threads");

		if($threads)
{
add_breadcrumb($lang->mcp_nav_modqueue_threads, "modcp.php?action=modqueue&amp;type=threads");

			



			$plugins->run_hooks("modcp_modqueue_threads_end");

			$plugins->run_hooks("modcp_modqueue_threads_end");

			



			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$threadqueue = \"".$templates->get("modcp_modqueue_threads")."\";");
output_page($threadqueue);

			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$threadqueue = \"".$templates->get("modcp_modqueue_threads")."\";");
output_page($threadqueue);

Zeile 1409Zeile 1510
			$page = 1;
}


			$page = 1;
}


		$multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&amp;type=posts");

		$multipage = multipage($unapproved_posts, $perpage, $page, "modcp.php?action=modqueue&amp;type=posts");


$query = $db->query("


$query = $db->query("

			SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

			SELECT p.pid, p.subject, p.message, p.username AS postusername, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

			FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

			FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

Zeile 1430Zeile 1531
			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);

			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);

			$profile_link = build_profile_link($post['username'], $post['uid']);


















if($post['username'] == "")
{
if($post['postusername'] != "")
{
$profile_link = $post['postusername'];
}
else
{
$profile_link = $lang->guest;
}
}
else
{
$profile_link = build_profile_link($post['username'], $post['uid']);
}


			$thread = "<strong>{$lang->meta_thread} <a href=\"{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
$forum = "<strong>{$lang->meta_forum} <a href=\"{$post['forumlink']}\">{$forum_name}</a></strong><br />";
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));

			$thread = "<strong>{$lang->meta_thread} <a href=\"{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
$forum = "<strong>{$lang->meta_forum} <a href=\"{$post['forumlink']}\">{$forum_name}</a></strong><br />";
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));

Zeile 1438Zeile 1555
		}

if(!$posts && $mybb->input['type'] == "posts")

		}

if(!$posts && $mybb->input['type'] == "posts")

		{

		{

			eval("\$posts = \"".$templates->get("modcp_modqueue_posts_empty")."\";");
}

			eval("\$posts = \"".$templates->get("modcp_modqueue_posts_empty")."\";");
}





		if($posts)
{
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");

		if($posts)
{
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");

			



			$plugins->run_hooks("modcp_modqueue_posts_end");

			$plugins->run_hooks("modcp_modqueue_posts_end");

			



			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";");
output_page($postqueue);
}
}

			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";");
output_page($postqueue);
}
}





	if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue))
{
$query = $db->query("

	if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue))
{
$query = $db->query("

Zeile 1478Zeile 1595
		if($mybb->input['page'] == "last")
{
$page = $pages;

		if($mybb->input['page'] == "last")
{
$page = $pages;

		}

		}


if($page > $pages || $page <= 0)
{


if($page > $pages || $page <= 0)
{

Zeile 1488Zeile 1605
		if($page)
{
$start = ($page-1) * $perpage;

		if($page)
{
$start = ($page-1) * $perpage;

		}
else
{

		}
else
{

			$start = 0;
$page = 1;
}


			$start = 0;
$page = 1;
}


		$multipage = multipage($pages, $perpage, $page, "modcp.php?action=modqueue&amp;type=attachments");

		$multipage = multipage($unapproved_attachments, $perpage, $page, "modcp.php?action=modqueue&amp;type=attachments");


$query = $db->query("
SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject


$query = $db->query("
SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject

Zeile 1515Zeile 1632
			{
$attachment['dateuploaded'] = $attachment['dateline'];
}

			{
$attachment['dateuploaded'] = $attachment['dateline'];
}

			



			$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);


			$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);


Zeile 1539Zeile 1656
		if($attachments)
{
add_breadcrumb($lang->mcp_nav_modqueue_attachments, "modcp.php?action=modqueue&amp;type=attachments");

		if($attachments)
{
add_breadcrumb($lang->mcp_nav_modqueue_attachments, "modcp.php?action=modqueue&amp;type=attachments");

			



			$plugins->run_hooks("modcp_modqueue_attachments_end");

			$plugins->run_hooks("modcp_modqueue_attachments_end");

			



			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);

			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);

Zeile 1552Zeile 1669
	if(!$threadqueue && !$postqueue && !$attachmentqueue)
{
add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue");

	if(!$threadqueue && !$postqueue && !$attachmentqueue)
{
add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue");

		



		$plugins->run_hooks("modcp_modqueue_end");

		$plugins->run_hooks("modcp_modqueue_end");

		



		eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";");
output_page($queue);
}
}

		eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";");
output_page($queue);
}
}





if($mybb->input['action'] == "do_editprofile")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

if($mybb->input['action'] == "do_editprofile")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);





	$user = get_user($mybb->input['uid']);
if(!$user['uid'])

	$user = get_user($mybb->input['uid']);
if(!$user['uid'])

	{
error($lang->invalid_user);
}


	{
error($lang->error_nomember);
}


	// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();
}

	// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();
}

	



	$plugins->run_hooks("modcp_do_editprofile_start");

// Set up user handler.

	$plugins->run_hooks("modcp_do_editprofile_start");

// Set up user handler.

Zeile 1668Zeile 1785
		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

 
			$mybb->input[$option['time']] = intval($mybb->input[$option['time']]);

			if(!$mybb->input[$option['action']])
{
if($user[$option['update_field']] == 1)

			if(!$mybb->input[$option['action']])
{
if($user[$option['update_field']] == 1)

Zeile 1683Zeile 1801

if($mybb->input[$option['action']])
{


if($mybb->input[$option['action']])
{

				if(intval($mybb->input[$option['time']]) == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

				if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

				{
// User has selected a type of ban, but not entered a valid time frame
$string = $option['action']."_error";

				{
// User has selected a type of ban, but not entered a valid time frame
$string = $option['action']."_error";

Zeile 1697Zeile 1815
					if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never"))
{
// We already have a suspension, but entered a new time

					if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never"))
{
// We already have a suspension, but entered a new time

						if($suspend_length == "-1")

						if($suspend_length == "-1")

						{
// Permanent ban on action
$extra_user_updates[$option['update_length']] = 0;

						{
// Permanent ban on action
$extra_user_updates[$option['update_length']] = 0;

Zeile 1711Zeile 1829
					elseif(!$user[$option['update_field']])
{
// New suspension for this user... bad user!

					elseif(!$user[$option['update_field']])
{
// New suspension for this user... bad user!

						$extra_user_updates[$option['update_field']] = 1;				

						$extra_user_updates[$option['update_field']] = 1;

						if($suspend_length == "-1")
{
$extra_user_updates[$option['update_length']] = 0;

						if($suspend_length == "-1")
{
$extra_user_updates[$option['update_length']] = 0;

Zeile 1723Zeile 1841
					}
}
}

					}
}
}

		}

		}


// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting


// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting

Zeile 1739Zeile 1857
		else
{
$plugins->run_hooks("modcp_do_editprofile_update");

		else
{
$plugins->run_hooks("modcp_do_editprofile_update");

			



			// Continue with the update if there is no errors
$user_info = $userhandler->update_user();
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

			// Continue with the update if there is no errors
$user_info = $userhandler->update_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");

			$plugins->run_hooks("modcp_do_editprofile_end");

			



			redirect("modcp.php?action=finduser", $lang->redirect_user_updated);

			redirect("modcp.php?action=finduser", $lang->redirect_user_updated);

		}
}
}

		}
}
}


if($mybb->input['action'] == "editprofile")
{


if($mybb->input['action'] == "editprofile")
{

Zeile 1758Zeile 1876

$user = get_user($mybb->input['uid']);
if(!$user['uid'])


$user = get_user($mybb->input['uid']);
if(!$user['uid'])

	{
error($lang->invalid_user);
}

	{
error($lang->error_nomember);
}


// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();


// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();

	}


	}


	if($user['website'] == "" || $user['website'] == "http://")
{
$user['website'] = "http://";

	if($user['website'] == "" || $user['website'] == "http://")
{
$user['website'] = "http://";

	}


	}


	if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);
}
if($user['icq'] == 0)

	if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);
}
if($user['icq'] == 0)

	{

	{

		$user['icq'] = "";
}


		$user['icq'] = "";
}


Zeile 1790Zeile 1908
	else
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

	}


	}


	// Sanitize all input
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)

	// Sanitize all input
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)

	{

	{

		$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
}

		$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
}


if($mybb->usergroup['usertitle'] == "")
{
$query = $db->simple_select("usertitles", "*", "posts <='".$user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$utitle = $db->fetch_array($query);
$defaulttitle = $utitle['title'];
}
else
{
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

$displaygroupfields = array(
"usertitle"
);
$display_group = usergroup_displaygroup($user['displaygroup']);
$defaulttitle = $display_group['usertitle'];
}










// Custom user title, check to see if we have a default group title
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

$displaygroupfields = array('usertitle');
$display_group = usergroup_displaygroup($user['displaygroup']);

if(!empty($display_group['usertitle']))
{
$defaulttitle = $display_group['usertitle'];
}
else
{
// Go for post count title if a group default isn't set
$usertitles = $cache->read('usertitles');

foreach($usertitles as $title)
{
if($title['posts'] <= $mybb->user['postnum'])
{
$defaulttitle = $title['title'];
}
}
}


	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

Zeile 1828Zeile 1954
		if($mybb->input['birthday_day'] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		if($mybb->input['birthday_day'] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		}

		}

		else
{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}
}
$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

		else
{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}
}
$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

	



	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

Zeile 1959Zeile 2085
			}
$expoptions = explode("\n", $options);
if(is_array($expoptions))

			}
$expoptions = explode("\n", $options);
if(is_array($expoptions))

			{

			{

				foreach($expoptions as $key => $val)
{
$checked = "";

				foreach($expoptions as $key => $val)
{
$checked = "";

Zeile 2050Zeile 2176
		1 => array(
"action" => "suspendsignature", // The input action for this option
"option" => "suspendsignature", // The field in the database that this option relates to

		1 => array(
"action" => "suspendsignature", // The input action for this option
"option" => "suspendsignature", // The field in the database that this option relates to

 
			"time" => "action_time", // The time we've entered

			"length" => "suspendsigtime", // The length of suspension field in the database
"select_option" => "action" // The name of the select box of this option
),
2 => array(
"action" => "moderateposting",
"option" => "moderateposts",

			"length" => "suspendsigtime", // The length of suspension field in the database
"select_option" => "action" // The name of the select box of this option
),
2 => array(
"action" => "moderateposting",
"option" => "moderateposts",

 
			"time" => "modpost_time",

			"length" => "moderationtime",
"select_option" => "modpost"
),
3 => array(
"action" => "suspendposting",
"option" => "suspendposting",

			"length" => "moderationtime",
"select_option" => "modpost"
),
3 => array(
"action" => "suspendposting",
"option" => "suspendposting",

 
			"time" => "suspost_time",

			"length" => "suspensiontime",
"select_option" => "suspost"
)

			"length" => "suspensiontime",
"select_option" => "suspost"
)

Zeile 2077Zeile 2206

foreach($moderator_options as $option)
{


foreach($moderator_options as $option)
{

 
		$mybb->input[$option['time']] = intval($mybb->input[$option['time']]);

		// 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 2106Zeile 2236
				case "suspendposting":
eval("\$suspendposting_info = \"".$templates->get("modcp_editprofile_suspensions_info")."\";");
break;

				case "suspendposting":
eval("\$suspendposting_info = \"".$templates->get("modcp_editprofile_suspensions_info")."\";");
break;

			}
}


			}
}


		// Generate the boxes for this option
$selection_options = '';
foreach($periods as $key => $value)
{
$string = $option['select_option']."_period";
if($mybb->input[$string] == $key)

		// Generate the boxes for this option
$selection_options = '';
foreach($periods as $key => $value)
{
$string = $option['select_option']."_period";
if($mybb->input[$string] == $key)

			{

			{

				$selected = "selected=\"selected\"";
}
else

				$selected = "selected=\"selected\"";
}
else

Zeile 2142Zeile 2272
	}

eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");

	}

eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");

	



	$plugins->run_hooks("modcp_editprofile_end");

eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");

	$plugins->run_hooks("modcp_editprofile_end");

eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");

Zeile 2152Zeile 2282
if($mybb->input['action'] == "finduser")
{
add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");

if($mybb->input['action'] == "finduser")
{
add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");

	



	$perpage = intval($mybb->input['perpage']);
if(!$perpage || $perpage <= 0)
{
$perpage = $mybb->settings['threadsperpage'];

	$perpage = intval($mybb->input['perpage']);
if(!$perpage || $perpage <= 0)
{
$perpage = $mybb->settings['threadsperpage'];

	}
$where = '';


	}
$where = '';


	if($mybb->input['username'])
{
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";

	if($mybb->input['username'])
{
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";

Zeile 2170Zeile 2300
	{
case "lastvisit":
$sortby = "lastvisit";

	{
case "lastvisit":
$sortby = "lastvisit";

			break;

			break;

		case "postnum":
$sortby = "postnum";
break;

		case "postnum":
$sortby = "postnum";
break;

Zeile 2191Zeile 2321

// Figure out if we need to display multiple pages.
if($mybb->input['page'] != "last")


// Figure out if we need to display multiple pages.
if($mybb->input['page'] != "last")

	{

	{

		$page = intval($mybb->input['page']);
}


		$page = intval($mybb->input['page']);
}


Zeile 2201Zeile 2331
	if($mybb->input['page'] == "last")
{
$page = $pages;

	if($mybb->input['page'] == "last")
{
$page = $pages;

	}

	}


if($page > $pages || $page <= 0)


if($page > $pages || $page <= 0)

	{
$page = 1;

	{
$page = 1;

	}
if($page)

	}
if($page)

	{

	{

		$start = ($page-1) * $perpage;
}
else

		$start = ($page-1) * $perpage;
}
else

	{

	{

		$start = 0;
$page = 1;

		$start = 0;
$page = 1;

	}

	}


$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)


$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)

Zeile 2226Zeile 2356
			$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
}
}

			$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);
}
}





	$multipage = multipage($user_count, $perpage, $page, $page_url);

	$multipage = multipage($user_count, $perpage, $page, $page_url);





	$usergroups_cache = $cache->read("usergroups");

	$usergroups_cache = $cache->read("usergroups");

	



	$plugins->run_hooks("modcp_finduser_start");

// Fetch out results

	$plugins->run_hooks("modcp_finduser_start");

// Fetch out results

Zeile 2253Zeile 2383
	{
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";");
}

	{
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";");
}

	



	$plugins->run_hooks("modcp_finduser_end");

eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");

	$plugins->run_hooks("modcp_finduser_end");

eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");

Zeile 2302Zeile 2432
	}
if($mybb->input['filter']['reason'])
{

	}
if($mybb->input['filter']['reason'])
{

		$search['reason'] = $db->escape_string($mybb->input['filter']['reason']);

		$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);

		$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']);
}

		$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']);
}

Zeile 2336Zeile 2466
	{
$ordersel['asc'] = ' selected="selected"';
}

	{
$ordersel['asc'] = ' selected="selected"';
}

	



	$plugins->run_hooks("modcp_warninglogs_start");

// Pagination stuff

	$plugins->run_hooks("modcp_warninglogs_start");

// Pagination stuff

Zeile 2433Zeile 2563
	{
eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");
}

	{
eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");
}

	



	$plugins->run_hooks("modcp_warninglogs_end");

	$plugins->run_hooks("modcp_warninglogs_end");





	eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";");
output_page($warninglogs);
}

	eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";");
output_page($warninglogs);
}

Zeile 2443Zeile 2573
if($mybb->input['action'] == "ipsearch")
{
add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");

if($mybb->input['action'] == "ipsearch")
{
add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");





	if($mybb->input['ipaddress'])
{
if(!is_array($groupscache))

	if($mybb->input['ipaddress'])
{
if(!is_array($groupscache))

Zeile 2455Zeile 2585

// Searching post IP addresses
if($mybb->input['search_posts'])


// Searching post IP addresses
if($mybb->input['search_posts'])

		{
// IPv6 IP
if(strpos($mybb->input['ipaddress'], ":") !== false)
{

		{
// IPv6 IP
if(strpos($mybb->input['ipaddress'], ":") !== false)
{

				$post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";

				$post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";

			}
else
{
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);
if(!is_array($ip_range))
{
$post_ip_sql = "longipaddress='{$ip_range}'";
}
else

			}
else
{
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);

if($ip_range)




				{

				{

					$post_ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";








					if(!is_array($ip_range))
{
$post_ip_sql = "longipaddress='{$ip_range}'";
}
else
{
$post_ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
}

				}

				}

			}


			}


			$plugins->run_hooks("modcp_ipsearch_posts_start");

			$plugins->run_hooks("modcp_ipsearch_posts_start");

			$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts
WHERE {$post_ip_sql}
");
$post_results = $db->fetch_field($query, "count");
}







if($post_ip_sql)
{
$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts
WHERE {$post_ip_sql} AND visible >= 0
");

$post_results = $db->fetch_field($query, "count");
}
}


// Searching user IP addresses
if($mybb->input['search_users'])


// Searching user IP addresses
if($mybb->input['search_users'])

Zeile 2491Zeile 2631
				$user_ip_sql = "regip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."' OR lastip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";
}
else

				$user_ip_sql = "regip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."' OR lastip LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";
}
else

			{

			{

				$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);

				$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);

				if(!is_array($ip_range))



if($ip_range)

				{

				{

					$user_ip_sql = "longregip='{$ip_range}' OR longlastip='{$ip_range}'";
}
else
{
$user_ip_sql = "(longregip > '{$ip_range[0]}' AND longregip < '{$ip_range[1]}') OR (longlastip > '{$ip_range[0]}' AND longlastip < '{$ip_range[1]}')";




					if(!is_array($ip_range))
{
$user_ip_sql = "longregip='{$ip_range}' OR longlastip='{$ip_range}'";
}
else
{
$user_ip_sql = "(longregip > '{$ip_range[0]}' AND longregip < '{$ip_range[1]}') OR (longlastip > '{$ip_range[0]}' AND longlastip < '{$ip_range[1]}')";
}

				}
}

				}
}

 


			$plugins->run_hooks("modcp_ipsearch_users_start");

			$plugins->run_hooks("modcp_ipsearch_users_start");

			$query = $db->query("
SELECT COUNT(uid) AS count
FROM ".TABLE_PREFIX."users
WHERE {$user_ip_sql}
");
$user_results = $db->fetch_field($query, "count");
}








if($user_ip_sql)
{
$query = $db->query("
SELECT COUNT(uid) AS count
FROM ".TABLE_PREFIX."users
WHERE {$user_ip_sql}
");

$user_results = $db->fetch_field($query, "count");
}
}


		$total_results = $post_results+$user_results;

		$total_results = $post_results+$user_results;

 

if(!$total_results)
{
$total_results = 1;
}


// Now we have the result counts, paginate
$perpage = intval($mybb->input['perpage']);


// Now we have the result counts, paginate
$perpage = intval($mybb->input['perpage']);

Zeile 2558Zeile 2713
		$multipage = multipage($total_results, $perpage, $page, $page_url);

$post_limit = $perpage;

		$multipage = multipage($total_results, $perpage, $page, $page_url);

$post_limit = $perpage;

		if($mybb->input['search_users'] && $start <= $user_results)

		if($mybb->input['search_users'] && $user_results && $start <= $user_results)

		{
$query = $db->query("
SELECT username, uid, regip, lastip

		{
$query = $db->query("
SELECT username, uid, regip, lastip

Zeile 2605Zeile 2760
				$post_start = 0;
}
}

				$post_start = 0;
}
}

		if($mybb->input['search_posts'] && (!$mybb->input['search_users'] || ($mybb->input['search_users'] && $post_limit > 0)))

		if($mybb->input['search_posts'] && $post_results && (!$mybb->input['search_users'] || ($mybb->input['search_users'] && $post_limit > 0)))

		{
$ipaddresses = $tids = $uids = array();
$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts

		{
$ipaddresses = $tids = $uids = array();
$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts

				WHERE {$post_ip_sql}

				WHERE {$post_ip_sql} AND visible >= 0

				ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

				ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

Zeile 2621Zeile 2776
				$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;
}

				$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;
}

			



			if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");

			if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");

Zeile 2630Zeile 2785
					$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];
}
unset($tids);

					$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];
}
unset($tids);

				



				$query = $db->simple_select("users", "username, uid", "uid IN(".implode(',', array_keys($uids)).")");
while($user = $db->fetch_array($query))

				$query = $db->simple_select("users", "username, uid", "uid IN(".implode(',', array_keys($uids)).")");
while($user = $db->fetch_array($query))

				{

				{

					$ipaddresses[$uids[$user['uid']]]['username'] = $user['username'];
}
unset($uids);

					$ipaddresses[$uids[$user['uid']]]['username'] = $user['username'];
}
unset($uids);

				



				foreach($ipaddresses as $ipaddress)
{
$ip = $ipaddress['ipaddress'];

				foreach($ipaddresses as $ipaddress)
{
$ip = $ipaddress['ipaddress'];

Zeile 2651Zeile 2806
					eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");
}
}

					eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");
}
}

		}

		}


if(!$results)
{
eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");


if(!$results)
{
eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");

		}

		}


if($ipaddressvalue)
{


if($ipaddressvalue)
{

Zeile 2665Zeile 2820
		else
{
$lang->ipsearch_results = $lang->ipsearch;

		else
{
$lang->ipsearch_results = $lang->ipsearch;

		}

if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":"))
{
$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";

		}

if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":"))
{
$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".urlencode($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";

		}

eval("\$ipsearch_results = \"".$templates->get("modcp_ipsearch_results")."\";");

		}

eval("\$ipsearch_results = \"".$templates->get("modcp_ipsearch_results")."\";");

Zeile 2677Zeile 2832

// Fetch filter options
if(!$mybb->input['ipaddress'])


// Fetch filter options
if(!$mybb->input['ipaddress'])

	{

	{

		$mybb->input['search_posts'] = 1;
$mybb->input['search_users'] = 1;
}
if($mybb->input['search_posts'])

		$mybb->input['search_posts'] = 1;
$mybb->input['search_users'] = 1;
}
if($mybb->input['search_posts'])

	{

	{

		$postsearchselect = "checked=\"checked\"";
}
if($mybb->input['search_users'])
{
$usersearchselect = "checked=\"checked\"";
}

		$postsearchselect = "checked=\"checked\"";
}
if($mybb->input['search_users'])
{
$usersearchselect = "checked=\"checked\"";
}

	



	$plugins->run_hooks("modcp_ipsearch_end");

eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";");

	$plugins->run_hooks("modcp_ipsearch_end");

eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";");

Zeile 2710Zeile 2865
			$ip_record = @geoip_record_by_name($mybb->input['ipaddress']);
if($ip_record)
{

			$ip_record = @geoip_record_by_name($mybb->input['ipaddress']);
if($ip_record)
{

				$ipaddress_location = htmlspecialchars_uni($ip_record['country_name']);

				$ipaddress_location = htmlspecialchars_uni(utf8_encode($ip_record['country_name']));

				if($ip_record['city'])
{

				if($ip_record['city'])
{

					$ipaddress_location .= $lang->comma.htmlspecialchars_uni($ip_record['city']);

					$ipaddress_location .= $lang->comma.htmlspecialchars_uni(utf8_encode($ip_record['city']));

				}

				}

			}
}


			}
}


		$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));

		$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));

		



		// gethostbyaddr returns the same ip on failure
if($ipaddress_host_name == $mybb->input['ipaddress'])
{
$ipaddress_host_name = $lang->na;
}
}

		// gethostbyaddr returns the same ip on failure
if($ipaddress_host_name == $mybb->input['ipaddress'])
{
$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')."\";");
output_page($iplookup);
}

	eval("\$iplookup = \"".$templates->get('modcp_ipsearch_misc_info')."\";");
output_page($iplookup);
}

Zeile 2747Zeile 2902
	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	}

	}


$query = $db->simple_select("banned", "COUNT(uid) AS count");
$banned_count = $db->fetch_field($query, "count");


$query = $db->simple_select("banned", "COUNT(uid) AS count");
$banned_count = $db->fetch_field($query, "count");

Zeile 2762Zeile 2917
	}

if($page > $pages || $page <= 0)

	}

if($page > $pages || $page <= 0)

	{
$page = 1;

	{
$page = 1;

	}

if($page)

	}

if($page)

Zeile 2782Zeile 2937
	{
eval("\$allbannedpages = \"".$templates->get("modcp_banning_multipage")."\";");
}

	{
eval("\$allbannedpages = \"".$templates->get("modcp_banning_multipage")."\";");
}

	



	$plugins->run_hooks("modcp_banning_start");

$query = $db->query("

	$plugins->run_hooks("modcp_banning_start");

$query = $db->query("

Zeile 2881Zeile 3036
	{
error_no_permission();
}

	{
error_no_permission();
}

	
$plugins->run_hooks("modcp_liftban_start");





$plugins->run_hooks("modcp_liftban_start");

$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");
$username = $db->fetch_field($query, "username");


$updated_group = array(
'usergroup' => $ban['oldgroup'],


$updated_group = array(
'usergroup' => $ban['oldgroup'],

Zeile 2894Zeile 3052

$cache->update_banned();
$cache->update_moderators();


$cache->update_banned();
$cache->update_moderators();

	


	log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);


	$plugins->run_hooks("modcp_liftban_end");

redirect("modcp.php?action=banning", $lang->redirect_banlifted);

	$plugins->run_hooks("modcp_liftban_end");

redirect("modcp.php?action=banning", $lang->redirect_banlifted);

Zeile 2931Zeile 3090
	else
{
// Get the users info from their Username

	else
{
// Get the users info from their Username

		$query = $db->simple_select("users", "uid, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));

		$query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));

		$user = $db->fetch_array($query);
if(!$user['uid'])
{

		$user = $db->fetch_array($query);
if(!$user['uid'])
{

Zeile 2942Zeile 3101
	if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_cannotbanself;

	if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_cannotbanself;

	}

	}


// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))
{
$errors[] = $lang->error_cannotbanuser;


// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))
{
$errors[] = $lang->error_cannotbanuser;

	}

	}


// Check for an incoming reason
if(!$mybb->input['banreason'])


// Check for an incoming reason
if(!$mybb->input['banreason'])

Zeile 2959Zeile 3118
	// Check banned group
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'");
if(!$db->fetch_field($query, "gid"))

	// Check banned group
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'");
if(!$db->fetch_field($query, "gid"))

	{

	{

		$errors[] = $lang->error_nobangroup;
}


		$errors[] = $lang->error_nobangroup;
}


Zeile 2972Zeile 3131
			$errors[] = $lang->error_useralreadybanned;
}
}

			$errors[] = $lang->error_useralreadybanned;
}
}

	



	$plugins->run_hooks("modcp_do_banuser_start");

// Still no errors? Ban the user

	$plugins->run_hooks("modcp_do_banuser_start");

// Still no errors? Ban the user

Zeile 2986Zeile 3145
		else
{
$lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']);

		else
{
$lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']);

		}

		}


if($mybb->input['uid'])
{


if($mybb->input['uid'])
{

 
			$username_select = $db->simple_select('users', 'username', "uid='" . (int)$mybb->input['uid'] . "'");
$user['username'] = $db->fetch_field($username_select, 'username');

			$update_array = array(

			$update_array = array(

				'gid' => intval($mybb->input['usergroup']),
'admin' => intval($mybb->user['uid']),
'dateline' => TIME_NOW,
'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])
);

				'gid' => intval($mybb->input['usergroup']),
'admin' => intval($mybb->user['uid']),
'dateline' => TIME_NOW,
'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])
);


$db->update_query('banned', $update_array, "uid='{$user['uid']}'");


$db->update_query('banned', $update_array, "uid='{$user['uid']}'");

		}
else
{

		}
else
{

			$insert_array = array(
'uid' => $user['uid'],
'gid' => intval($mybb->input['usergroup']),

			$insert_array = array(
'uid' => $user['uid'],
'gid' => intval($mybb->input['usergroup']),

Zeile 3017Zeile 3178
			);

$db->insert_query('banned', $insert_array);

			);

$db->insert_query('banned', $insert_array);

		}

		}


// Move the user to the banned group
$update_array = array(


// Move the user to the banned group
$update_array = array(

Zeile 3028Zeile 3189
		$db->update_query('users', $update_array, "uid = {$user['uid']}");

$cache->update_banned();

		$db->update_query('users', $update_array, "uid = {$user['uid']}");

$cache->update_banned();

		












// Log edit or add ban
if($mybb->input['uid'])
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);
}
else
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user);
}


		$plugins->run_hooks("modcp_do_banuser_end");

if($mybb->input['uid'])

		$plugins->run_hooks("modcp_do_banuser_end");

if($mybb->input['uid'])

Zeile 3059Zeile 3230
	{
add_breadcrumb($lang->mcp_nav_editing_ban);
}

	{
add_breadcrumb($lang->mcp_nav_editing_ban);
}

	



	$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban

	$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban

Zeile 3082Zeile 3253
			eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
}
}

			eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
}
}

	



	// New ban!
if(!$banuser_username)
{

	// New ban!
if(!$banuser_username)
{

Zeile 3128Zeile 3299
			$liftlist .= ">{$title} ({$thatime})</option>\n";
}
}

			$liftlist .= ">{$title} ({$thatime})</option>\n";
}
}

	



	$bangroups = '';
$query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1");
while($item = $db->fetch_array($query))

	$bangroups = '';
$query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1");
while($item = $db->fetch_array($query))

Zeile 3139Zeile 3310
			$selected = " selected=\"selected\"";
}
$bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n";

			$selected = " selected=\"selected\"";
}
$bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n";

	}


	}


	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";

	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";

	



	$plugins->run_hooks("modcp_banuser_end");

	$plugins->run_hooks("modcp_banuser_end");

	



	eval("\$banuser = \"".$templates->get("modcp_banuser")."\";");
output_page($banuser);
}

	eval("\$banuser = \"".$templates->get("modcp_banuser")."\";");
output_page($banuser);
}

Zeile 3153Zeile 3324
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

	



	$plugins->run_hooks("modcp_do_modnotes_start");

	$plugins->run_hooks("modcp_do_modnotes_start");

	



	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->input['modnotes']
);
$cache->update("modnotes", $update_cache);

	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->input['modnotes']
);
$cache->update("modnotes", $update_cache);

	



	$plugins->run_hooks("modcp_do_modnotes_end");

	$plugins->run_hooks("modcp_do_modnotes_end");

	



	redirect("modcp.php", $lang->redirect_modnotes);
}


	redirect("modcp.php", $lang->redirect_modnotes);
}


Zeile 3195Zeile 3366
		$attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']);
$attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);

		$attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']);
$attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);





		eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
}
else

		eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
}
else

Zeile 3265Zeile 3436
	else
{
$latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";

	else
{
$latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";

 
	}

$where = '';
if($tflist)
{
$where = "WHERE (t.fid <> 0 {$tflist}) OR (!l.fid)";

	}

$query = $db->query("

	}

$query = $db->query("

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)

		{$where}

		ORDER BY l.dateline DESC
LIMIT 5
");

		ORDER BY l.dateline DESC
LIMIT 5
");

 


	while($logitem = $db->fetch_array($query))
{
$information = '';

	while($logitem = $db->fetch_array($query))
{
$information = '';

 
		$logitem['action'] = htmlspecialchars_uni($logitem['action']);

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])

		{
$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
}

		{
$information = "<strong>{$lang->thread}:</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
}

		if($logitem['fname'])
{
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";
}

		if($logitem['fname'])
{
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";
}

		if($logitem['psubject'])
{
$information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";
}

// Edited a user?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])


// Edited a user or managed announcement?
if(!$logitem['tsubject'] || !$logitem['fname'])





		{
$data = unserialize($logitem['data']);
if($data['uid'])
{
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));

		{
$data = unserialize($logitem['data']);
if($data['uid'])
{
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));

 
			}
if($data['aid'])
{
$information = "<strong>{$lang->announcement}:</strong> <a href=\"".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";

			}
}


			}
}


Zeile 3390Zeile 3569

if(!$bannedusers)
{


if(!$bannedusers)
{

		eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";");

		eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";");

	}

	}





	$modnotes = $cache->read("modnotes");
$modnotes = htmlspecialchars_uni($modnotes['modmessage']);

	$modnotes = $cache->read("modnotes");
$modnotes = htmlspecialchars_uni($modnotes['modmessage']);

	



	$plugins->run_hooks("modcp_end");

	$plugins->run_hooks("modcp_end");





	eval("\$modcp = \"".$templates->get("modcp")."\";");
output_page($modcp);
}

	eval("\$modcp = \"".$templates->get("modcp")."\";");
output_page($modcp);
}



 
?>

?>