Vergleich inc/functions_post.php - 1.8.25 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 147Zeile 147
		}
$post_extra_style = "border-top-width: 0;";
}

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

	elseif($mybb->input['mode'] == "threaded")

	elseif($mybb->get_input('mode') == "threaded")

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

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

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


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


	if(!$post['displaygroup'])

	if(empty($post['displaygroup']))

	{
$post['displaygroup'] = $post['usergroup'];

	{
$post['displaygroup'] = $post['usergroup'];

 
	}

// Set to hardcoded Guest usergroup ID (1) for guest author or deleted user.
if(empty($post['usergroup']))
{
$post['usergroup'] = 1;
}
if(empty($post['displaygroup']))
{
$post['displaygroup'] = 1;

	}

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

	}

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

Zeile 291Zeile 301
			$post['starimage'] = $usergroup['starimage'];
}


			$post['starimage'] = $usergroup['starimage'];
}


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


		$post['userstars'] = '';
if($post['starimage'] && isset($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']);


			$post['userstars'] = '';

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

Zeile 348Zeile 358
		$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'] && (!isset($post['visible']) || $post['visible'] == 1) && (!isset($thread['visible']) || $thread['visible'] == 1))
{

		$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'] && (!isset($post['visible']) || $post['visible'] == 1) && (!isset($thread['visible']) || $thread['visible'] == 1))
{

			if(!$post['pid'])

			if(empty($post['pid']))

			{
$post['pid'] = 0;
}

			{
$post['pid'] = 0;
}

Zeile 411Zeile 421
				$warning_link = "usercp.php";
}
eval("\$post['warninglevel'] = \"".$templates->get("postbit_warninglevel")."\";");

				$warning_link = "usercp.php";
}
eval("\$post['warninglevel'] = \"".$templates->get("postbit_warninglevel")."\";");

		}


		}


		if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid']))

		if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid']))

		{

		{

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

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

 
		}

if(!isset($profile_fields))
{
$profile_fields = array();

// Fetch profile fields to display
$pfcache = $cache->read('profilefields');

if(is_array($pfcache))
{
foreach($pfcache as $profilefield)
{
if($profilefield['postbit'] != 1)
{
continue;
}

$profile_fields[$profilefield['fid']] = $profilefield;
}
}

		}

// Display profile fields on posts - only if field is filled in

		}

// Display profile fields on posts - only if field is filled in

		if(is_array($profile_fields))


		$post['profilefield'] = '';
if(!empty($profile_fields))

		{
foreach($profile_fields as $field)
{

		{
foreach($profile_fields as $field)
{

Zeile 435Zeile 467

if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))
{


if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))
{

 
						$post['fieldvalue_option'] = '';


						foreach($useropts as $val)
{
if($val != '')

						foreach($useropts as $val)
{
if($val != '')

Zeile 443Zeile 477
							}
}
if($post['fieldvalue_option'] != '')

							}
}
if($post['fieldvalue_option'] != '')

						{

						{

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

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

Zeile 459Zeile 493
							"filter_badwords" => 1
);


							"filter_badwords" => 1
);


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

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

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

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

Zeile 468Zeile 502
							$field_parser_options['nl2br'] = 0;
}


							$field_parser_options['nl2br'] = 0;
}


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

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

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

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

Zeile 486Zeile 520
	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'])

		if($usergroup['usertitle'])

		{

		{

			$post['usertitle'] = $usergroup['usertitle'];

			$post['usertitle'] = $usergroup['usertitle'];

		}

		}

		else
{
$post['usertitle'] = $lang->guest;
}

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

		else
{
$post['usertitle'] = $lang->guest;
}

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

 
		$post['userstars'] = '';
$post['useravatar'] = '';


$usergroup['title'] = $lang->na;



$usergroup['title'] = $lang->na;


Zeile 549Zeile 585
		}

// Figure out if we need to show an "edited by" message

		}

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

		if($post['edituid'] != 0 && $post['edittime'] != 0 && $post['editusername'] != "" && ($mybb->settings['showeditedby'] != 0 && $usergroup['cancp'] == 0 && !is_moderator($post['fid'], "", $post['uid']) || ($mybb->settings['showeditedbyadmin'] != 0 && ($usergroup['cancp'] == 1 || is_moderator($post['fid'], "", $post['uid'])))))

		{
$post['editdate'] = my_date('relative', $post['edittime']);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

		{
$post['editdate'] = my_date('relative', $post['edittime']);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

Zeile 624Zeile 660

// Restore Thread
else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1)


// Restore Thread
else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1)

			{

			{

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

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

Zeile 663Zeile 699
		else
{
$post['inlinecheck'] = "";

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

		}

		}

		$post['postlink'] = get_post_link($post['pid'], $post['tid']);
$post_number = my_number_format($postcounter);
eval("\$post['posturl'] = \"".$templates->get("postbit_posturl")."\";");
global $forum, $thread;

		$post['postlink'] = get_post_link($post['pid'], $post['tid']);
$post_number = my_number_format($postcounter);
eval("\$post['posturl'] = \"".$templates->get("postbit_posturl")."\";");
global $forum, $thread;


if($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid'], "canpostclosedthreads")) && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1))


if($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid'], "canpostclosedthreads")) && ($thread['uid'] == $mybb->user['uid'] || empty($forumpermissions['canonlyreplyownthreads'])))

		{
eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";");

		{
eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";");

		}

		}





		if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1) && ($thread['closed'] != 1 || is_moderator($fid, "canpostclosedthreads")) && $mybb->settings['multiquote'] != 0 && $forum['open'] != 0 && !$post_type)

		if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || empty($forumpermissions['canonlyreplyownthreads'])) && ($thread['closed'] != 1 || is_moderator($fid, "canpostclosedthreads")) && $mybb->settings['multiquote'] != 0 && $forum['open'] != 0 && !$post_type)

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

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

		}

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








		}

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

		{
$skip_report = array(0);
}

		{
$skip_report = array(0);
}

Zeile 693Zeile 736
		if(!in_array($mybb->user['uid'], $skip_report) && !empty($reportable['canbereported']))
{
eval("\$post['button_report'] = \"".$templates->get("postbit_report")."\";");

		if(!in_array($mybb->user['uid'], $skip_report) && !empty($reportable['canbereported']))
{
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 706Zeile 749

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


$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 717Zeile 759
	{
if($show_ips != "no" && !empty($post['ipaddress']))
{

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

 
			$ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));


			if($show_ips == "show")
{
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");

			if($show_ips == "show")
{
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");

Zeile 733Zeile 777
				}

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

 
		$status_type = '';

		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 761Zeile 806
	}

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['uid'] != 0 && $mybb->user['showimages'] != 1 || $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['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

	{
$parser_options['allow_videocode'] = 0;
}

	{
$parser_options['allow_videocode'] = 0;
}

Zeile 788Zeile 833
	if($mybb->settings['enableattachments'] != 0)
{
get_post_attachments($id, $post);

	if($mybb->settings['enableattachments'] != 0)
{
get_post_attachments($id, $post);

	}


	}


	if(isset($post['includesig']) && $post['includesig'] != 0 && $post['username'] && $post['signature'] != "" && ($mybb->user['uid'] == 0 || $mybb->user['showsigs'] != 0)
&& ($post['suspendsignature'] == 0 || $post['suspendsignature'] == 1 && $post['suspendsigtime'] != 0 && $post['suspendsigtime'] < TIME_NOW) && $usergroup['canusesig'] == 1
&& ($usergroup['canusesigxposts'] == 0 || $usergroup['canusesigxposts'] > 0 && $postnum > $usergroup['canusesigxposts']) && !is_member($mybb->settings['hidesignatures']))

	if(isset($post['includesig']) && $post['includesig'] != 0 && $post['username'] && $post['signature'] != "" && ($mybb->user['uid'] == 0 || $mybb->user['showsigs'] != 0)
&& ($post['suspendsignature'] == 0 || $post['suspendsignature'] == 1 && $post['suspendsigtime'] != 0 && $post['suspendsigtime'] < TIME_NOW) && $usergroup['canusesig'] == 1
&& ($usergroup['canusesigxposts'] == 0 || $usergroup['canusesigxposts'] > 0 && $postnum > $usergroup['canusesigxposts']) && !is_member($mybb->settings['hidesignatures']))

Zeile 802Zeile 847
			"me_username" => $parser_options['me_username'],
"filter_badwords" => 1
);

			"me_username" => $parser_options['me_username'],
"filter_badwords" => 1
);





		if($usergroup['signofollow'])

		if($usergroup['signofollow'])

		{

		{

			$sig_parser['nofollow_on'] = 1;

			$sig_parser['nofollow_on'] = 1;

		}

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

		}

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

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

$post['signature'] = $parser->parse_message($post['signature'], $sig_parser);
eval("\$post['signature'] = \"".$templates->get("postbit_signature")."\";");

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

$post['signature'] = $parser->parse_message($post['signature'], $sig_parser);
eval("\$post['signature'] = \"".$templates->get("postbit_signature")."\";");

	}
else

	}
else

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

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

Zeile 842Zeile 887
	{
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);
break;

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

Zeile 891Zeile 936
			break;
}


			break;
}


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

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

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

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

Zeile 905Zeile 950
		{
eval("\$postbit = \"".$templates->get("postbit")."\";");
}

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

	}

$GLOBALS['post'] = "";


	}

$GLOBALS['post'] = "";


	return $postbit;
}


	return $postbit;
}


Zeile 947Zeile 992
				else
{
$isimage = false;

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

					$attachment['dateuploaded'] = $post['dateline'];

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

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

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

					if($attachment['thumbnail'] != "SMALL" && $attachment['thumbnail'] != "" && $mybb->settings['attachthumbnails'] == "yes")
{
eval("\$attbit = \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");

Zeile 986Zeile 1031
						eval("\$post['thumblist'] .= \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
if($tcount == 5)
{

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

							$thumblist .= "<br />";

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

							$tcount = 0;

							$tcount = 0;

						}

						}

						++$tcount;

						++$tcount;

					}

					}

					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("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";");
}














					{
if ($forumpermissions['candlattachments'])
{
eval("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";");
}
else
{
eval("\$post['thumblist'] .= \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
if($tcount == 5)
{
$post['thumblist'] .= "<br />";
$tcount = 0;
}
++$tcount;
}
}

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

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

			}
else
{

			}
else
{

				$validationcount++;
}
}

				$validationcount++;
}
}

Zeile 1055Zeile 1113
	}

$last = strtolower($val[strlen($val)-1]);

	}

$last = strtolower($val[strlen($val)-1]);

 

$val = intval($val);


	switch($last)
{
case 'g':

	switch($last)
{
case 'g':

Zeile 1065Zeile 1126
			$val *= 1024;
}


			$val *= 1024;
}


	return intval($val);

	return $val;

}

/**

}

/**