Vergleich inc/functions_post.php - 1.8.5 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
/**
* Build a post bit
*

/**
* Build a post bit
*

 * @param array The post data
* @param int The type of post bit we're building (1 = preview, 2 = pm, 3 = announcement, else = post)

 * @param array $post The post data
* @param int $post_type The type of post bit we're building (1 = preview, 2 = pm, 3 = announcement, else = post)

 * @return string The built post bit
*/
function build_postbit($post, $post_type=0)

 * @return string The built post bit
*/
function build_postbit($post, $post_type=0)

Zeile 265Zeile 265
				}
}
}

				}
}
}

		



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

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





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

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

		}


		}


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

if($post['starimage'] && $post['stars'])

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

if($post['starimage'] && $post['stars'])

		{

		{

			// Only display stars if we have an image to use...
$post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);


			// Only display stars if we have an image to use...
$post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);


Zeile 287Zeile 287
			for($i = 0; $i < $post['stars']; ++$i)
{
eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");

			for($i = 0; $i < $post['stars']; ++$i)
{
eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");

			}

			}


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


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

Zeile 301Zeile 301
		if($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive'])
{
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";");

		if($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive'])
{
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";");

		}

		}

		else
{
if($post['away'] == 1 && $mybb->settings['allowaway'] != 0)

		else
{
if($post['away'] == 1 && $mybb->settings['allowaway'] != 0)

Zeile 316Zeile 316

$post['useravatar'] = '';
if(isset($mybb->user['showavatars']) && $mybb->user['showavatars'] != 0 || $mybb->user['uid'] == 0)


$post['useravatar'] = '';
if(isset($mybb->user['showavatars']) && $mybb->user['showavatars'] != 0 || $mybb->user['uid'] == 0)

		{

		{

			$useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']);
eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");

			$useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']);
eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");

		}
else



		}

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

		{

		{

			$post['useravatar'] = '';

			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 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false)
{

Zeile 333Zeile 333
		}

$post['button_rep'] = '';

		}

$post['button_rep'] = '';

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

		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['pid'])
{

Zeile 482Zeile 482
		{
$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;

Zeile 498Zeile 498
		$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['button_edit'] = '';
$post['button_quickdelete'] = '';
$post['button_quickrestore'] = '';

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

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

		}

		}

	}

$post['editedmsg'] = '';
if(!$post_type)
{

	}

$post['editedmsg'] = '';
if(!$post_type)
{

 
		if(!isset($forumpermissions))
{
$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 612Zeile 617
				$postbit_qrestore = $lang->postbit_qrestore_thread;
eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";");
}

				$postbit_qrestore = $lang->postbit_qrestore_thread;
eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";");
}

 
		}

if(!isset($ismod))
{
$ismod = is_moderator($fid);

		}

// Inline moderation stuff

		}

// Inline moderation stuff

Zeile 751Zeile 761

$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'] = "";
}





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

if(isset($post['icon']) && $post['icon'] > 0 && $icon_cache[$post['icon']])
{
$icon = $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['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

		$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

Zeile 771Zeile 781
	else
{
$post['icon'] = "";

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

	}

	}


$post_visibility = $ignore_bit = '';
switch($post_type)


$post_visibility = $ignore_bit = '';
switch($post_type)

Zeile 787Zeile 797
			break;
default: // Regular post
$post = $plugins->run_hooks("postbit", $post);

			break;
default: // Regular post
$post = $plugins->run_hooks("postbit", $post);

 

if(!isset($ignored_users))
{
$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")
{
$ignore_list = explode(',', $mybb->user['ignorelist']);
foreach($ignore_list as $uid)
{
$ignored_users[$uid] = 1;
}
}
}


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


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

Zeile 796Zeile 819
				$post_visibility = "display: none;";
}
break;

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

	}


	}


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

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

	{

	{

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

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

	}

	}

	$GLOBALS['post'] = "";

return $postbit;

	$GLOBALS['post'] = "";

return $postbit;

Zeile 815Zeile 838
 * Fetch the attachments for a specific post and parse inline [attachment=id] code.
* Note: assumes you have $attachcache, an array of attachments set up.
*

 * Fetch the attachments for a specific post and parse inline [attachment=id] code.
* Note: assumes you have $attachcache, an array of attachments set up.
*

 * @param int The ID of the item.
* @param array The post or item passed by reference.

 * @param int $id The ID of the item.
* @param array $post The post or item passed by reference.

 */
function get_post_attachments($id, &$post)
{

 */
function get_post_attachments($id, &$post)
{

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

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

 
	if(!isset($forumpermissions))
{
$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)