Vergleich warnings.php - 1.8.9 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 22Zeile 22
$parser = new postParser;

$lang->load("warnings");

$parser = new postParser;

$lang->load("warnings");

 
$lang->load("datahandler_warnings");


if($mybb->settings['enablewarningsystem'] == 0)
{


if($mybb->settings['enablewarningsystem'] == 0)
{

Zeile 51Zeile 52

$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));



$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));


	if(!$user['uid'])

	if(!$user)

	{
error($lang->error_invalid_user);
}

	{
error($lang->error_invalid_user);
}

Zeile 90Zeile 91
		$forum_permissions = forum_permissions($post['fid']);

if($forum_permissions['canview'] != 1)

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

if($forum_permissions['canview'] != 1)

		{

		{

			error_no_permission();
}
}


			error_no_permission();
}
}


	$warningshandler->set_data($warning);


	$warningshandler->set_data($warning);


	if($warningshandler->validate_warning())
{
$warninginfo = $warningshandler->insert_warning();

	if($warningshandler->validate_warning())
{
$warninginfo = $warningshandler->insert_warning();





		// Are we notifying the user?
if($mybb->get_input('send_pm', MyBB::INPUT_INT) == 1 && $group_permissions['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)
{

		// Are we notifying the user?
if($mybb->get_input('send_pm', MyBB::INPUT_INT) == 1 && $group_permissions['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)
{





			$pm = array(
'subject' => $mybb->get_input('pm_subject'),
'message' => $mybb->get_input('pm_message'),
'touid' => $user['uid']
);

			$pm = array(
'subject' => $mybb->get_input('pm_subject'),
'message' => $mybb->get_input('pm_message'),
'touid' => $user['uid']
);





			$sender_uid = $mybb->user['uid'];
if($mybb->settings['allowanonwarningpms'] == 1 && $mybb->get_input('pm_anonymous', MyBB::INPUT_INT))
{
$sender_uid = -1;

			$sender_uid = $mybb->user['uid'];
if($mybb->settings['allowanonwarningpms'] == 1 && $mybb->get_input('pm_anonymous', MyBB::INPUT_INT))
{
$sender_uid = -1;

 
				// Workaround for eliminating PHP warnings in PHP 8. Ref: https://github.com/mybb/mybb/issues/4630#issuecomment-1369144163
$pm['sender']['uid'] = -1;

			}

// Some kind of friendly error notification

			}

// Some kind of friendly error notification

Zeile 123Zeile 126
				$warningshandler->friendly_action .= $lang->redirect_warned_pmerror;
}
}

				$warningshandler->friendly_action .= $lang->redirect_warned_pmerror;
}
}

	



		$plugins->run_hooks("warnings_do_warn_end");

		$plugins->run_hooks("warnings_do_warn_end");





		$lang->redirect_warned = $lang->sprintf($lang->redirect_warned, htmlspecialchars_uni($user['username']), $warningshandler->new_warning_level, $warningshandler->friendly_action);

if(!empty($post['pid']))

		$lang->redirect_warned = $lang->sprintf($lang->redirect_warned, htmlspecialchars_uni($user['username']), $warningshandler->new_warning_level, $warningshandler->friendly_action);

if(!empty($post['pid']))

		{

		{

			redirect(get_post_link($post['pid']), $lang->redirect_warned);

			redirect(get_post_link($post['pid']), $lang->redirect_warned);

		}
else
{

		}
else
{

			redirect(get_profile_link($user['uid']), $lang->redirect_warned);
}
}

			redirect(get_profile_link($user['uid']), $lang->redirect_warned);
}
}

Zeile 230Zeile 233
			WHERE w.pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'
ORDER BY w.expired ASC, w.dateline DESC
");

			WHERE w.pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'
ORDER BY w.expired ASC, w.dateline DESC
");

		$first = true;

		$last_expired = -1;

		$warnings = '';
while($warning = $db->fetch_array($query))
{

		$warnings = '';
while($warning = $db->fetch_array($query))
{

			if($warning['expired'] != $last_expired || $first)

			if($warning['expired'] != $last_expired)

			{
if($warning['expired'] == 0)
{

			{
if($warning['expired'] == 0)
{

Zeile 246Zeile 249
				}
}
$last_expired = $warning['expired'];

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

			$first = false;

 

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


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

Zeile 274Zeile 276
				}
else
{

				}
else
{

					$expires = my_date($mybb->settings['dateformat'], $warning['expires']) . ", " . my_date($mybb->settings['timeformat'], $warning['expires']);

					$expires = nice_time($warning['expires']-TIME_NOW);

				}
}
else

				}
}
else

Zeile 299Zeile 301
	}

$plugins->run_hooks("warnings_warn_start");

	}

$plugins->run_hooks("warnings_warn_start");

	



	$type_checked = array('custom' => '');
$expires_period = array('hours' => '', 'days' => '', 'weeks' => '', 'months' => '', 'never' => '');
$send_pm_checked = '';

	$type_checked = array('custom' => '');
$expires_period = array('hours' => '', 'days' => '', 'weeks' => '', 'months' => '', 'never' => '');
$send_pm_checked = '';

Zeile 318Zeile 320
		if(!empty($mybb->input['send_pm']))
{
$send_pm_checked = "checked=\"checked\"";

		if(!empty($mybb->input['send_pm']))
{
$send_pm_checked = "checked=\"checked\"";

		}

		}

		$custom_reason = htmlspecialchars_uni($mybb->get_input('custom_reason'));
$custom_points = $mybb->get_input('custom_points', MyBB::INPUT_INT);
$expires = $mybb->get_input('expires', MyBB::INPUT_INT);

		$custom_reason = htmlspecialchars_uni($mybb->get_input('custom_reason'));
$custom_points = $mybb->get_input('custom_points', MyBB::INPUT_INT);
$expires = $mybb->get_input('expires', MyBB::INPUT_INT);

		if($mybb->get_input('expires_period', MyBB::INPUT_INT))

		if($mybb->get_input('expires_period'))

		{

		{

			$expires_period[$mybb->get_input('expires_period', MyBB::INPUT_INT)] = "selected=\"selected\"";

			$expires_period[$mybb->get_input('expires_period')] = "selected=\"selected\"";

		}
}
else

		}
}
else

Zeile 349Zeile 351
	}

if(!is_array($groupscache))

	}

if(!is_array($groupscache))

	{

	{

		$groupscache = $cache->read("usergroups");
}


		$groupscache = $cache->read("usergroups");
}


Zeile 378Zeile 380
				$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 582Zeile 584
	}

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

	}

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

	if(!$user)

	if(empty($user))

	{

	{

		$user['username'] = $lang->guest;

		$user = array('uid' => 0, 'username' => $lang->guest);

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


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


Zeile 597Zeile 599
	$plugins->run_hooks("warnings_view_start");

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

	$plugins->run_hooks("warnings_view_start");

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

	if($user['uid'])

	if(!empty($user['uid']))

	{
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_warning_log, "warnings.php?uid={$user['uid']}");

	{
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_warning_log, "warnings.php?uid={$user['uid']}");

Zeile 654Zeile 656
		}
else
{

		}
else
{

			$expires = my_date($mybb->settings['dateformat'], $warning['expires']) . ", " . my_date($mybb->settings['timeformat'], $warning['expires']);

			$expires = my_date('normal', $warning['expires']); // Purposely not using nice_time here as the moderator has clicked for more details so the actual day/time should be shown

		}
$status = $lang->warning_active;
}

		}
$status = $lang->warning_active;
}

Zeile 666Zeile 668
		}
else if($warning['expires'])
{

		}
else if($warning['expires'])
{

			$revoked_date = '('.my_date($mybb->settings['dateformat'], $warning['expires']).', '.my_date($mybb->settings['timeformat'], $warning['expires']).')';

			$revoked_date = '('.my_date('normal', $warning['expires']).')';

			$expires = $status = $lang->already_expired;
}
}

			$expires = $status = $lang->already_expired;
}
}

Zeile 708Zeile 710
	}

$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));

	}

$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));

	if(!$user['uid'])

	if(!$user)

	{
error($lang->error_invalid_user);
}

	{
error($lang->error_invalid_user);
}

Zeile 840Zeile 842
			}
else
{

			}
else
{

				$expires = my_date($mybb->settings['dateformat'], $warning['expires']) . ", " . my_date($mybb->settings['timeformat'], $warning['expires']);

				$expires = nice_time($warning['expires']-TIME_NOW);

			}
}
else

			}
}
else