Vergleich inc/functions_post.php - 1.8.6 - 1.8.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 126Zeile 126
			}
break;
}

			}
break;
}

 

$post['username'] = htmlspecialchars_uni($post['username']);
$post['userusername'] = htmlspecialchars_uni($post['userusername']);


if(!$postcounter)
{ // Used to show the # of the post


if(!$postcounter)
{ // Used to show the # of the post

Zeile 265Zeile 268
				}
}
}

				}
}
}

		



		$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);

if($usergroup['stars'])

		$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);

if($usergroup['stars'])

		{

		{

			$post['stars'] = $usergroup['stars'];
}

if(empty($post['starimage']))
{
$post['starimage'] = $usergroup['starimage'];

			$post['stars'] = $usergroup['stars'];
}

if(empty($post['starimage']))
{
$post['starimage'] = $usergroup['starimage'];

		}


		}


		if($post['starimage'] && $post['stars'])
{
// Only display stars if we have an image to use...

		if($post['starimage'] && $post['stars'])
{
// Only display stars if we have an image to use...

Zeile 299Zeile 302
		// Determine the status to show for the user (Online/Offline/Away)
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];
if($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive'])

		// Determine the status to show for the user (Online/Offline/Away)
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];
if($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive'])

		{

		{

			eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";");
}
else

			eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";");
}
else

Zeile 319Zeile 322
		{
$useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']);
eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");

		{
$useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']);
eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");

		}

eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");

if($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false)





		}

$post['button_find'] = '';
if($mybb->usergroup['cansearch'] == 1)
{
eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");
}

if($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false)

		{
eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";");
}

$post['button_rep'] = '';

		{
eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";");
}

$post['button_rep'] = '';

		if($post_type != 3 && $mybb->settings['enablereputation'] == 1 && $mybb->settings['postrep'] == 1 && $mybb->usergroup['cangivereputations'] == 1 && $usergroup['usereputationsystem'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep']) && $post['uid'] != $mybb->user['uid'])

		if($post_type != 3 && $mybb->settings['enablereputation'] == 1 && $mybb->settings['postrep'] == 1 && $mybb->usergroup['cangivereputations'] == 1 && $usergroup['usereputationsystem'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep']) && $post['uid'] != $mybb->user['uid'] && (!isset($post['visible']) || $post['visible'] == 1) && (!isset($thread['visible']) || $thread['visible'] == 1))

		{
if(!$post['pid'])
{
$post['pid'] = 0;

		{
if(!$post['pid'])
{
$post['pid'] = 0;

			}


			}


			eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";");

			eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";");

		}

		}


if($post['website'] != "" && !is_member($mybb->settings['hidewebsite']) && $usergroup['canchangewebsite'] == 1)


if($post['website'] != "" && !is_member($mybb->settings['hidewebsite']) && $usergroup['canchangewebsite'] == 1)

		{

		{

			$post['website'] = htmlspecialchars_uni($post['website']);
eval("\$post['button_www'] = \"".$templates->get("postbit_www")."\";");
}

			$post['website'] = htmlspecialchars_uni($post['website']);
eval("\$post['button_www'] = \"".$templates->get("postbit_www")."\";");
}

		else
{
$post['button_www'] = "";
}

		else
{
$post['button_www'] = "";
}


if($post['hideemail'] != 1 && $mybb->usergroup['cansendemail'] == 1)


if($post['hideemail'] != 1 && $mybb->usergroup['cansendemail'] == 1)

		{

		{

			eval("\$post['button_email'] = \"".$templates->get("postbit_email")."\";");
}
else
{
$post['button_email'] = "";

			eval("\$post['button_email'] = \"".$templates->get("postbit_email")."\";");
}
else
{
$post['button_email'] = "";

		}

		}


$post['userregdate'] = my_date($mybb->settings['regdateformat'], $post['regdate']);



$post['userregdate'] = my_date($mybb->settings['regdateformat'], $post['regdate']);


Zeile 387Zeile 394
			{
eval("\$post['button_warn'] = \"".$templates->get("postbit_warn")."\";");
$warning_link = "warnings.php?uid={$post['uid']}";

			{
eval("\$post['button_warn'] = \"".$templates->get("postbit_warn")."\";");
$warning_link = "warnings.php?uid={$post['uid']}";

			}
else

			}
else

			{
$post['button_warn'] = '';
$warning_link = "usercp.php";

			{
$post['button_warn'] = '';
$warning_link = "usercp.php";

Zeile 399Zeile 406
		if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid']))
{
eval("\$post['button_purgespammer'] = \"".$templates->get('postbit_purgespammer')."\";");

		if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid']))
{
eval("\$post['button_purgespammer'] = \"".$templates->get('postbit_purgespammer')."\";");

		}

		}


// Display profile fields on posts - only if field is filled in
if(is_array($profile_fields))


// Display profile fields on posts - only if field is filled in
if(is_array($profile_fields))

Zeile 473Zeile 480
		if($usergroup['usertitle'])
{
$post['usertitle'] = $usergroup['usertitle'];

		if($usergroup['usertitle'])
{
$post['usertitle'] = $usergroup['usertitle'];

		}
else

		}
else

		{
$post['usertitle'] = $lang->guest;
}

		{
$post['usertitle'] = $lang->guest;
}

		



		$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);

$usergroup['title'] = $lang->na;

		$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);

$usergroup['title'] = $lang->na;

Zeile 517Zeile 524
		eval("\$post['button_delete_pm'] = \"".$templates->get("postbit_delete_pm")."\";");

if($replyall == true)

		eval("\$post['button_delete_pm'] = \"".$templates->get("postbit_delete_pm")."\";");

if($replyall == true)

		{

		{

			eval("\$post['button_replyall_pm'] = \"".$templates->get("postbit_replyall_pm")."\";");

			eval("\$post['button_replyall_pm'] = \"".$templates->get("postbit_replyall_pm")."\";");

		}

		}

	}

$post['editedmsg'] = '';
if(!$post_type)
{

	}

$post['editedmsg'] = '';
if(!$post_type)
{

 
		if(!isset($forumpermissions))
{
$forumpermissions = forum_permissions($fid);
}


		// Figure out if we need to show an "edited by" message
if($post['edituid'] != 0 && $post['edittime'] != 0 && $post['editusername'] != "" && (($mybb->settings['showeditedby'] != 0 && $usergroup['cancp'] == 0) || ($mybb->settings['showeditedbyadmin'] != 0 && $usergroup['cancp'] == 1)))
{
$post['editdate'] = my_date('relative', $post['edittime']);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

		// Figure out if we need to show an "edited by" message
if($post['edituid'] != 0 && $post['edittime'] != 0 && $post['editusername'] != "" && (($mybb->settings['showeditedby'] != 0 && $usergroup['cancp'] == 0) || ($mybb->settings['showeditedbyadmin'] != 0 && $usergroup['cancp'] == 1)))
{
$post['editdate'] = my_date('relative', $post['edittime']);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

 
			$post['editusername'] = htmlspecialchars_uni($post['editusername']);

			$post['editedprofilelink'] = build_profile_link($post['editusername'], $post['edituid']);
$editreason = "";
if($post['editreason'] != "")

			$post['editedprofilelink'] = build_profile_link($post['editusername'], $post['edituid']);
$editreason = "";
if($post['editreason'] != "")

Zeile 539Zeile 552
				eval("\$editreason = \"".$templates->get("postbit_editedby_editreason")."\";");
}
eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");

				eval("\$editreason = \"".$templates->get("postbit_editedby_editreason")."\";");
}
eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");

		}

		}


$time = TIME_NOW;
if((is_moderator($fid, "caneditposts") || ($forumpermissions['caneditposts'] == 1 && $mybb->user['uid'] == $post['uid'] && $thread['closed'] != 1 && ($mybb->usergroup['edittimelimit'] == 0 || $mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] > ($time-($mybb->usergroup['edittimelimit']*60))))) && $mybb->user['uid'] != 0)


$time = TIME_NOW;
if((is_moderator($fid, "caneditposts") || ($forumpermissions['caneditposts'] == 1 && $mybb->user['uid'] == $post['uid'] && $thread['closed'] != 1 && ($mybb->usergroup['edittimelimit'] == 0 || $mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] > ($time-($mybb->usergroup['edittimelimit']*60))))) && $mybb->user['uid'] != 0)

Zeile 558Zeile 571
			else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
{
$can_delete_post = 1;

			else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
{
$can_delete_post = 1;

			}
}


			}
}


		$postbit_qdelete = $postbit_qrestore = '';
if($mybb->user['uid'] != 0)
{
if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1)
{
$postbit_qdelete = $lang->postbit_qdelete_post;

		$postbit_qdelete = $postbit_qrestore = '';
if($mybb->user['uid'] != 0)
{
if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1)
{
$postbit_qdelete = $lang->postbit_qdelete_post;

				$display = '';
if($post['visible'] == -1)
{
$display = "none";
}

				$display = '';
if($post['visible'] == -1)
{
$display = "none";
}

				eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
}
else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)

				eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
}
else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)

Zeile 608Zeile 621
				$postbit_qrestore = $lang->postbit_qrestore_thread;
eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";");
}

				$postbit_qrestore = $lang->postbit_qrestore_thread;
eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";");
}

 
		}

if(!isset($ismod))
{
$ismod = is_moderator($fid);

		}

// Inline moderation stuff

		}

// Inline moderation stuff

Zeile 647Zeile 665
		if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1) && ($thread['closed'] != 1 || is_moderator($fid, "canpostclosedthreads")) && $mybb->settings['multiquote'] != 0 && $forum['open'] != 0 && !$post_type)
{
eval("\$post['button_multiquote'] = \"".$templates->get("postbit_multiquote")."\";");

		if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1) && ($thread['closed'] != 1 || is_moderator($fid, "canpostclosedthreads")) && $mybb->settings['multiquote'] != 0 && $forum['open'] != 0 && !$post_type)
{
eval("\$post['button_multiquote'] = \"".$templates->get("postbit_multiquote")."\";");

		}

		}


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


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

Zeile 669Zeile 687

// Show post IP addresses... PMs now can have IP addresses too as of 1.8!
if($post_type == 2)


// Show post IP addresses... PMs now can have IP addresses too as of 1.8!
if($post_type == 2)

	{

	{

		$show_ips = $mybb->settings['showpmip'];
}
if(!$post_type || $post_type == 2)

		$show_ips = $mybb->settings['showpmip'];
}
if(!$post_type || $post_type == 2)

Zeile 690Zeile 708
				eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_hiden")."\";");
}
}

				eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_hiden")."\";");
}
}

	}


	}


	if(isset($post['smilieoff']) && $post['smilieoff'] == 1)

	if(isset($post['smilieoff']) && $post['smilieoff'] == 1)

	{

	{

		$parser_options['allow_smilies'] = 0;

		$parser_options['allow_smilies'] = 0;

	}


	}


	if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_imgcode'] = 0;

	if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_imgcode'] = 0;

	}


	}


	if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

	if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

	{

	{

		$parser_options['allow_videocode'] = 0;
}


		$parser_options['allow_videocode'] = 0;
}


Zeile 712Zeile 730
	{
$parser_options['highlight'] = $mybb->input['highlight'];
$post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);

	{
$parser_options['highlight'] = $mybb->input['highlight'];
$post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);

	}

	}


$post['message'] = $parser->parse_message($post['message'], $parser_options);



$post['message'] = $parser->parse_message($post['message'], $parser_options);


Zeile 731Zeile 749
			"allow_mycode" => $mybb->settings['sigmycode'],
"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],

			"allow_mycode" => $mybb->settings['sigmycode'],
"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],

			"me_username" => $post['username'],

			"me_username" => $parser_options['me_username'],

			"filter_badwords" => 1
);

			"filter_badwords" => 1
);





		if($usergroup['signofollow'])
{
$sig_parser['nofollow_on'] = 1;

		if($usergroup['signofollow'])
{
$sig_parser['nofollow_on'] = 1;

Zeile 756Zeile 774
	$icon_cache = $cache->read("posticons");

if(isset($post['icon']) && $post['icon'] > 0 && $icon_cache[$post['icon']])

	$icon_cache = $cache->read("posticons");

if(isset($post['icon']) && $post['icon'] > 0 && $icon_cache[$post['icon']])

	{

	{

		$icon = $icon_cache[$post['icon']];

$icon['path'] = htmlspecialchars_uni($icon['path']);

		$icon = $icon_cache[$post['icon']];

$icon['path'] = htmlspecialchars_uni($icon['path']);

Zeile 767Zeile 785
	else
{
$post['icon'] = "";

	else
{
$post['icon'] = "";

	}

	}


$post_visibility = $ignore_bit = '';
switch($post_type)


$post_visibility = $ignore_bit = '';
switch($post_type)

Zeile 777Zeile 795
			break;
case 2: // Private message
$post = $plugins->run_hooks("postbit_pm", $post);

			break;
case 2: // Private message
$post = $plugins->run_hooks("postbit_pm", $post);

			break;

			break;

		case 3: // Announcement
$post = $plugins->run_hooks("postbit_announcement", $post);
break;
default: // Regular post
$post = $plugins->run_hooks("postbit", $post);

		case 3: // Announcement
$post = $plugins->run_hooks("postbit_announcement", $post);
break;
default: // Regular post
$post = $plugins->run_hooks("postbit", $post);

 

if(!isset($ignored_users))
{
$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")
{
$ignore_list = explode(',', $mybb->user['ignorelist']);
foreach($ignore_list as $uid)
{
$ignored_users[$uid] = 1;
}
}
}


// Is this author on the ignore list of the current user? Hide this post
if(is_array($ignored_users) && $post['uid'] != 0 && isset($ignored_users[$post['uid']]) && $ignored_users[$post['uid']] == 1)


// Is this author on the ignore list of the current user? Hide this post
if(is_array($ignored_users) && $post['uid'] != 0 && isset($ignored_users[$post['uid']]) && $ignored_users[$post['uid']] == 1)

Zeile 799Zeile 830
		eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
}
else

		eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
}
else

	{

	{

		eval("\$postbit = \"".$templates->get("postbit")."\";");
}
$GLOBALS['post'] = "";

		eval("\$postbit = \"".$templates->get("postbit")."\";");
}
$GLOBALS['post'] = "";

Zeile 821Zeile 852
	$validationcount = 0;
$tcount = 0;
$post['attachmentlist'] = $post['thumblist'] = $post['imagelist'] = '';

	$validationcount = 0;
$tcount = 0;
$post['attachmentlist'] = $post['thumblist'] = $post['imagelist'] = '';

 
	if(!isset($forumpermissions))
{
$forumpermissions = forum_permissions($post['fid']);
}


	if(isset($attachcache[$id]) && is_array($attachcache[$id]))
{ // This post has 1 or more attachments
foreach($attachcache[$id] as $aid => $attachment)

	if(isset($attachcache[$id]) && is_array($attachcache[$id]))
{ // This post has 1 or more attachments
foreach($attachcache[$id] as $aid => $attachment)