Vergleich misc.php - 1.8.3 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
define("IGNORE_CLEAN_VARS", "sid");
define('THIS_SCRIPT', 'misc.php');


define("IGNORE_CLEAN_VARS", "sid");
define('THIS_SCRIPT', 'misc.php');


$templatelist = "misc_rules_forum,misc_help_helpdoc,misc_whoposted_poster,misc_whoposted,misc_smilies_popup_smilie,misc_smilies_popup,misc_smilies_popup_empty,misc_syndication_feedurl,misc_syndication";
$templatelist .= ",misc_buddypopup,misc_buddypopup_user,misc_buddypopup_user_none,misc_buddypopup_user_online,misc_buddypopup_user_offline,misc_buddypopup_user_sendpm,misc_help_search,misc_syndication_forumlist";
$templatelist .= ",misc_smilies,misc_smilies_smilie,misc_help_section_bit,misc_help_section,misc_help,forumdisplay_password_wrongpass,forumdisplay_password,misc_helpresults,misc_helpresults_bit,misc_helpresults_noresults,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start";



$templatelist = "misc_rules_forum,misc_help_helpdoc,misc_whoposted_poster,misc_whoposted,misc_smilies_popup_smilie,misc_smilies_popup,misc_smilies_popup_empty,misc_smilies_popup_row,multipage_start";
$templatelist .= ",misc_buddypopup,misc_buddypopup_user,misc_buddypopup_user_none,misc_buddypopup_user_online,misc_buddypopup_user_offline,misc_buddypopup_user_sendpm,misc_syndication_forumlist";
$templatelist .= ",misc_smilies,misc_smilies_smilie,misc_help_section_bit,misc_help_section,misc_help,forumdisplay_password_wrongpass,forumdisplay_password,misc_helpresults,misc_helpresults_bit";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,misc_whoposted_page";
$templatelist .= ",misc_smilies_popup_no_smilies,misc_smilies_no_smilies,misc_syndication,misc_help_search,misc_helpresults_noresults,misc_syndication_forumlist_forum,misc_syndication_feedurl";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 108Zeile 110
			error($lang->invalid_post_code);
}


			error($lang->invalid_post_code);
}


		my_unsetcookie("forumpass[".$mybb->input['fid']."]");

		my_unsetcookie("forumpass[".$mybb->get_input('fid', MyBB::INPUT_INT)."]");

		redirect("index.php", $lang->redirect_forumpasscleared);
}
}

		redirect("index.php", $lang->redirect_forumpasscleared);
}
}

Zeile 177Zeile 179
		$query = $db->simple_select("searchlog", "*", "uid='{$mybb->user['uid']}' AND dateline > '$timecut'", array('order_by' => "dateline", 'order_dir' => "DESC"));
$last_search = $db->fetch_array($query);
// Users last search was within the flood time, show the error

		$query = $db->simple_select("searchlog", "*", "uid='{$mybb->user['uid']}' AND dateline > '$timecut'", array('order_by' => "dateline", 'order_dir' => "DESC"));
$last_search = $db->fetch_array($query);
// Users last search was within the flood time, show the error

		if($last_search['sid'])

		if($last_search)

		{
$remaining_time = $mybb->settings['searchfloodtime']-(TIME_NOW-$last_search['dateline']);
if($remaining_time == 1)

		{
$remaining_time = $mybb->settings['searchfloodtime']-(TIME_NOW-$last_search['dateline']);
if($remaining_time == 1)

Zeile 192Zeile 194
		}
}


		}
}


	if($mybb->get_input('name', 1) != 1 && $mybb->get_input('document', 1) != 1)

	if($mybb->get_input('name', MyBB::INPUT_INT) != 1 && $mybb->get_input('document', MyBB::INPUT_INT) != 1)

	{
error($lang->error_nosearchresults);
}


	{
error($lang->error_nosearchresults);
}


	if($mybb->get_input('document', 1) == 1)

	if($mybb->get_input('document', MyBB::INPUT_INT) == 1)

	{
$resulttype = "helpdoc";
}

	{
$resulttype = "helpdoc";
}

Zeile 208Zeile 210

$search_data = array(
"keywords" => $mybb->get_input('keywords'),


$search_data = array(
"keywords" => $mybb->get_input('keywords'),

		"name" => $mybb->get_input('name', 1),
"document" => $mybb->get_input('document', 1),

		"name" => $mybb->get_input('name', MyBB::INPUT_INT),
"document" => $mybb->get_input('document', MyBB::INPUT_INT),

	);

if($db->can_search == true)

	);

if($db->can_search == true)

Zeile 266Zeile 268
	{
$mybb->settings['threadsperpage'] = 20;
}

	{
$mybb->settings['threadsperpage'] = 20;
}

 

$query = $db->simple_select("helpdocs", "COUNT(*) AS total", "hid IN(".$db->escape_string($search['querycache']).")");
$helpcount = $db->fetch_field($query, "total");


// Work out pagination, which page we're at, as well as the limits.
$perpage = $mybb->settings['threadsperpage'];


// Work out pagination, which page we're at, as well as the limits.
$perpage = $mybb->settings['threadsperpage'];

	$page = $mybb->get_input('page', 1);

	$page = $mybb->get_input('page', MyBB::INPUT_INT);

	if($page > 0)
{
$start = ($page-1) * $perpage;

	if($page > 0)
{
$start = ($page-1) * $perpage;

 
		$pages = ceil($helpcount / $perpage);
if($pages > $page)
{
$start = 0;
$page = 1;
}

	}
else
{

	}
else
{

Zeile 286Zeile 297
	// Work out if we have terms to highlight
$highlight = "";
if($search['keywords'])

	// Work out if we have terms to highlight
$highlight = "";
if($search['keywords'])

	{

	{

		$highlight = "&highlight=".urlencode($search['keywords']);
}

		$highlight = "&highlight=".urlencode($search['keywords']);
}





	// Do Multi Pages

	// Do Multi Pages

	$query = $db->simple_select("helpdocs", "COUNT(*) AS total", "hid IN(".$db->escape_string($search['querycache']).")");
$helpcount = $db->fetch_array($query);


 
	if($upper > $helpcount)
{
$upper = $helpcount;
}

	if($upper > $helpcount)
{
$upper = $helpcount;
}

	$multipage = multipage($helpcount['total'], $perpage, $page, "misc.php?action=helpresults&sid='".htmlspecialchars_uni($mybb->get_input('sid'))."'");

	$multipage = multipage($helpcount, $perpage, $page, "misc.php?action=helpresults&sid='".htmlspecialchars_uni($mybb->get_input('sid'))."'");

	$helpdoclist = '';

require_once MYBB_ROOT."inc/class_parser.php";

	$helpdoclist = '';

require_once MYBB_ROOT."inc/class_parser.php";

Zeile 316Zeile 324
		$bgcolor = alt_trow();

if(my_strlen($helpdoc['name']) > 50)

		$bgcolor = alt_trow();

if(my_strlen($helpdoc['name']) > 50)

		{

		{

			$helpdoc['name'] = htmlspecialchars_uni(my_substr($helpdoc['name'], 0, 50)."...");
}
else

			$helpdoc['name'] = htmlspecialchars_uni(my_substr($helpdoc['name'], 0, 50)."...");
}
else

Zeile 331Zeile 339
			'allow_imgcode' => 0,
'filter_badwords' => 1
);

			'allow_imgcode' => 0,
'filter_badwords' => 1
);

		$helpdoc['helpdoc'] = strip_tags($parser->parse_message($helpdoc['document'], $parser_options));

		$helpdoc['helpdoc'] = $parser->parse_message($helpdoc['document'], $parser_options);


if(my_strlen($helpdoc['helpdoc']) > 350)
{


if(my_strlen($helpdoc['helpdoc']) > 350)
{

Zeile 345Zeile 353
		$plugins->run_hooks("misc_helpresults_bit");

eval("\$helpdoclist .= \"".$templates->get("misc_helpresults_bit")."\";");

		$plugins->run_hooks("misc_helpresults_bit");

eval("\$helpdoclist .= \"".$templates->get("misc_helpresults_bit")."\";");

	}

	}


if($db->num_rows($query) == 0)
{


if($db->num_rows($query) == 0)
{

Zeile 364Zeile 372
	$lang->load("customhelpdocs");
$lang->load("customhelpsections");


	$lang->load("customhelpdocs");
$lang->load("customhelpsections");


	$hid = $mybb->get_input('hid', 1);

	$hid = $mybb->get_input('hid', MyBB::INPUT_INT);

	add_breadcrumb($lang->nav_helpdocs, "misc.php?action=help");

	add_breadcrumb($lang->nav_helpdocs, "misc.php?action=help");





	if($hid)
{
$query = $db->query("

	if($hid)
{
$query = $db->query("

Zeile 380Zeile 388
		if($helpdoc['section'] != 0 && $helpdoc['enabled'] != 0)
{
$plugins->run_hooks("misc_help_helpdoc_start");

		if($helpdoc['section'] != 0 && $helpdoc['enabled'] != 0)
{
$plugins->run_hooks("misc_help_helpdoc_start");





			// If we have incoming search terms to highlight - get it done (only if not using translation).
if(!empty($mybb->input['highlight']) && $helpdoc['usetranslation'] != 1)
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser();

			// If we have incoming search terms to highlight - get it done (only if not using translation).
if(!empty($mybb->input['highlight']) && $helpdoc['usetranslation'] != 1)
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser();





				$highlight = $mybb->input['highlight'];
$helpdoc['name'] = $parser->highlight_message($helpdoc['name'], $highlight);
$helpdoc['document'] = $parser->highlight_message($helpdoc['document'], $highlight);

				$highlight = $mybb->input['highlight'];
$helpdoc['name'] = $parser->highlight_message($helpdoc['name'], $highlight);
$helpdoc['document'] = $parser->highlight_message($helpdoc['document'], $highlight);

Zeile 397Zeile 405
				$langnamevar = "d".$helpdoc['hid']."_name";
$langdescvar = "d".$helpdoc['hid']."_desc";
$langdocvar = "d".$helpdoc['hid']."_document";

				$langnamevar = "d".$helpdoc['hid']."_name";
$langdescvar = "d".$helpdoc['hid']."_desc";
$langdocvar = "d".$helpdoc['hid']."_document";

				if($lang->$langnamevar)

				if(isset($lang->$langnamevar))

				{
$helpdoc['name'] = $lang->$langnamevar;
}

				{
$helpdoc['name'] = $lang->$langnamevar;
}

				if($lang->$langdescvar)

				if(isset($lang->$langdescvar))

				{
$helpdoc['description'] = $lang->$langdescvar;
}

				{
$helpdoc['description'] = $lang->$langdescvar;
}

				if($lang->$langdocvar)

				if(isset($lang->$langdocvar))

				{
$helpdoc['document'] = $lang->$langdocvar;
}

				{
$helpdoc['document'] = $lang->$langdocvar;
}

Zeile 468Zeile 476
							{
$langnamevar = "d".$helpdoc['hid'].'_name';
$langdescvar = "d".$helpdoc['hid'].'_desc';

							{
$langnamevar = "d".$helpdoc['hid'].'_name';
$langdescvar = "d".$helpdoc['hid'].'_desc';

								if($lang->$langnamevar)

								if(isset($lang->$langnamevar))

								{
$helpdoc['name'] = $lang->$langnamevar;
}

								{
$helpdoc['name'] = $lang->$langnamevar;
}

								if($lang->$langdescvar)

								if(isset($lang->$langdescvar))

								{
$helpdoc['description'] = $lang->$langdescvar;
}

								{
$helpdoc['description'] = $lang->$langdescvar;
}

Zeile 482Zeile 490
						}
}
$expdisplay = '';

						}
}
$expdisplay = '';

					$sname = "sid_".$section['sid']."_c";
if(isset($collapsed[$sname]) && $collapsed[$sname] == "display: show;")

					$sname = "sid_".$section['sid']."_e";
if(isset($collapsed[$sname]) && $collapsed[$sname] == "display: none;")

					{
$expcolimage = "collapse_collapsed.png";
$expdisplay = "display: none;";
$expthead = " thead_collapsed";

					{
$expcolimage = "collapse_collapsed.png";
$expdisplay = "display: none;";
$expthead = " thead_collapsed";

 
						$expaltext = $lang->expcol_expand;

					}
else
{
$expcolimage = "collapse.png";
$expthead = "";

					}
else
{
$expcolimage = "collapse.png";
$expthead = "";

 
						$expaltext = $lang->expcol_collapse;

					}
}
eval("\$sections .= \"".$templates->get("misc_help_section")."\";");

					}
}
eval("\$sections .= \"".$templates->get("misc_help_section")."\";");

Zeile 519Zeile 529
		error_no_permission();
}


		error_no_permission();
}


	if(isset($mybb->input['removebuddy']) && verify_post_check($mybb->input['my_post_key']))

	if(isset($mybb->input['removebuddy']) && verify_post_check($mybb->get_input('my_post_key')))

	{
$buddies = $mybb->user['buddylist'];
$namesarray = explode(",", $buddies);

	{
$buddies = $mybb->user['buddylist'];
$namesarray = explode(",", $buddies);

		$mybb->input['removebuddy'] = $mybb->get_input('removebuddy', 1);

		$mybb->input['removebuddy'] = $mybb->get_input('removebuddy', MyBB::INPUT_INT);

		if(is_array($namesarray))
{
foreach($namesarray as $key => $buddyid)

		if(is_array($namesarray))
{
foreach($namesarray as $key => $buddyid)

Zeile 550Zeile 560

while($buddy = $db->fetch_array($query))
{


while($buddy = $db->fetch_array($query))
{

 
			$buddy['username'] = htmlspecialchars_uni($buddy['username']);

			$buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
$profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank', 'if(window.opener) { window.opener.location = this.href; return false; }');


			$buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
$profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank', 'if(window.opener) { window.opener.location = this.href; return false; }');


Zeile 568Zeile 579
				$last_active = $lang->sprintf($lang->last_active, $lang->never);
}


				$last_active = $lang->sprintf($lang->last_active, $lang->never);
}


			$buddy['avatar'] = format_avatar(htmlspecialchars_uni($buddy['avatar']), $buddy['avatardimensions'], '44x44');

			$buddy['avatar'] = format_avatar($buddy['avatar'], $buddy['avatardimensions'], '44x44');


if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])
{


if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])
{

Zeile 616Zeile 627
	$numposts = 0;
$altbg = alt_trow();
$whoposted = '';

	$numposts = 0;
$altbg = alt_trow();
$whoposted = '';

	$tid = $mybb->get_input('tid', 1);

	$tid = $mybb->get_input('tid', MyBB::INPUT_INT);

	$thread = get_thread($tid);

	$thread = get_thread($tid);

 
	$modal = $mybb->get_input('modal', MyBB::INPUT_INT);


// Make sure we are looking at a real thread here.
if(!$thread)
{
error($lang->error_invalidthread);


// Make sure we are looking at a real thread here.
if(!$thread)
{
error($lang->error_invalidthread);

	}

if(is_moderator($thread['fid'], "canviewunapprove"))
{
$ismod = true;
$show_posts = "(p.visible = '1' OR p.visible = '0')";
}
else
{
$ismod = false;
$show_posts = "p.visible = '1'";

 
	}

// Make sure we are looking at a real thread here.

	}

// Make sure we are looking at a real thread here.

	if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
{

	if(($thread['visible'] == -1 && !is_moderator($thread['fid'], "canviewdeleted")) || ($thread['visible'] == 0 && !is_moderator($thread['fid'], "canviewunapprove")) || $thread['visible'] > 1)
{

		error($lang->error_invalidthread);
}

		error($lang->error_invalidthread);
}

 

if(is_moderator($thread['fid'], "canviewdeleted") || is_moderator($thread['fid'], "canviewunapprove"))
{
if(is_moderator($thread['fid'], "canviewunapprove") && !is_moderator($thread['fid'], "canviewdeleted"))
{
$show_posts = "p.visible IN (0,1)";
}
elseif(is_moderator($thread['fid'], "canviewdeleted") && !is_moderator($thread['fid'], "canviewunapprove"))
{
$show_posts = "p.visible IN (-1,1)";
}
else
{
$show_posts = "p.visible IN (-1,0,1)";
}
}
else
{
$show_posts = "p.visible = 1";
}


	// Does the thread belong to a valid forum?
$forum = get_forum($thread['fid']);
if(!$forum || $forum['type'] != "f")

	// Does the thread belong to a valid forum?
$forum = get_forum($thread['fid']);
if(!$forum || $forum['type'] != "f")

Zeile 652Zeile 674
	$forumpermissions = forum_permissions($forum['fid']);

if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))

	$forumpermissions = forum_permissions($forum['fid']);

if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 660Zeile 682
	check_forum_password($forum['fid']);

if($mybb->get_input('sort') != 'username')

	check_forum_password($forum['fid']);

if($mybb->get_input('sort') != 'username')

	{

	{

		$sortsql = ' ORDER BY posts DESC';

		$sortsql = ' ORDER BY posts DESC';

	}

	}

	else
{
$sortsql = ' ORDER BY p.username ASC';

	else
{
$sortsql = ' ORDER BY p.username ASC';

	}

	}

	$whoposted = '';
$query = $db->query("
SELECT COUNT(p.pid) AS posts, p.username AS postusername, u.uid, u.username, u.usergroup, u.displaygroup

	$whoposted = '';
$query = $db->query("
SELECT COUNT(p.pid) AS posts, p.username AS postusername, u.uid, u.username, u.usergroup, u.displaygroup

Zeile 682Zeile 704
		{
$poster['username'] = $poster['postusername'];
}

		{
$poster['username'] = $poster['postusername'];
}

 
		$poster['username'] = htmlspecialchars_uni($poster['username']);
$poster['postusername'] = htmlspecialchars_uni($poster['postusername']);

		$poster_name = format_name($poster['username'], $poster['usergroup'], $poster['displaygroup']);

		$poster_name = format_name($poster['username'], $poster['usergroup'], $poster['displaygroup']);

		if($poster['uid'])

		if($modal)

		{

		{

			$onclick = "opener.location.href='".get_profile_link($poster['uid'])."'; return false;";










			$onclick = '';
if($poster['uid'])
{
$onclick = "opener.location.href='".get_profile_link($poster['uid'])."'; return false;";
}
$profile_link = build_profile_link($poster_name, $poster['uid'], '_blank', $onclick);
}
else
{
$profile_link = build_profile_link($poster_name, $poster['uid']);

		}

		}

		$profile_link = build_profile_link($poster_name, $poster['uid'], '_blank', $onclick);

 
		$numposts += $poster['posts'];

		$numposts += $poster['posts'];

 
		$poster['posts'] = my_number_format($poster['posts']);

		eval("\$whoposted .= \"".$templates->get("misc_whoposted_poster")."\";");
$altbg = alt_trow();
}
$numposts = my_number_format($numposts);

		eval("\$whoposted .= \"".$templates->get("misc_whoposted_poster")."\";");
$altbg = alt_trow();
}
$numposts = my_number_format($numposts);

	$poster['posts'] = my_number_format($poster['posts']);
eval("\$whop = \"".$templates->get("misc_whoposted", 1, 0)."\";");
echo $whop;
exit;






























	if($modal)
{
eval("\$whop = \"".$templates->get("misc_whoposted", 1, 0)."\";");
echo $whop;
exit;
}
else
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

// Get thread prefix
$breadcrumbprefix = '';
$threadprefix = array('prefix' => '');
if($thread['prefix'])
{
$threadprefix = build_prefixes($thread['prefix']);
if(!empty($threadprefix['displaystyle']))
{
$breadcrumbprefix = $threadprefix['displaystyle'].' ';
}
}

$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));

// Build the navigation.
build_forum_breadcrumb($forum['fid']);
add_breadcrumb($breadcrumbprefix.$thread['subject'], get_thread_link($thread['tid']));
add_breadcrumb($lang->who_posted);

eval("\$whoposted = \"".$templates->get("misc_whoposted_page")."\";");
output_page($whoposted);
}

}
elseif($mybb->input['action'] == "smilies")
{

}
elseif($mybb->input['action'] == "smilies")
{

Zeile 705Zeile 767
	{ // make small popup list of smilies
$editor = preg_replace('#([^a-zA-Z0-9_-]+)#', '', $mybb->get_input('editor'));
$e = 1;

	{ // make small popup list of smilies
$editor = preg_replace('#([^a-zA-Z0-9_-]+)#', '', $mybb->get_input('editor'));
$e = 1;

		$class = "trow1";
$smilies = "<tr>";

		$smile_icons = '';
$class = alt_trow(1);

		$smilies_cache = $cache->read("smilies");

		$smilies_cache = $cache->read("smilies");

 


		if(is_array($smilies_cache))
{
$extra_class = ' smilie_pointer';
foreach($smilies_cache as $smilie)
{

		if(is_array($smilies_cache))
{
$extra_class = ' smilie_pointer';
foreach($smilies_cache as $smilie)
{

 
				$smilie['image'] = str_replace("{theme}", $theme['imgdir'], $smilie['image']);
$smilie['image'] = htmlspecialchars_uni($mybb->get_asset_url($smilie['image']));
$smilie['name'] = htmlspecialchars_uni($smilie['name']);


				// Only show the first text to replace in the box
$temp = explode("\n", $smilie['find']); // use temporary variable for php 5.3 compatibility
$smilie['find'] = $temp[0];


				// Only show the first text to replace in the box
$temp = explode("\n", $smilie['find']); // use temporary variable for php 5.3 compatibility
$smilie['find'] = $temp[0];


				$smilie['insert'] = addslashes($smilie['find']);

 
				$smilie['find'] = htmlspecialchars_uni($smilie['find']);

				$smilie['find'] = htmlspecialchars_uni($smilie['find']);

				$onclick = "  onclick=\"MyBBEditor.insertText('{$smilie['insert']}');\"";



				$smilie_insert = str_replace(array('\\', "'"), array('\\\\', "\'"), $smilie['find']);

$onclick = " onclick=\"MyBBEditor.insertText(' $smilie_insert ');\"";

				eval('$smilie_image = "'.$templates->get('smilie', 1, 0).'";');

				eval('$smilie_image = "'.$templates->get('smilie', 1, 0).'";');

				eval("\$smilies .= \"".$templates->get("misc_smilies_popup_smilie")."\";");

				eval("\$smile_icons .= \"".$templates->get("misc_smilies_popup_smilie")."\";");

				if($e == 2)
{

				if($e == 2)
{

					$smilies .= "</tr><tr>";


					eval("\$smilies .= \"".$templates->get("misc_smilies_popup_row")."\";");
$smile_icons = '';

					$e = 1;
$class = alt_trow();

					$e = 1;
$class = alt_trow();

				}

				}

				else
{
$e = 2;
}
}
}

				else
{
$e = 2;
}
}
}

 


		if($e == 2)
{

		if($e == 2)
{

			eval("\$smilies .= \"".$templates->get("misc_smilies_popup_empty")."\";");






			eval("\$smilies .= \"".$templates->get("misc_smilies_popup_empty")."\";");
}

if(!$smilies)
{
eval("\$smilies = \"".$templates->get("misc_smilies_popup_no_smilies")."\";");

		}

		}

 


		eval("\$smiliespage = \"".$templates->get("misc_smilies_popup", 1, 0)."\";");

		eval("\$smiliespage = \"".$templates->get("misc_smilies_popup", 1, 0)."\";");

		output_page($smiliespage);
}
else

		output_page($smiliespage);
}
else

	{
add_breadcrumb($lang->nav_smilies);
$class = "trow1";
$smilies_cache = $cache->read("smilies");

	{
add_breadcrumb($lang->nav_smilies);
$class = "trow1";
$smilies_cache = $cache->read("smilies");

 


		if(is_array($smilies_cache))
{
$extra_class = $onclick = '';
foreach($smilies_cache as $smilie)

		if(is_array($smilies_cache))
{
$extra_class = $onclick = '';
foreach($smilies_cache as $smilie)

			{
$smilie['find'] = htmlspecialchars_uni($smilie['find']);





			{
$smilie['image'] = str_replace("{theme}", $theme['imgdir'], $smilie['image']);
$smilie['image'] = htmlspecialchars_uni($mybb->get_asset_url($smilie['image']));
$smilie['name'] = htmlspecialchars_uni($smilie['name']);

$smilie['find'] = nl2br(htmlspecialchars_uni($smilie['find']));

				eval('$smilie_image = "'.$templates->get('smilie').'";');
eval("\$smilies .= \"".$templates->get("misc_smilies_smilie")."\";");
$class = alt_trow();

				eval('$smilie_image = "'.$templates->get('smilie').'";');
eval("\$smilies .= \"".$templates->get("misc_smilies_smilie")."\";");
$class = alt_trow();

			}
}







			}
}

if(!$smilies)
{
eval("\$smilies = \"".$templates->get("misc_smilies_no_smilies")."\";");
}


		eval("\$smiliespage = \"".$templates->get("misc_smilies")."\";");
output_page($smiliespage);
}

		eval("\$smiliespage = \"".$templates->get("misc_smilies")."\";");
output_page($smiliespage);
}

}
elseif($mybb->input['action'] == "imcenter")
{
$mybb->input['imtype'] = $mybb->get_input('imtype');
if($mybb->input['imtype'] != "aim" && $mybb->input['imtype'] != "skype" && $mybb->input['imtype'] != "yahoo")
{
error($lang->error_invalidimtype);
}
$uid = $mybb->get_input('uid', 1);
$user = get_user($uid);

if(!$user)
{
error($lang->error_invaliduser);
}

if(empty($user[$mybb->input['imtype']]))
{
error($lang->error_invalidimtype);
}

$settingkey = 'allow'.$mybb->input['imtype'].'field';
if(!($mybb->settings[$settingkey] == -1 || $mybb->settings[$settingkey] != '' && is_member($mybb->settings[$settingkey], $user)))
{
error($lang->error_invaliduser);
}

// Build IM navigation bar
$navigationbar = $navsep = $imtype = $imtype_lang = '';
if($user['aim'])
{
$imtype = "aim";
$imtype_lang = $lang->aol_im;
eval("\$navigationbar .= \"".$templates->get("misc_imcenter_nav")."\";");
$navsep = ' - ';
}
if($user['skype'])
{
$imtype = "skype";
$imtype_lang = $lang->skype;
eval("\$navigationbar .= \"".$templates->get("misc_imcenter_nav")."\";");
$navsep = ' - ';
}
if($user['yahoo'])
{
$imtype = "yahoo";
$imtype_lang = $lang->yahoo_im;
eval("\$navigationbar .= \"".$templates->get("misc_imcenter_nav")."\";");
}

$user['skype'] = htmlspecialchars_uni($user['skype']);
$user['yahoo'] = htmlspecialchars_uni($user['yahoo']);
$user['aim'] = htmlspecialchars_uni($user['aim']);

}

























































	$lang->chat_on_skype = $lang->sprintf($lang->chat_on_skype, $user['username']);
$lang->call_on_skype = $lang->sprintf($lang->call_on_skype, $user['username']);
$lang->send_y_message = $lang->sprintf($lang->send_y_message, $user['username']);
$lang->view_y_profile = $lang->sprintf($lang->view_y_profile, $user['username']);

$imtemplate = "misc_imcenter_".$mybb->input['imtype'];
eval("\$imcenter = \"".$templates->get($imtemplate, 1, 0)."\";");
echo $imcenter;
exit;
}

 
elseif($mybb->input['action'] == "syndication")
{
$plugins->run_hooks("misc_syndication_start");

elseif($mybb->input['action'] == "syndication")
{
$plugins->run_hooks("misc_syndication_start");


$fid = $mybb->get_input('fid', 1);


$fid = $mybb->get_input('fid', MyBB::INPUT_INT);

	$version = $mybb->get_input('version');

	$version = $mybb->get_input('version');

	$limit = $mybb->get_input('limit', 1);
$forums = $mybb->get_input('forums', 2);
$limit = 15;
$feedurl = '';
$add = false;


	$forums = $mybb->get_input('forums', MyBB::INPUT_ARRAY);
$limit = $mybb->get_input('limit', MyBB::INPUT_INT);
$url = $mybb->settings['bburl']."/syndication.php";
$syndicate = $urlquery = array();



	add_breadcrumb($lang->nav_syndication);
$unviewable = get_unviewable_forums();
$inactiveforums = get_inactive_forums();

	add_breadcrumb($lang->nav_syndication);
$unviewable = get_unviewable_forums();
$inactiveforums = get_inactive_forums();

	if(is_array($forums))



	$unexp = explode(',', $unviewable . ',' . $inactiveforums);

if(is_array($forums) && !in_array('all', $forums))

	{

	{

		$unexp = explode(",", str_replace("'", '', $unviewable));
foreach($unexp as $fid)
{
$unview[$fid] = true;
}

$unexp = explode(",", $inactiveforums);
foreach($unexp as $fid)
{
$unview[$fid] = true;
}

$syndicate = '';
$comma = '';
$all = false;

 
		foreach($forums as $fid)
{

		foreach($forums as $fid)
{

			if($fid == "all")
{
$all = true;
break;
}
elseif(is_numeric($fid))
{
if(!isset($unview[$fid]))
{
$syndicate .= $comma.$fid;
$comma = ",";
$flist[$fid] = true;
}
}
}
$url = $mybb->settings['bburl']."/syndication.php";
if(!$all)
{
$url .= "?fid=$syndicate";
$add = true;
}

// If the version is not RSS2.0, set the type to Atom1.0.
if($version != "rss2.0")
{
if(!$add)
{
$url .= "?";
}
else
{
$url .= "&";
}
$url .= "type=atom1.0";
$add = true;
}
if((int)$limit > 0)
{
if($limit > 100)

			if(ctype_digit($fid) && !in_array($fid, $unexp))







































			{

			{

				$limit = 100;
}
if(!$add)
{
$url .= "?";
}
else
{
$url .= "&";
}
if(is_numeric($limit))
{
$url .= "limit=$limit";

				$syndicate[] = $fid;
$flist[$fid] = true;












			}
}

			}
}

		eval("\$feedurl = \"".$templates->get("misc_syndication_feedurl")."\";");






if(!empty($syndicate))
{
$urlquery[] = "fid=". implode(",", $syndicate);
}

	}

	}

	unset($GLOBALS['forumcache']);

 

// If there is no version in the input, check the default (RSS2.0).


// If there is no version in the input, check the default (RSS2.0).

	if($version == "atom1.0")
{







	$json1check = $atom1check = $rss2check = "";
if($version == "json")
{
$json1check = "checked=\"checked\"";
$urlquery[] = "type=".$version;
}
elseif($version == "atom1.0")
{

		$atom1check = "checked=\"checked\"";

		$atom1check = "checked=\"checked\"";

		$rss2check = '';
}

		$urlquery[] = "type=".$version;
}

	else
{

	else
{

		$atom1check = '';

 
		$rss2check = "checked=\"checked\"";
}

		$rss2check = "checked=\"checked\"";
}

 
	// Evaluate, reset and set limit (Drive through settings?)
$limit = empty($limit) ? 15 : (($limit > 50) ? 50 : $limit);
$urlquery[] = "limit=" . $limit;

// Generate feed url
if(!empty($urlquery)){
$url .= "?" . implode('&', $urlquery);
}
eval("\$feedurl = \"".$templates->get("misc_syndication_feedurl")."\";");

unset($GLOBALS['forumcache']);


	$forumselect = makesyndicateforums();

	$forumselect = makesyndicateforums();





	$plugins->run_hooks("misc_syndication_end");

eval("\$syndication = \"".$templates->get("misc_syndication")."\";");
output_page($syndication);

	$plugins->run_hooks("misc_syndication_end");

eval("\$syndication = \"".$templates->get("misc_syndication")."\";");
output_page($syndication);

}

}

elseif($mybb->input['action'] == "clearcookies")
{
verify_post_check($mybb->get_input('my_post_key'));

elseif($mybb->input['action'] == "clearcookies")
{
verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("misc_clearcookies");


	$plugins->run_hooks("misc_clearcookies");


	$remove_cookies = array('mybb', 'mybbuser', 'mybb[password]', 'mybb[lastvisit]', 'mybb[lastactive]', 'collapsed', 'mybb[forumread]', 'mybb[threadsread]', 'mybbadmin');



	$remove_cookies = array('mybbuser', 'mybb[announcements]', 'mybb[lastvisit]', 'mybb[lastactive]', 'collapsed', 'mybb[forumread]', 'mybb[threadsread]', 'mybbadmin',
'mybblang', 'mybbtheme', 'multiquote', 'mybb[readallforums]', 'coppauser', 'coppadob', 'mybb[referrer]');


	foreach($remove_cookies as $name)

	foreach($remove_cookies as $name)

	{
@my_setcookie($name, '', TIME_NOW-1, $mybb->settings['cookiepath'], $mybb->settings['cookiedomain']);

	{
my_unsetcookie($name);

	}
redirect("index.php", $lang->redirect_cookiescleared);
}

	}
redirect("index.php", $lang->redirect_cookiescleared);
}


function makesyndicateforums($pid="0", $selitem="", $addselect="1", $depth="", $permissions="")











/**
* Build a list of forums for RSS multiselect.
*
* @param int $pid Parent forum ID.
* @param string $selitem deprecated
* @param boolean $addselect Whether to add selected attribute or not.
* @param string $depth HTML for the depth of the forum.
* @return string HTML of the list of forums for CSS.
*/
function makesyndicateforums($pid=0, $selitem="", $addselect=true, $depth="")

{

{

	global $db, $forumcache, $permissioncache, $mybb, $forumlist, $forumlistbits, $flist, $lang, $unviewable, $inactiveforums, $templates;
static $unviewableforums;

	global $db, $forumcache, $permissioncache, $mybb, $forumlist, $forumlistbits, $flist, $lang, $unexp, $templates;



$pid = (int)$pid;


$pid = (int)$pid;

	if(!$permissions)
{
$permissions = $mybb->usergroup;
}

	$forumlist = '';





if(!is_array($forumcache))


if(!is_array($forumcache))

	{

	{

		// Get Forums
$query = $db->simple_select("forums", "*", "linkto = '' AND active!=0", array('order_by' => 'pid, disporder'));
while($forum = $db->fetch_array($query))

		// Get Forums
$query = $db->simple_select("forums", "*", "linkto = '' AND active!=0", array('order_by' => 'pid, disporder'));
while($forum = $db->fetch_array($query))

Zeile 974Zeile 962
	if(!is_array($permissioncache))
{
$permissioncache = forum_permissions();

	if(!is_array($permissioncache))
{
$permissioncache = forum_permissions();

	}

if(!$unviewableforums)
{
// Save our unviewable forums in an array
$unviewableforums = explode(",", str_replace("'", '', $unviewable.','.$inactiveforums));

 
	}

if(is_array($forumcache[$pid]))

	}

if(is_array($forumcache[$pid]))

Zeile 991Zeile 973
				$perms = $permissioncache[$forum['fid']];
if($perms['canview'] == 1 || $mybb->settings['hideprivateforums'] == 0)
{

				$perms = $permissioncache[$forum['fid']];
if($perms['canview'] == 1 || $mybb->settings['hideprivateforums'] == 0)
{

 
					$optionselected = '';

					if(isset($flist[$forum['fid']]))

					if(isset($flist[$forum['fid']]))

					{
$optionselected = "selected=\"selected\"";
$selecteddone = "1";
}
else
{
$optionselected = '';
}

if($forum['password'] == '' && !in_array($forum['fid'], $unviewableforums) || $forum['password'] && isset($mybb->cookies['forumpass'][$forum['fid']]) && $mybb->cookies['forumpass'][$forum['fid']] == md5($mybb->user['uid'].$forum['password']))
{
$forumlistbits .= "<option value=\"{$forum['fid']}\" $optionselected>$depth {$forum['name']}</option>\n";
}

					{
$optionselected = 'selected="selected"';
}

if($forum['password'] == '' && !in_array($forum['fid'], $unexp) || $forum['password'] && isset($mybb->cookies['forumpass'][$forum['fid']]) && my_hash_equals($mybb->cookies['forumpass'][$forum['fid']], md5($mybb->user['uid'].$forum['password'])))
{
eval("\$forumlistbits .= \"".$templates->get("misc_syndication_forumlist_forum")."\";");
}







if(!empty($forumcache[$forum['fid']]))
{
$newdepth = $depth."&nbsp;&nbsp;&nbsp;&nbsp;";


if(!empty($forumcache[$forum['fid']]))
{
$newdepth = $depth."&nbsp;&nbsp;&nbsp;&nbsp;";

						$forumlistbits .= makesyndicateforums($forum['fid'], $selitem, 0, $newdepth, $perms);








						$forumlistbits .= makesyndicateforums($forum['fid'], '', 0, $newdepth);
}
}
else
{
if(isset($flist[$forum['fid']]))
{
unset($flist[$forum['fid']]);

					}
}
}

					}
}
}

		}

		}

	}

	}

 


	if($addselect)
{

	if($addselect)
{

		if(empty($selecteddone))
{
$addsel = " selected=\"selected\"";
}
else
{
$addsel = '';
}


		$addsel = empty($flist) ? ' selected="selected"' : '';









		eval("\$forumlist = \"".$templates->get("misc_syndication_forumlist")."\";");
}


		eval("\$forumlist = \"".$templates->get("misc_syndication_forumlist")."\";");
}