Vergleich inc/functions_post.php - 1.8.14 - 1.8.22

  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 212Zeile 222
			krsort($titlescache);
}
unset($usertitle, $cached_titles);

			krsort($titlescache);
}
unset($usertitle, $cached_titles);

	}

	}


// Work out the usergroup/title stuff
$post['groupimage'] = '';


// Work out the usergroup/title stuff
$post['groupimage'] = '';

Zeile 250Zeile 260
		if($usergroup['usertitle'] != "" && !$hascustomtitle)
{
$post['usertitle'] = $usergroup['usertitle'];

		if($usergroup['usertitle'] != "" && !$hascustomtitle)
{
$post['usertitle'] = $usergroup['usertitle'];

		}

		}

		elseif(is_array($titlescache) && !$usergroup['usertitle'])
{
reset($titlescache);

		elseif(is_array($titlescache) && !$usergroup['usertitle'])
{
reset($titlescache);

Zeile 288Zeile 298

$post['userstars'] = '';
for($i = 0; $i < $post['stars']; ++$i)


$post['userstars'] = '';
for($i = 0; $i < $post['stars']; ++$i)

			{

			{

				eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");
}


				eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");
}


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 596Zeile 606
				if($post['visible'] == -1)
{
$display = "none";

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

				}

				}

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


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


Zeile 609Zeile 619
					$display = '';
}
$postbit_qrestore = $lang->postbit_qrestore_post;

					$display = '';
}
$postbit_qrestore = $lang->postbit_qrestore_post;

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

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

			}

// Restore Thread

			}

// Restore Thread

Zeile 622Zeile 632
				}
$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))

		}

if(!isset($ismod))

Zeile 660Zeile 670
		global $forum, $thread;

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

		global $forum, $thread;

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

		{

		{

			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'] || $forumpermissions['canonlyreplyownthreads'] != 1) && ($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")












		$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 699Zeile 720
			if($show_ips == "show")
{
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");

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

			}

			}

			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 738Zeile 763
	if(isset($post['smilieoff']) && $post['smilieoff'] == 1)
{
$parser_options['allow_smilies'] = 0;

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

Zeile 763Zeile 788
	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


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

Zeile 801Zeile 826
	if(isset($post['icon']) && $post['icon'] > 0 && $icon_cache[$post['icon']])
{
$icon = $icon_cache[$post['icon']];

	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 828Zeile 853
			$post = $plugins->run_hooks("postbit", $post);

if(!isset($ignored_users))

			$post = $plugins->run_hooks("postbit", $post);

if(!isset($ignored_users))

			{

			{

				$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")
{

				$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")
{

Zeile 838Zeile 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 1006Zeile 1039
			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);

}

}