Vergleich inc/functions_modcp.php - 1.8.6 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 41Zeile 41
 */
function fetch_forum_announcements($pid=0, $depth=1)
{

 */
function fetch_forum_announcements($pid=0, $depth=1)
{

	global $mybb, $db, $lang, $theme, $announcements, $templates, $announcements_forum, $moderated_forums, $unviewableforums;

	global $mybb, $db, $lang, $theme, $announcements, $templates, $announcements_forum, $moderated_forums, $unviewableforums, $parser;

	static $forums_by_parent, $forum_cache, $parent_forums;

if(!is_array($forum_cache))

	static $forums_by_parent, $forum_cache, $parent_forums;

if(!is_array($forum_cache))

Zeile 118Zeile 118
							eval("\$icon = \"".$templates->get("modcp_announcements_announcement_active")."\";");
}


							eval("\$icon = \"".$templates->get("modcp_announcements_announcement_active")."\";");
}


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

						$subject = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));


eval("\$announcements_forum .= \"".$templates->get("modcp_announcements_announcement")."\";");
}


eval("\$announcements_forum .= \"".$templates->get("modcp_announcements_announcement")."\";");
}

Zeile 143Zeile 143
 */
function send_report($report, $report_type='post')
{

 */
function send_report($report, $report_type='post')
{

	global $db, $lang, $forum, $mybb, $post, $thread, $reputation, $user;

	global $db, $lang, $forum, $mybb, $post, $thread, $reputation, $user, $plugins;





	$nummods = false;
if(!empty($forum['parentlist']))

	$report_reason = '';
if($report['reasonid'])

	{

	{

		$query = $db->query("
SELECT DISTINCT u.username, u.email, u.receivepms, u.uid
FROM ".TABLE_PREFIX."moderators m
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=m.id)
WHERE m.fid IN (".$forum['parentlist'].") AND m.isgroup = '0'
");

$nummods = $db->num_rows($query);




		$query = $db->simple_select("reportreasons", "title", "rid = '".(int)$report['reasonid']."'", array('limit' => 1));
$reason = $db->fetch_array($query);

$lang->load('report');

$report_reason = $lang->parse($reason['title']);
}

if($report['reason'])
{
$report_reason = $lang->sprintf($lang->email_report_comment_extra, $report_reason, $report['reason']);

	}


	}


	if(!$nummods)


	$modsjoin = $modswhere = '';
if(!empty($forum['parentlist']))

	{

	{

		unset($query);
switch($db->type)






		$modswhere = "m.fid IN ({$forum['parentlist']}) OR ";

if($db->type == 'pgsql' || $db->type == 'sqlite')
{
$modsjoin = "LEFT JOIN {$db->table_prefix}moderators m ON (m.id = u.uid AND m.isgroup = 0) OR ((m.id = u.usergroup OR ',' || u.additionalgroups || ',' LIKE '%,' || m.id || ',%') AND m.isgroup = 1)";
}
else

		{

		{

			case "pgsql":
case "sqlite":
$query = $db->query("
SELECT u.username, u.email, u.receivepms, u.uid
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
WHERE (g.cancp=1 OR g.issupermod=1)
");
break;
default:
$query = $db->query("
SELECT u.username, u.email, u.receivepms, u.uid
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (((CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%')) OR u.usergroup = g.gid))
WHERE (g.cancp=1 OR g.issupermod=1)
");

			$modsjoin = "LEFT JOIN {$db->table_prefix}moderators m ON (m.id = u.uid AND m.isgroup = 0) OR ((m.id = u.usergroup OR CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', m.id, ',%')) AND m.isgroup = 1)";
















		}

		}

	}
























	}

switch($db->type)
{
case "pgsql":
case "sqlite":
$query = $db->query("
SELECT DISTINCT u.username, u.email, u.receivepms, u.uid
FROM {$db->table_prefix}users u
{$modsjoin}
LEFT JOIN {$db->table_prefix}usergroups g ON (',' || u.additionalgroups || ',' LIKE '%,' || g.gid || ',%' OR g.gid = u.usergroup)
WHERE {$modswhere}g.cancp = 1 OR g.issupermod = 1
");
break;
default:
$query = $db->query("
SELECT DISTINCT u.username, u.email, u.receivepms, u.uid
FROM {$db->table_prefix}users u
{$modsjoin}
LEFT JOIN {$db->table_prefix}usergroups g ON (CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%') OR g.gid = u.usergroup)
WHERE {$modswhere}g.cancp = 1 OR g.issupermod = 1
");
}


	$lang_string_subject = "emailsubject_report{$report_type}";
$lang_string_message = "email_report{$report_type}";

if(empty($lang->$lang_string_subject) || empty($lang->$lang_string_message))

	$lang_string_subject = "emailsubject_report{$report_type}";
$lang_string_message = "email_report{$report_type}";

if(empty($lang->$lang_string_subject) || empty($lang->$lang_string_message))

	{

	{

		return false;

		return false;

	}

global $send_report_subject, $send_report_url;


	}

global $send_report_subject, $send_report_url;


	switch($report_type)
{
case 'post':

	switch($report_type)
{
case 'post':

Zeile 201Zeile 217
		case 'profile':
$send_report_subject = $user['username'];
$send_report_url = str_replace('&', '&', get_profile_link($user['uid']));

		case 'profile':
$send_report_subject = $user['username'];
$send_report_url = str_replace('&', '&', get_profile_link($user['uid']));

			break;

			break;

		case 'reputation':
$from_user = get_user($reputation['adduid']);
$send_report_subject = $from_user['username'];

		case 'reputation':
$from_user = get_user($reputation['adduid']);
$send_report_subject = $from_user['username'];

Zeile 209Zeile 225
			break;
}


			break;
}


	$emailsubject = $lang->sprintf($lang->$lang_string_subject, $mybb->settings['bbname']);
$emailmessage = $lang->sprintf($lang->$lang_string_message, $mybb->user['username'], $mybb->settings['bbname'], $send_report_subject, $mybb->settings['bburl'], $send_report_url, $report['reason']);

	$plugins->run_hooks("send_report_report_type");






 
	$emailsubject = $lang->sprintf($lang->$lang_string_subject, $mybb->settings['bbname']);
$emailmessage = $lang->sprintf($lang->$lang_string_message, $mybb->user['username'], $mybb->settings['bbname'], $send_report_subject, $mybb->settings['bburl'], $send_report_url, $report_reason);
$pm_recipients = array();


	while($mod = $db->fetch_array($query))
{
if($mybb->settings['reportmethod'] == "pms" && $mod['receivepms'] != 0 && $mybb->settings['enablepms'] != 0)

	while($mod = $db->fetch_array($query))
{
if($mybb->settings['reportmethod'] == "pms" && $mod['receivepms'] != 0 && $mybb->settings['enablepms'] != 0)

Zeile 273Zeile 292
		'id3' => (int)$report['id3'],
'uid' => (int)$report['uid'],
'reportstatus' => 0,

		'id3' => (int)$report['id3'],
'uid' => (int)$report['uid'],
'reportstatus' => 0,

 
		'reasonid' => (int)$report['reasonid'],

		'reason' => $db->escape_string($report['reason']),
'type' => $db->escape_string($type),
'reports' => 1,

		'reason' => $db->escape_string($report['reason']),
'type' => $db->escape_string($type),
'reports' => 1,

Zeile 283Zeile 303

if($mybb->settings['reportmethod'] == "email" || $mybb->settings['reportmethod'] == "pms")
{


if($mybb->settings['reportmethod'] == "email" || $mybb->settings['reportmethod'] == "pms")
{

		return send_report($report, $type);

		send_report($report, $type);

	}

$rid = $db->insert_query("reportedcontent", $insert_array);

	}

$rid = $db->insert_query("reportedcontent", $insert_array);