Vergleich warnings.php - 1.8.6 - 1.8.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'warnings.php');


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


$templatelist = "warnings,warnings_warn_post,warnings_active_header,warnings_expired_header,warnings_warning,warnings_warn_existing,warnings_warn_type,warnings_warn_custom,warnings_warn_pm";
$templatelist .= ",warnings_view_post,warnings_view_user,warnings_view_revoke,warnings_view_revoked,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert,warnings_warn_type_result";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,warnings_no_warnings,codebuttons,warnings_warn,warnings_view,warnings_warn_pm_anonymous";

$templatelist = "warnings,warnings_warn_post,warnings_active_header,warnings_expired_header,warnings_warning,warnings_warn_existing,warnings_warn_type,warnings_warn_custom,warnings_warn_pm,warnings_view";
$templatelist .= ",warnings_view_post,warnings_view_user,warnings_view_revoke,warnings_view_revoked,warnings_warn_type_result,warnings_postlink,codebuttons,warnings_warn,warnings_warn_pm_anonymous";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,warnings_no_warnings";


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


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

Zeile 161Zeile 161
		$given_today = $db->fetch_field($query, "given_today");
if($given_today >= $mybb->usergroup['maxwarningsday'])
{

		$given_today = $db->fetch_field($query, "given_today");
if($given_today >= $mybb->usergroup['maxwarningsday'])
{

			error($lang->sprintf($lang->reached_max_warnings_day, $mybb->usergroup['maxwarningsday']));

			error($lang->sprintf($lang->warnings_reached_max_warnings_day, $mybb->usergroup['maxwarningsday']));

		}
}


		}
}


Zeile 173Zeile 173

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


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

		error($lang->cannot_warn_self);

		error($lang->warnings_error_cannot_warn_self);

	}

if($user['warningpoints'] >= $mybb->settings['maxwarningpoints'])
{

	}

if($user['warningpoints'] >= $mybb->settings['maxwarningpoints'])
{

		error($lang->user_reached_max_warning);

		error($lang->warnings_error_user_reached_max_warning);

	}

$group_permissions = user_permissions($user['uid']);

	}

$group_permissions = user_permissions($user['uid']);

Zeile 207Zeile 207

if(!$post || !$thread)
{


if(!$post || !$thread)
{

			error($lang->error_invalid_post);

			error($lang->warnings_error_invalid_post);

		}

$forum_permissions = forum_permissions($thread['fid']);

		}

$forum_permissions = forum_permissions($thread['fid']);

Zeile 249Zeile 249
			$first = false;

$post_link = "";

			$first = false;

$post_link = "";

 
			$warning['username'] = htmlspecialchars_uni($warning['username']);

			$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date('relative', $warning['dateline']);
if($warning['type_title'])

			$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date('relative', $warning['dateline']);
if($warning['type_title'])

Zeile 304Zeile 305
	$send_pm_checked = '';

// Coming here from failed do_warn?

	$send_pm_checked = '';

// Coming here from failed do_warn?

 
	$user['username'] = htmlspecialchars_uni($user['username']);

	if(!empty($warn_errors))
{
$notes = htmlspecialchars_uni($mybb->get_input('notes'));

	if(!empty($warn_errors))
{
$notes = htmlspecialchars_uni($mybb->get_input('notes'));

Zeile 344Zeile 346
	if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

	if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

 
	}

if(!is_array($groupscache))
{
$groupscache = $cache->read("usergroups");

	}

$current_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);

	}

$current_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);

Zeile 371Zeile 378
				$level['friendly_action'] = $lang->sprintf($lang->result_banned, $group_name, $period);
break;
case 2:

				$level['friendly_action'] = $lang->sprintf($lang->result_banned, $group_name, $period);
break;
case 2:

				if($level['action']['length'] > 0)
{
$period = fetch_friendly_expiration($level['action']['length']);
$lang_str = "expiration_".$period['period'];

				if($level['action']['length'] > 0)
{
$period = fetch_friendly_expiration($level['action']['length']);
$lang_str = "expiration_".$period['period'];

					$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);
}
else

					$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);
}
else

Zeile 388Zeile 395
				{
$period = fetch_friendly_expiration($level['action']['length']);
$lang_str = "expiration_".$period['period'];

				{
$period = fetch_friendly_expiration($level['action']['length']);
$lang_str = "expiration_".$period['period'];

					$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);

					$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);

				}
else
{

				}
else
{

Zeile 402Zeile 409
	krsort($levels);

$types = '';

	krsort($levels);

$types = '';





	// Fetch all current warning types
$query = $db->simple_select("warningtypes", "*", "", array("order_by" => "title"));
while($type = $db->fetch_array($query))
{
if(!isset($type_checked[$type['tid']]))

	// Fetch all current warning types
$query = $db->simple_select("warningtypes", "*", "", array("order_by" => "title"));
while($type = $db->fetch_array($query))
{
if(!isset($type_checked[$type['tid']]))

		{

		{

			$type_checked[$type['tid']] = '';
}
$checked = $type_checked[$type['tid']];
$type['title'] = htmlspecialchars_uni($type['title']);
$new_warning_level = round(($user['warningpoints']+$type['points'])/$mybb->settings['maxwarningpoints']*100);
if($new_warning_level > 100)

			$type_checked[$type['tid']] = '';
}
$checked = $type_checked[$type['tid']];
$type['title'] = htmlspecialchars_uni($type['title']);
$new_warning_level = round(($user['warningpoints']+$type['points'])/$mybb->settings['maxwarningpoints']*100);
if($new_warning_level > 100)

		{

		{

			$new_warning_level = 100;
}
if($type['points'] > 0)

			$new_warning_level = 100;
}
if($type['points'] > 0)

Zeile 456Zeile 463
		}

eval("\$custom_warning = \"".$templates->get("warnings_warn_custom")."\";");

		}

eval("\$custom_warning = \"".$templates->get("warnings_warn_custom")."\";");

	}

$pm_notify = '';


	}

$pm_notify = '';


	if($group_permissions['canusepms']  != 0 && $mybb->user['receivepms'] != 0 && $mybb->settings['enablepms'] != 0)
{
$smilieinserter = $codebuttons = "";

	if($group_permissions['canusepms']  != 0 && $mybb->user['receivepms'] != 0 && $mybb->settings['enablepms'] != 0)
{
$smilieinserter = $codebuttons = "";

Zeile 481Zeile 488
			{
$checked = ' checked="checked"';
}

			{
$checked = ' checked="checked"';
}





			eval('$anonymous_pm = "'.$templates->get('warnings_warn_pm_anonymous').'";');
}


			eval('$anonymous_pm = "'.$templates->get('warnings_warn_pm_anonymous').'";');
}


Zeile 502Zeile 509
	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canwarnusers'] != 1)

	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canwarnusers'] != 1)

	{

	{

		error_no_permission();
}

		error_no_permission();
}





	$warning = $warningshandler->get($mybb->input['wid']);

if(!$warning)

	$warning = $warningshandler->get($mybb->input['wid']);

if(!$warning)

	{

	{

		error($lang->error_invalid_warning);

		error($lang->error_invalid_warning);

	}

	}

	else if($warning['daterevoked'])
{
error($lang->warning_already_revoked);

	else if($warning['daterevoked'])
{
error($lang->warning_already_revoked);

	}


	}


	$user = get_user($warning['uid']);

$group_permissions = user_permissions($user['uid']);
if($group_permissions['canreceivewarnings'] != 1)
{
error($lang->error_cant_warn_group);

	$user = get_user($warning['uid']);

$group_permissions = user_permissions($user['uid']);
if($group_permissions['canreceivewarnings'] != 1)
{
error($lang->error_cant_warn_group);

	}

	}


$plugins->run_hooks("warnings_do_revoke_start");



$plugins->run_hooks("warnings_do_revoke_start");


Zeile 544Zeile 551
		);

$warningshandler->set_data($warning_data);

		);

$warningshandler->set_data($warning_data);





		$warningshandler->update_warning();

redirect("warnings.php?action=view&wid={$warning['wid']}", $lang->redirect_warning_revoked);

		$warningshandler->update_warning();

redirect("warnings.php?action=view&wid={$warning['wid']}", $lang->redirect_warning_revoked);

Zeile 558Zeile 565
	{
error_no_permission();
}

	{
error_no_permission();
}





	$query = $db->query("
SELECT w.*, t.title AS type_title, u.username, p.subject AS post_subject
FROM ".TABLE_PREFIX."warnings w

	$query = $db->query("
SELECT w.*, t.title AS type_title, u.username, p.subject AS post_subject
FROM ".TABLE_PREFIX."warnings w

Zeile 572Zeile 579
	if(!$warning)
{
error($lang->error_invalid_warning);

	if(!$warning)
{
error($lang->error_invalid_warning);

	}

	}


$user = get_user((int)$warning['uid']);
if(!$user)
{
$user['username'] = $lang->guest;
}


$user = get_user((int)$warning['uid']);
if(!$user)
{
$user['username'] = $lang->guest;
}

 
	$user['username'] = htmlspecialchars_uni($user['username']);


$group_permissions = user_permissions($user['uid']);
if($group_permissions['canreceivewarnings'] != 1)


$group_permissions = user_permissions($user['uid']);
if($group_permissions['canreceivewarnings'] != 1)

Zeile 616Zeile 624
		eval("\$warning_info = \"".$templates->get("warnings_view_user")."\";");
}


		eval("\$warning_info = \"".$templates->get("warnings_view_user")."\";");
}


 
	$warning['username'] = htmlspecialchars_uni($warning['username']);

	$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$notes = nl2br(htmlspecialchars_uni($warning['notes']));


	$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$notes = nl2br(htmlspecialchars_uni($warning['notes']));


Zeile 678Zeile 687
		{
$revoked_user['username'] = $lang->guest;
}

		{
$revoked_user['username'] = $lang->guest;
}

 
		$revoked_user['username'] = htmlspecialchars_uni($revoked_user['username']);

		$revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid']);
$revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));
eval("\$revoke = \"".$templates->get("warnings_view_revoked")."\";");

		$revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid']);
$revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));
eval("\$revoke = \"".$templates->get("warnings_view_revoked")."\";");

Zeile 709Zeile 719
		error($lang->error_cant_warn_group);
}


		error($lang->error_cant_warn_group);
}


 
	$user['username'] = htmlspecialchars_uni($user['username']);

	$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_warning_log);

	$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_warning_log);

Zeile 795Zeile 806
		}
$last_expired = $warning['expired'];


		}
$last_expired = $warning['expired'];


		$post_link = "";

		$post_link = '';

		if($warning['post_subject'])
{
$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);

		if($warning['post_subject'])
{
$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);

			$post_link = "<br /><small>{$lang->warning_for_post} <a href=\"".get_post_link($warning['pid'])."#pid{$warning['pid']}\">{$warning['post_subject']}</a></small>";


			$warning['post_link'] = get_post_link($warning['pid']);
eval("\$post_link = \"".$templates->get("warnings_postlink")."\";");

		}

		}

 

$warning['username'] = htmlspecialchars_uni($warning['username']);

		$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date('relative', $warning['dateline']);
if($warning['type_title'])

		$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date('relative', $warning['dateline']);
if($warning['type_title'])