Vergleich inc/functions_post.php - 1.8.10 - 1.8.19

  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['username'] = htmlspecialchars_uni($post['username']);

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

	$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 142Zeile 142
			$postcounter = $mybb->settings['postsperpage']*($page-1);
}
else

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

		{

		{

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

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

Zeile 183Zeile 183
	$post['subject_title'] = $post['subject'];

// Get the usergroup

	$post['subject_title'] = $post['subject'];

// Get the usergroup

	if($post['userusername'])

	if($post['usergroup'])

	{

	{

		if(!$post['displaygroup'])
{
$post['displaygroup'] = $post['usergroup'];
}
$usergroup = $groupscache[$post['displaygroup']];
}

		$usergroup = usergroup_permissions($post['usergroup']);
}





	else
{

	else
{

		$usergroup = $groupscache[1];















		$usergroup = usergroup_permissions(1);
}

// Fetch display group data.
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$post['displaygroup'])
{
$post['displaygroup'] = $post['usergroup'];
}

$displaygroup = usergroup_displaygroup($post['displaygroup']);
if(is_array($displaygroup))
{
$usergroup = array_merge($usergroup, $displaygroup);

	}

if(!is_array($titlescache))

	}

if(!is_array($titlescache))

Zeile 227Zeile 237
		$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']);
$usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']);
eval("\$post['groupimage'] = \"".$templates->get("postbit_groupimage")."\";");

		$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']);
$usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']);
eval("\$post['groupimage'] = \"".$templates->get("postbit_groupimage")."\";");


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


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

		{
$post['groupimage'] .= "<br />";
}

		{
$post['groupimage'] .= "<br />";
}

Zeile 448Zeile 458
							#"nofollow_on" => 1,
"filter_badwords" => 1
);

							#"nofollow_on" => 1,
"filter_badwords" => 1
);





						if($customfield['type'] == "textarea")

						if($customfield['type'] == "textarea")

						{

						{

							$field_parser_options['me_username'] = $post['username'];

							$field_parser_options['me_username'] = $post['username'];

						}

						}

						else

						else

						{

						{

							$field_parser_options['nl2br'] = 0;
}


							$field_parser_options['nl2br'] = 0;
}


Zeile 462Zeile 472
						{
$field_parser_options['allow_imgcode'] = 0;
}

						{
$field_parser_options['allow_imgcode'] = 0;
}





						$post['fieldvalue'] = $parser->parse_message($post[$fieldfid], $field_parser_options);
}


						$post['fieldvalue'] = $parser->parse_message($post[$fieldfid], $field_parser_options);
}


Zeile 476Zeile 486
	else
{ // Message was posted by a guest or an unknown user
$post['profilelink'] = format_name($post['username'], 1);

	else
{ // Message was posted by a guest or an unknown user
$post['profilelink'] = format_name($post['username'], 1);





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

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

Zeile 503Zeile 513
		eval("\$post['user_details'] = \"".$templates->get("postbit_author_guest")."\";");
}


		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 536Zeile 547
		{
$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)))
{

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

Zeile 557Zeile 568
		$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")."\";");

		}


		}


		// Quick Delete button
$can_delete_thread = $can_delete_post = 0;
if($mybb->user['uid'] == $post['uid'] && $thread['closed'] == 0)

		// Quick Delete button
$can_delete_thread = $can_delete_post = 0;
if($mybb->user['uid'] == $post['uid'] && $thread['closed'] == 0)

Zeile 567Zeile 579
			if($forumpermissions['candeletethreads'] == 1 && $postcounter == 1)
{
$can_delete_thread = 1;

			if($forumpermissions['candeletethreads'] == 1 && $postcounter == 1)
{
$can_delete_thread = 1;

			}

			}

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

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

Zeile 600Zeile 612

// Restore Post
if(is_moderator($fid, "canrestoreposts") && $postcounter != 1)


// Restore Post
if(is_moderator($fid, "canrestoreposts") && $postcounter != 1)

			{
$display = "none";

			{
$display = "none";

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

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

Zeile 631Zeile 643
		// 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 670Zeile 682
		if($mybb->user['uid'] != "0")
{
eval("\$post['button_report'] = \"".$templates->get("postbit_report")."\";");

		if($mybb->user['uid'] != "0")
{
eval("\$post['button_report'] = \"".$templates->get("postbit_report")."\";");

		}

		}

	}
elseif($post_type == 3) // announcement
{

	}
elseif($post_type == 3) // announcement
{

Zeile 684Zeile 696
	$post['iplogged'] = '';
$show_ips = $mybb->settings['logip'];
$ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));

	$post['iplogged'] = '';
$show_ips = $mybb->settings['logip'];
$ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));





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

Zeile 701Zeile 713
			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")."\";");
}
}

Zeile 712Zeile 728

$post['poststatus'] = '';
if(!$post_type && $post['visible'] != 1)


$post['poststatus'] = '';
if(!$post_type && $post['visible'] != 1)

	{

	{

		if(is_moderator($fid, "canviewdeleted") && $postcounter != 1 && $post['visible'] == -1)
{
$status_type = $lang->postbit_post_deleted;

		if(is_moderator($fid, "canviewdeleted") && $postcounter != 1 && $post['visible'] == -1)
{
$status_type = $lang->postbit_post_deleted;

Zeile 739Zeile 755
	}

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

	}

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

	{

	{

		$parser_options['allow_imgcode'] = 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)
{

Zeile 753Zeile 769
	{
$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 779Zeile 795
		if($usergroup['signofollow'])
{
$sig_parser['nofollow_on'] = 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)
{
$sig_parser['allow_imgcode'] = 0;

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

Zeile 788Zeile 804

$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

	}
else

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

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

Zeile 806Zeile 822
		eval("\$post['icon'] = \"".$templates->get("postbit_icon")."\";");
}
else

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

	{

	{

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


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


Zeile 815Zeile 831
	{
case 1: // Message preview
$post = $plugins->run_hooks("postbit_prev", $post);

	{
case 1: // Message preview
$post = $plugins->run_hooks("postbit_prev", $post);

			break;

			break;

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

		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(!isset($ignored_users))
{
$ignored_users = array();

Zeile 836Zeile 852
						$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")."\";");

				$post_visibility = "display: none;";
}

// 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;";
}
break;

				$post_visibility = "display: none;";
}
break;

Zeile 895Zeile 911
	{
$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 908Zeile 924
				if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
{
$isimage = true;

				if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
{
$isimage = true;

				}
else

				}
else

				{
$isimage = false;
}

				{
$isimage = false;
}

Zeile 920Zeile 936
				{
$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)

				{

				{

					// Show as thumbnail IF image is big && thumbnail exists && setting=='thumb'
// Show as full size image IF setting=='fullsize' || (image is small && permissions allow)
// Show as download for all other cases

					// Show as thumbnail IF image is big && thumbnail exists && setting=='thumb'
// Show as full size image IF setting=='fullsize' || (image is small && permissions allow)
// Show as download for all other cases

Zeile 990Zeile 1006
		else
{
$post['attachedthumbs'] = '';

		else
{
$post['attachedthumbs'] = '';

		}

		}

		if($post['imagelist'])

		if($post['imagelist'])

		{

		{

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

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

		}

		}

		else
{
$post['attachedimages'] = '';

		else
{
$post['attachedimages'] = '';

Zeile 1004Zeile 1020
			eval("\$post['attachments'] = \"".$templates->get("postbit_attachments")."\";");
}
}

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

 
}

/**
* Returns bytes count from human readable string
* Used to parse ini_get human-readable values to int
*
* @param string $val Human-readable value
*/
function return_bytes($val) {
$val = trim($val);
if ($val == "")
{
return 0;
}

$last = strtolower($val[strlen($val)-1]);
switch($last)
{
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}

return intval($val);

}

}