Vergleich inc/functions_post.php - 1.8.11 - 1.8.38

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

	else

	{
$usergroup = $groupscache[1];

























	{
$usergroup = usergroup_permissions(1);
}

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

if(empty($post['displaygroup']))
{
$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']);
if(is_array($displaygroup))
{
$usergroup = array_merge($usergroup, $displaygroup);

	}

if(!is_array($titlescache))
{
$cached_titles = $cache->read("usertitles");
if(!empty($cached_titles))

	}

if(!is_array($titlescache))
{
$cached_titles = $cache->read("usertitles");
if(!empty($cached_titles))

		{

		{

			foreach($cached_titles as $usertitle)
{
$titlescache[$usertitle['posts']] = $usertitle;

			foreach($cached_titles as $usertitle)
{
$titlescache[$usertitle['posts']] = $usertitle;

Zeile 227Zeile 247
		$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")
{
$post['groupimage'] .= "<br />";

		if($mybb->settings['postlayout'] == "classic")
{
$post['groupimage'] .= "<br />";

Zeile 241Zeile 261
		$post['profilelink_plain'] = get_profile_link($post['uid']);
$post['username_formatted'] = format_name($post['username'], $post['usergroup'], $post['displaygroup']);
$post['profilelink'] = build_profile_link($post['username_formatted'], $post['uid']);

		$post['profilelink_plain'] = get_profile_link($post['uid']);
$post['username_formatted'] = format_name($post['username'], $post['usergroup'], $post['displaygroup']);
$post['profilelink'] = build_profile_link($post['username_formatted'], $post['uid']);





		if(trim($post['usertitle']) != "")
{
$hascustomtitle = 1;

		if(trim($post['usertitle']) != "")
{
$hascustomtitle = 1;

Zeile 266Zeile 286
					$post['starimage'] = $titleinfo['starimage'];
break;
}

					$post['starimage'] = $titleinfo['starimage'];
break;
}

			}
}

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

			}
}

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


if($usergroup['stars'])


if($usergroup['stars'])

		{

		{

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

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

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

if(empty($post['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 310Zeile 330
			if($post['away'] == 1 && $mybb->settings['allowaway'] != 0)
{
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";");

			if($post['away'] == 1 && $mybb->settings['allowaway'] != 0)
{
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";");

			}

			}

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

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

		}

		}


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


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

		}


		}


		$post['button_find'] = '';
if($mybb->usergroup['cansearch'] == 1)
{
eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");

		$post['button_find'] = '';
if($mybb->usergroup['cansearch'] == 1)
{
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")."\";");
}

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

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

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





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


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


Zeile 350Zeile 370
		{
$post['website'] = htmlspecialchars_uni($post['website']);
eval("\$post['button_www'] = \"".$templates->get("postbit_www")."\";");

		{
$post['website'] = htmlspecialchars_uni($post['website']);
eval("\$post['button_www'] = \"".$templates->get("postbit_www")."\";");

		}
else
{

		}
else
{

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

		}

		}

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

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

		}

$post['userregdate'] = my_date($mybb->settings['regdateformat'], $post['regdate']);


		}

$post['userregdate'] = my_date($mybb->settings['regdateformat'], $post['regdate']);


		// Work out the reputation this user has (only show if not announcement)
if($post_type != 3 && $usergroup['usereputationsystem'] != 0 && $mybb->settings['enablereputation'] == 1)
{

		// Work out the reputation this user has (only show if not announcement)
if($post_type != 3 && $usergroup['usereputationsystem'] != 0 && $mybb->settings['enablereputation'] == 1)
{

Zeile 380Zeile 400
			if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

			if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

			}

			}


$warning_level = round($post['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)


$warning_level = round($post['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)

Zeile 406Zeile 426
		if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid']))
{
eval("\$post['button_purgespammer'] = \"".$templates->get('postbit_purgespammer')."\";");

		if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid']))
{
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 425Zeile 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 448Zeile 492
							#"nofollow_on" => 1,
"filter_badwords" => 1
);

							#"nofollow_on" => 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 458Zeile 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 487Zeile 531
		}

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

		}

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

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


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



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


Zeile 503Zeile 549
		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 583
		{
$forumpermissions = forum_permissions($fid);
}

		{
$forumpermissions = forum_permissions($fid);
}

		



		// 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 557Zeile 604
		$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")."\";");

		}

		}


// Quick Delete button
$can_delete_thread = $can_delete_post = 0;


// Quick Delete button
$can_delete_thread = $can_delete_post = 0;

Zeile 567Zeile 615
			if($forumpermissions['candeletethreads'] == 1 && $postcounter == 1)
{
$can_delete_thread = 1;

			if($forumpermissions['candeletethreads'] == 1 && $postcounter == 1)
{
$can_delete_thread = 1;

			}

			}

			else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
{
$can_delete_post = 1;

			else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
{
$can_delete_post = 1;

			}
}

			}
}


$postbit_qdelete = $postbit_qrestore = '';
if($mybb->user['uid'] != 0)


$postbit_qdelete = $postbit_qrestore = '';
if($mybb->user['uid'] != 0)

Zeile 580Zeile 628
			if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1)
{
$postbit_qdelete = $lang->postbit_qdelete_post;

			if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1)
{
$postbit_qdelete = $lang->postbit_qdelete_post;

				$display = '';
if($post['visible'] == -1)
{
$display = "none";
}
eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");

				$display = '';
if($post['visible'] == -1)
{
$display = "none";
}
eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");

			}
else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)
{

			}
else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)
{

Zeile 612Zeile 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 626Zeile 674
		if(!isset($ismod))
{
$ismod = is_moderator($fid);

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

		}


		}


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

			}

			}

			else
{
$inlinecheck = "";

			else
{
$inlinecheck = "";

			}


			}


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

if($post['visible'] == 0)

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

if($post['visible'] == 0)

Zeile 657Zeile 705
		eval("\$post['posturl'] = \"".$templates->get("postbit_posturl")."\";");
global $forum, $thread;


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


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

		if(isset($post['reporters']))

		{

		{

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



















			$skip_report = my_unserialize($post['reporters']);
if(is_array($skip_report))
{
$skip_report[] = 0;
}
else
{
$skip_report = array(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")."\";");

		}
}
elseif($post_type == 3) // announcement

		}
}
elseif($post_type == 3) // announcement

Zeile 683Zeile 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 694Zeile 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 701Zeile 768
			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 712Zeile 783

$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 737Zeile 809
	{
$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)
{
$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['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
{
$parser_options['allow_imgcode'] = 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 753Zeile 825
	{
$parser_options['highlight'] = $mybb->input['highlight'];
$post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);

	{
$parser_options['highlight'] = $mybb->input['highlight'];
$post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);

	}


	}


	$post['message'] = $parser->parse_message($post['message'], $parser_options);

$post['attachments'] = '';

	$post['message'] = $parser->parse_message($post['message'], $parser_options);

$post['attachments'] = '';

Zeile 779Zeile 851
		if($usergroup['signofollow'])
{
$sig_parser['nofollow_on'] = 1;

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





	$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['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$post['icon'] = \"".$templates->get("postbit_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']);
eval("\$post['icon'] = \"".$templates->get("postbit_icon")."\";");

	}

	}

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

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

Zeile 843Zeile 915
			{
$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 856Zeile 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 895Zeile 975
	{
$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 918Zeile 998

if(!$attachment['dateuploaded'])
{


if(!$attachment['dateuploaded'])
{

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

					$attachment['dateuploaded'] = $post['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)
{

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

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

					}
else

					}
else

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

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

Zeile 951Zeile 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;
}
elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
{

							$tcount = 0;
}
++$tcount;
}
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
{

					}
else
{

Zeile 976Zeile 1069
			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 1002Zeile 1095
		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]);

$val = intval($val);

switch($last)
{
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}

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

		}
}
}

		}
}
}