Vergleich inc/functions_post.php - 1.8.17 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 340Zeile 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 366Zeile 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 679Zeile 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 691Zeile 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'];


$post['iplogged'] = '';
$show_ips = $mybb->settings['logip'];

Zeile 707Zeile 718
		if($show_ips != "no" && !empty($post['ipaddress']))
{
if($show_ips == "show")

		if($show_ips != "no" && !empty($post['ipaddress']))
{
if($show_ips == "show")

			{

			{

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

Zeile 722Zeile 733
				}

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

				}

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

			}
}

			}
}

	}

$post['poststatus'] = '';

	}

$post['poststatus'] = '';

Zeile 859Zeile 870
			{
$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 873Zeile 892
	}

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

	}

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

	{

	{

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

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

Zeile 891Zeile 910
	$GLOBALS['post'] = "";

return $postbit;

	$GLOBALS['post'] = "";

return $postbit;

}

}


/**
* Fetch the attachments for a specific post and parse inline [attachment=id] code.


/**
* Fetch the attachments for a specific post and parse inline [attachment=id] code.

Zeile 933Zeile 952
				$attachment['downloads'] = my_number_format($attachment['downloads']);

if(!$attachment['dateuploaded'])

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

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





						eval("\$attbit = \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
}
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")."\";");

					}
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 975Zeile 994
					elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
{
eval("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";");

					elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
{
eval("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";");

					}

					}

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

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

			}

			}

			else
{
$validationcount++;

			else
{
$validationcount++;

			}
}

			}
}

		if($validationcount > 0 && is_moderator($post['fid'], "canviewunapprove"))
{
if($validationcount == 1)

		if($validationcount > 0 && is_moderator($post['fid'], "canviewunapprove"))
{
if($validationcount == 1)

Zeile 1002Zeile 1021
		if($post['thumblist'])
{
eval("\$post['attachedthumbs'] = \"".$templates->get("postbit_attachments_thumbnails")."\";");

		if($post['thumblist'])
{
eval("\$post['attachedthumbs'] = \"".$templates->get("postbit_attachments_thumbnails")."\";");

		}

		}

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

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

Zeile 1012Zeile 1031
			eval("\$post['attachedimages'] = \"".$templates->get("postbit_attachments_images")."\";");
}
else

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

		{

		{

			$post['attachedimages'] = '';

			$post['attachedimages'] = '';

		}

		}

		if($post['attachmentlist'] || $post['thumblist'] || $post['imagelist'])

		if($post['attachmentlist'] || $post['thumblist'] || $post['imagelist'])

		{

		{

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

/**
* 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;

		}
}
}

		}
}
}