Vergleich inc/functions_post.php - 1.8.7 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 90Zeile 90
			break;
case 3: // Announcement
global $announcementarray, $message;

			break;
case 3: // Announcement
global $announcementarray, $message;

			$parser_options['allow_html'] = $announcementarray['allowhtml'];

			$parser_options['allow_html'] = $mybb->settings['announcementshtml'] && $announcementarray['allowhtml'];

			$parser_options['allow_mycode'] = $announcementarray['allowmycode'];
$parser_options['allow_smilies'] = $announcementarray['allowsmilies'];
$parser_options['allow_imgcode'] = 1;

			$parser_options['allow_mycode'] = $announcementarray['allowmycode'];
$parser_options['allow_smilies'] = $announcementarray['allowsmilies'];
$parser_options['allow_imgcode'] = 1;

Zeile 110Zeile 110
			$parser_options['allow_imgcode'] = $forum['allowimgcode'];
$parser_options['allow_videocode'] = $forum['allowvideocode'];
$parser_options['filter_badwords'] = 1;

			$parser_options['allow_imgcode'] = $forum['allowimgcode'];
$parser_options['allow_videocode'] = $forum['allowvideocode'];
$parser_options['filter_badwords'] = 1;


if(!$post['username'])
{
$post['username'] = $lang->guest;
}

if($post['userusername'])
{
$parser_options['me_username'] = $post['userusername'];
}
else
{
$parser_options['me_username'] = $post['username'];
}

 
			break;

			break;

	}



















	}

if(!$post['username'])
{
$post['username'] = $lang->guest; // htmlspecialchars_uni'd below
}

if($post['userusername'])
{
$parser_options['me_username'] = $post['userusername'];
}
else
{
$parser_options['me_username'] = $post['username'];
}

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


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

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

Zeile 137Zeile 140
			}

$postcounter = $mybb->settings['postsperpage']*($page-1);

			}

$postcounter = $mybb->settings['postsperpage']*($page-1);

		}

		}

		else
{
$postcounter = 0;
}
$post_extra_style = "border-top-width: 0;";
}

		else
{
$postcounter = 0;
}
$post_extra_style = "border-top-width: 0;";
}

	elseif($mybb->input['mode'] == "threaded")
{
$post_extra_style = "border-top-width: 0;";
}
else

	elseif($mybb->input['mode'] == "threaded")
{
$post_extra_style = "border-top-width: 0;";
}
else

	{
$post_extra_style = "margin-top: 5px;";
}

	{
$post_extra_style = "margin-top: 5px;";
}

Zeile 183Zeile 186
	if($post['userusername'])
{
if(!$post['displaygroup'])

	if($post['userusername'])
{
if(!$post['displaygroup'])

		{

		{

			$post['displaygroup'] = $post['usergroup'];
}
$usergroup = $groupscache[$post['displaygroup']];

			$post['displaygroup'] = $post['usergroup'];
}
$usergroup = $groupscache[$post['displaygroup']];

Zeile 205Zeile 208
		}

if(is_array($titlescache))

		}

if(is_array($titlescache))

		{

		{

			krsort($titlescache);
}
unset($usertitle, $cached_titles);

			krsort($titlescache);
}
unset($usertitle, $cached_titles);

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


			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)

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

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

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

Zeile 388Zeile 391

// If we can warn them, it's not the same person, and we're in a PM or a post.
if($mybb->usergroup['canwarnusers'] != 0 && $post['uid'] != $mybb->user['uid'] && ($post_type == 0 || $post_type == 2))


// If we can warn them, it's not the same person, and we're in a PM or a post.
if($mybb->usergroup['canwarnusers'] != 0 && $post['uid'] != $mybb->user['uid'] && ($post_type == 0 || $post_type == 2))

			{

			{

				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
{
$post['button_warn'] = '';
$warning_link = "usercp.php";
}
eval("\$post['warninglevel'] = \"".$templates->get("postbit_warninglevel")."\";");

			else
{
$post['button_warn'] = '';
$warning_link = "usercp.php";
}
eval("\$post['warninglevel'] = \"".$templates->get("postbit_warninglevel")."\";");

		}


		}


		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')."\";");

Zeile 421Zeile 424
					$useropts = explode("\n", $post[$fieldfid]);

if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))

					$useropts = explode("\n", $post[$fieldfid]);

if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))

					{

					{

						foreach($useropts as $val)

						foreach($useropts as $val)

						{

						{

							if($val != '')
{
eval("\$post['fieldvalue_option'] .= \"".$templates->get("postbit_profilefield_multiselect_value")."\";");

							if($val != '')
{
eval("\$post['fieldvalue_option'] .= \"".$templates->get("postbit_profilefield_multiselect_value")."\";");

Zeile 432Zeile 435
						if($post['fieldvalue_option'] != '')
{
eval("\$post['fieldvalue'] .= \"".$templates->get("postbit_profilefield_multiselect")."\";");

						if($post['fieldvalue_option'] != '')
{
eval("\$post['fieldvalue'] .= \"".$templates->get("postbit_profilefield_multiselect")."\";");

						}

						}

					}
else
{

					}
else
{

Zeile 453Zeile 456
						else
{
$field_parser_options['nl2br'] = 0;

						else
{
$field_parser_options['nl2br'] = 0;

						}


						}


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

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

Zeile 477Zeile 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;





		$post['userregdate'] = $lang->na;
$post['postnum'] = $lang->na;
$post['button_profile'] = '';

		$post['userregdate'] = $lang->na;
$post['postnum'] = $lang->na;
$post['button_profile'] = '';

Zeile 498Zeile 501
		$post['onlinestatus'] = '';
$post['replink'] = '';
eval("\$post['user_details'] = \"".$templates->get("postbit_author_guest")."\";");

		$post['onlinestatus'] = '';
$post['replink'] = '';
eval("\$post['user_details'] = \"".$templates->get("postbit_author_guest")."\";");

	}



	}

$post['input_editreason'] = '';

	$post['button_edit'] = '';
$post['button_quickdelete'] = '';
$post['button_quickrestore'] = '';

	$post['button_edit'] = '';
$post['button_quickdelete'] = '';
$post['button_quickrestore'] = '';

Zeile 513Zeile 517

// For private messages, fetch the reply/forward/delete icons
if($post_type == 2 && $post['pmid'])


// For private messages, fetch the reply/forward/delete icons
if($post_type == 2 && $post['pmid'])

	{

	{

		global $replyall;

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

		global $replyall;

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





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

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

Zeile 533Zeile 537
		{
$forumpermissions = forum_permissions($fid);
}

		{
$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 553Zeile 558
		$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)
{

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

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


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


Zeile 627Zeile 633
		// Inline moderation stuff
if($ismod)
{

		// Inline moderation stuff
if($ismod)
{

			if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|".$post['pid']."|"))

			if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|".$post['pid']."|") !== false)

			{
$inlinecheck = "checked=\"checked\"";
$inlinecount++;

			{
$inlinecheck = "checked=\"checked\"";
$inlinecount++;

Zeile 697Zeile 703
			else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod']))
{
$action = 'getip';

			else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod']))
{
$action = 'getip';

 
				$javascript = 'getIP';


				if($post_type == 2)
{
$action = 'getpmip';

				if($post_type == 2)
{
$action = 'getpmip';

 
					$javascript = 'getPMIP';

				}

				}

 


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

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

		}
}
























		}
}

$post['poststatus'] = '';
if(!$post_type && $post['visible'] != 1)
{
if(is_moderator($fid, "canviewdeleted") && $postcounter != 1 && $post['visible'] == -1)
{
$status_type = $lang->postbit_post_deleted;
}
else if(is_moderator($fid, "canviewunapprove") && $postcounter != 1 && $post['visible'] == 0)
{
$status_type = $lang->postbit_post_unapproved;
}
else if(is_moderator($fid, "canviewdeleted") && $postcounter == 1 && $post['visible'] == -1)
{
$status_type = $lang->postbit_thread_deleted;
}
else if(is_moderator($fid, "canviewunapprove") && $postcounter == 1 && $post['visible'] == 0)
{
$status_type = $lang->postbit_thread_unapproved;
}

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


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


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

Zeile 745Zeile 778
			"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($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

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

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

		{

		{

			$sig_parser['allow_imgcode'] = 0;
}

			$sig_parser['allow_imgcode'] = 0;
}





		$post['signature'] = $parser->parse_message($post['signature'], $sig_parser);
eval("\$post['signature'] = \"".$templates->get("postbit_signature")."\";");

		$post['signature'] = $parser->parse_message($post['signature'], $sig_parser);
eval("\$post['signature'] = \"".$templates->get("postbit_signature")."\";");

	}

	}

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

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

	}

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

	}

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


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


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

Zeile 777Zeile 810
		$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$post['icon'] = \"".$templates->get("postbit_icon")."\";");

		$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$post['icon'] = \"".$templates->get("postbit_icon")."\";");

	}
else

	}
else

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


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


	$post_visibility = $ignore_bit = '';

	$post_visibility = $ignore_bit = $deleted_bit = '';

	switch($post_type)
{
case 1: // Message preview

	switch($post_type)
{
case 1: // Message preview

Zeile 791Zeile 824
			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;

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

Zeile 809Zeile 842
						$ignored_users[$uid] = 1;
}
}

						$ignored_users[$uid] = 1;
}
}

 
			}

// Has this post been deleted but can be viewed? Hide this post
if($post['visible'] == -1 && is_moderator($fid, "canviewdeleted"))
{
$deleted_message = $lang->sprintf($lang->postbit_deleted_post_user, $post['username']);
eval("\$deleted_bit = \"".$templates->get("postbit_deleted")."\";");
$post_visibility = "display: none;";

			}

// Is this author on the ignore list of the current user? Hide this post

			}

// 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)

			if(is_array($ignored_users) && $post['uid'] != 0 && isset($ignored_users[$post['uid']]) && $ignored_users[$post['uid']] == 1 && empty($deleted_bit))

			{
$ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']);
eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";");

			{
$ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']);
eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";");

Zeile 821Zeile 862
			break;
}


			break;
}


	if($mybb->settings['postlayout'] == "classic")

	if($forumpermissions['canviewdeletionnotice'] == 1 && $post['visible'] == -1 && $post_type == 0 && !is_moderator($fid, "canviewdeleted"))

	{

	{

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

		eval("\$postbit = \"".$templates->get("postbit_deleted_member")."\";");

	}
else
{

	}
else
{

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








		if($mybb->settings['postlayout'] == "classic")
{
eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
}
else
{
eval("\$postbit = \"".$templates->get("postbit")."\";");
}

	}

	}

 


	$GLOBALS['post'] = "";

return $postbit;

	$GLOBALS['post'] = "";

return $postbit;

Zeile 852Zeile 901
	{
$forumpermissions = forum_permissions($post['fid']);
}

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

Zeile 877Zeile 926
				{
$attachment['dateuploaded'] = $attachment['dateline'];
}

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

				$attachdate = my_date('relative', $attachment['dateuploaded']);

				$attachdate = my_date('normal', $attachment['dateuploaded']);

				// Support for [attachment=id] code
if(stripos($post['message'], "[attachment=".$attachment['aid']."]") !== false)
{

				// Support for [attachment=id] code
if(stripos($post['message'], "[attachment=".$attachment['aid']."]") !== false)
{