Vergleich inc/functions_post.php - 1.8.15 - 1.8.25

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
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
{
$usergroup = usergroup_permissions(1);
}

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

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

	}

	}

	else




$displaygroup = usergroup_displaygroup($post['displaygroup']);
if(is_array($displaygroup))

	{

	{

		$usergroup = $groupscache[1];

		$usergroup = array_merge($usergroup, $displaygroup);

	}

if(!is_array($titlescache))

	}

if(!is_array($titlescache))

Zeile 330Zeile 340
			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['uid'] != $mybb->user['uid'] && (($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 356Zeile 366
			$post['button_www'] = "";
}


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


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

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

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

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

Zeile 669Zeile 679
			eval("\$post['button_multiquote'] = \"".$templates->get("postbit_multiquote")."\";");
}


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


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












		$skip_report = my_unserialize($post['reporters']);
if(is_array($skip_report))
{
$skip_report[] = 0;
}
else
{
$skip_report = array(0);
}

$reportable = user_permissions($post['uid']);
if(!in_array($mybb->user['uid'], $skip_report) && !empty($reportable['canbereported']))

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

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

Zeile 681Zeile 702
			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']));

Zeile 701Zeile 722
				eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");
}
else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod']))

				eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");
}
else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod']))

			{

			{

				$action = 'getip';
$javascript = 'getIP';


				$action = 'getip';
$javascript = 'getIP';


Zeile 713Zeile 734

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


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

		}
}

		}
}


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


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

Zeile 740Zeile 761
	}

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)

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

		$parser_options['allow_imgcode'] = 0;
}

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

	}

	}


// If we have incoming search terms to highlight - get it done.
if(!empty($mybb->input['highlight']))


// If we have incoming search terms to highlight - get it done.
if(!empty($mybb->input['highlight']))

Zeile 765Zeile 786

$post['attachments'] = '';
if($mybb->settings['enableattachments'] != 0)


$post['attachments'] = '';
if($mybb->settings['enableattachments'] != 0)

	{

	{

		get_post_attachments($id, $post);
}


		get_post_attachments($id, $post);
}


Zeile 791Zeile 812
		{
$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");

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 842Zeile 863
						$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"))

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

				$deleted_message = $lang->sprintf($lang->postbit_deleted_post_user, $post['username']);
eval("\$deleted_bit = \"".$templates->get("postbit_deleted")."\";");

 
				$post_visibility = "display: none;";
}

// Is the user (not moderator) logged in and have unapproved posts?
if($mybb->user['uid'] && $post['visible'] == 0 && $post['uid'] == $mybb->user['uid'] && !is_moderator($fid, "canviewunapprove"))
{
$ignored_message = $lang->sprintf($lang->postbit_post_under_moderation, $post['username']);
eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";");

				$post_visibility = "display: none;";
}


				$post_visibility = "display: none;";
}


Zeile 867Zeile 896
		eval("\$postbit = \"".$templates->get("postbit_deleted_member")."\";");
}
else

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

	{

	{

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

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

Zeile 893Zeile 922
function get_post_attachments($id, &$post)
{
global $attachcache, $mybb, $theme, $templates, $forumpermissions, $lang;

function get_post_attachments($id, &$post)
{
global $attachcache, $mybb, $theme, $templates, $forumpermissions, $lang;





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

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

Zeile 905Zeile 934
	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)

		{

		{

			if($attachment['visible'])
{ // There is an attachment thats visible!
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
$attachment['filesize'] = get_friendly_size($attachment['filesize']);
$ext = get_extension($attachment['filename']);
if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")

			if($attachment['visible'])
{ // There is an attachment thats visible!
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
$attachment['filesize'] = get_friendly_size($attachment['filesize']);
$ext = get_extension($attachment['filename']);
if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")

				{

				{

					$isimage = true;
}
else
{
$isimage = false;

					$isimage = true;
}
else
{
$isimage = false;

				}

				}

				$attachment['icon'] = get_attachment_icon($ext);
$attachment['downloads'] = my_number_format($attachment['downloads']);

if(!$attachment['dateuploaded'])

				$attachment['icon'] = get_attachment_icon($ext);
$attachment['downloads'] = my_number_format($attachment['downloads']);

if(!$attachment['dateuploaded'])

				{

				{

					$attachment['dateuploaded'] = $attachment['dateline'];
}
$attachdate = my_date('normal', $attachment['dateuploaded']);
// Support for [attachment=id] code
if(stripos($post['message'], "[attachment=".$attachment['aid']."]") !== false)

					$attachment['dateuploaded'] = $attachment['dateline'];
}
$attachdate = my_date('normal', $attachment['dateuploaded']);
// 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 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
if($attachment['thumbnail'] != "SMALL" && $attachment['thumbnail'] != "" && $mybb->settings['attachthumbnails'] == "yes")
{
eval("\$attbit = \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");

					// Show as download for all other cases
if($attachment['thumbnail'] != "SMALL" && $attachment['thumbnail'] != "" && $mybb->settings['attachthumbnails'] == "yes")
{
eval("\$attbit = \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");

					}

					}

					elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)

					elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)

					{

					{

						eval("\$attbit = \"".$templates->get("postbit_attachments_images_image")."\";");
}
else
{
eval("\$attbit = \"".$templates->get("postbit_attachments_attachment")."\";");

						eval("\$attbit = \"".$templates->get("postbit_attachments_images_image")."\";");
}
else
{
eval("\$attbit = \"".$templates->get("postbit_attachments_attachment")."\";");

					}

					}

					$post['message'] = preg_replace("#\[attachment=".$attachment['aid']."]#si", $attbit, $post['message']);
}
else

					$post['message'] = preg_replace("#\[attachment=".$attachment['aid']."]#si", $attbit, $post['message']);
}
else

Zeile 982Zeile 1011
			if($validationcount == 1)
{
$postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;

			if($validationcount == 1)
{
$postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;

			}

			}

			else
{
$postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);

			else
{
$postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);

Zeile 1008Zeile 1037
		if($post['attachmentlist'] || $post['thumblist'] || $post['imagelist'])
{
eval("\$post['attachments'] = \"".$templates->get("postbit_attachments")."\";");

		if($post['attachmentlist'] || $post['thumblist'] || $post['imagelist'])
{
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);
}

/**
* Detects whether an attachment removal/approval/unapproval
* submit button was pressed (without triggering an AJAX request)
* and sets inputs accordingly (as for an AJAX request).
*/
function detect_attachmentact()
{
global $mybb;

foreach($mybb->input as $key => $val)
{
if(strpos($key, 'rem_') === 0)
{
$mybb->input['attachmentaid'] = (int)substr($key, 4);
$mybb->input['attachmentact'] = 'remove';
break;
}
elseif(strpos($key, 'approveattach_') === 0)
{
$mybb->input['attachmentaid'] = (int)substr($key, 14);
$mybb->input['attachmentact'] = 'approve';
break;
}
elseif(strpos($key, 'unapproveattach_') === 0)
{
$mybb->input['attachmentaid'] = (int)substr($key, 16);
$mybb->input['attachmentact'] = 'unapprove';
break;

		}
}
}

		}
}
}