Vergleich inc/functions_post.php - 1.8.11 - 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 170Zeile 170

// Pm's have been htmlspecialchars_uni()'ed already.
if($post_type != 2)


// Pm's have been htmlspecialchars_uni()'ed already.
if($post_type != 2)

	{

	{

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

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

	}


	}


	if(empty($post['subject']))
{
$post['subject'] = ' ';
}

	if(empty($post['subject']))
{
$post['subject'] = ' ';
}





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

// Get the usergroup

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

// Get the usergroup

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

	if($post['usergroup'])
{
$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 />";
}
}





	if($post['userusername'])
{
// This post was made by a registered user

	if($post['userusername'])
{
// This post was made by a registered user

Zeile 243Zeile 253
		$post['profilelink'] = build_profile_link($post['username_formatted'], $post['uid']);

if(trim($post['usertitle']) != "")

		$post['profilelink'] = build_profile_link($post['username_formatted'], $post['uid']);

if(trim($post['usertitle']) != "")

		{

		{

			$hascustomtitle = 1;
}


			$hascustomtitle = 1;
}


Zeile 298Zeile 308
		$postnum = $post['postnum'];
$post['postnum'] = my_number_format($post['postnum']);
$post['threadnum'] = my_number_format($post['threadnum']);

		$postnum = $post['postnum'];
$post['postnum'] = my_number_format($post['postnum']);
$post['threadnum'] = my_number_format($post['threadnum']);





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

Zeile 326Zeile 336

$post['button_find'] = '';
if($mybb->usergroup['cansearch'] == 1)


$post['button_find'] = '';
if($mybb->usergroup['cansearch'] == 1)

		{

		{

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

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

		}

		}


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


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 339Zeile 349
		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'])

		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;
}


				$post['pid'] = 0;
}


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


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
{
if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanageannounce'] == 1 && is_moderator($fid, "canmanageannouncements"))

	elseif($post_type == 3) // announcement
{
if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanageannounce'] == 1 && is_moderator($fid, "canmanageannouncements"))

Zeile 679Zeile 691
			eval("\$post['button_edit'] = \"".$templates->get("announcement_edit")."\";");
eval("\$post['button_quickdelete'] = \"".$templates->get("announcement_quickdelete")."\";");
}

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

	}


	}


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

}

}