Vergleich misc.php - 1.6.0 - 1.6.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: misc.php 5114 2010-07-25 22:52:44Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'misc.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'misc.php');


$templatelist = "redirect_markallread,redirect_markforumread";

$templatelist = "misc_rules_forum,misc_help_helpdoc,misc_whoposted_poster,misc_whoposted,misc_smilies_popup_smilie,misc_smilies_popup,misc_syndication_feedurl,misc_syndication";

$templatelist .= ",misc_buddypopup,misc_buddypopup_user_online,misc_buddypopup_user_offline,misc_buddypopup_user_sendpm";

$templatelist .= ",misc_buddypopup,misc_buddypopup_user_online,misc_buddypopup_user_offline,misc_buddypopup_user_sendpm";

$templatelist .= ",misc_smilies,misc_smilies_smilie,misc_help_section_bit,misc_help_section,misc_help";

$templatelist .= ",misc_smilies,misc_smilies_smilie,misc_help_section_bit,misc_help_section,misc_help,forumdisplay_password_wrongpass,forumdisplay_password";

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 49Zeile 49
}
if($mybb->input['action'] == "markread")
{

}
if($mybb->input['action'] == "markread")
{

 
	if($mybb->user['uid'] && verify_post_check($mybb->input['my_post_key'], true) !== true)
{
// Protect our user's unread forums from CSRF
error($lang->invalid_post_code);
}


	if($mybb->input['fid'])
{
$mybb->input['fid'] = intval($mybb->input['fid']);

	if($mybb->input['fid'])
{
$mybb->input['fid'] = intval($mybb->input['fid']);

Zeile 64Zeile 70
				echo 0;
exit;
}

				echo 0;
exit;
}

		}


		}


		require_once MYBB_ROOT."/inc/functions_indicators.php";
mark_forum_read($mybb->input['fid']);

		require_once MYBB_ROOT."/inc/functions_indicators.php";
mark_forum_read($mybb->input['fid']);





		$plugins->run_hooks("misc_markread_forum");

if(!$mybb->input['ajax'])
{
redirect(get_forum_link($mybb->input['fid']), $lang->redirect_markforumread);

		$plugins->run_hooks("misc_markread_forum");

if(!$mybb->input['ajax'])
{
redirect(get_forum_link($mybb->input['fid']), $lang->redirect_markforumread);

		}

		}

		else
{
echo 1;

		else
{
echo 1;

Zeile 82Zeile 88
		}
}
else

		}
}
else

	{

	{


$plugins->run_hooks("misc_markread_end");
require_once MYBB_ROOT."/inc/functions_indicators.php";


$plugins->run_hooks("misc_markread_end");
require_once MYBB_ROOT."/inc/functions_indicators.php";

Zeile 96Zeile 102

if($mybb->input['fid'])
{


if($mybb->input['fid'])
{

 
		if(!verify_post_check($mybb->input['my_post_key']))
{
error($lang->invalid_post_code);
}


		my_unsetcookie("forumpass[".intval($mybb->input['fid'])."]");
redirect("index.php", $lang->redirect_forumpasscleared);
}

		my_unsetcookie("forumpass[".intval($mybb->input['fid'])."]");
redirect("index.php", $lang->redirect_forumpasscleared);
}

Zeile 106Zeile 117
	{
$plugins->run_hooks("misc_rules_start");


	{
$plugins->run_hooks("misc_rules_start");


		$query = $db->simple_select("forums", "*", "fid='".intval($mybb->input['fid'])."' AND active!=0");
$forum = $db->fetch_array($query);






		$fid = intval($mybb->input['fid']);

$forum = get_forum($fid);
if(!$forum || $forum['type'] != "f" || $forum['rules'] == '')
{
error($lang->error_invalidforum);
}


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


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


if($forum['type'] != "f" || $forum['rules'] == '')
{
error($lang->error_invalidforum);
}

 
		if($forumpermissions['canview'] != 1)
{
error_no_permission();
}

		if($forumpermissions['canview'] != 1)
{
error_no_permission();
}

 


		if(!$forum['rulestitle'])
{
$forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']);

		if(!$forum['rulestitle'])
{
$forum['rulestitle'] = $lang->sprintf($lang->forum_rules, $forum['name']);

Zeile 298Zeile 310
	{
error_no_permission();
}

	{
error_no_permission();
}

	if($mybb->input['removebuddy'])

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

	{
$buddies = $mybb->user['buddylist'];
$namesarray = explode(",",$buddies);
if(is_array($namesarray))
{
foreach($namesarray as $key => $buddyid)

	{
$buddies = $mybb->user['buddylist'];
$namesarray = explode(",",$buddies);
if(is_array($namesarray))
{
foreach($namesarray as $key => $buddyid)

			{

			{

				if($buddyid == $mybb->input['removebuddy'])
{
unset($namesarray[$key]);

				if($buddyid == $mybb->input['removebuddy'])
{
unset($namesarray[$key]);

Zeile 320Zeile 332
	if($mybb->user['buddylist'] != "")
{
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

	if($mybb->user['buddylist'] != "")
{
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

		$query = $db->query("
SELECT u.*, g.canusepms
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
WHERE u.uid IN ({$mybb->user['buddylist']})
ORDER BY u.lastactive
");

		$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array('order_by' => 'lastactive'));







		while($buddy = $db->fetch_array($query))
{
$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; }');

		while($buddy = $db->fetch_array($query))
{
$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; }');

			if($mybb->user['receivepms'] != 0 && $buddy['receivepms'] != 0 && $buddy['canusepms'] != 0)



if($mybb->user['receivepms'] != 0 && $buddy['receivepms'] != 0 && $groupscache[$buddy['usergroup']]['canusepms'] != 0)

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

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

Zeile 350Zeile 358

if($buddy['avatar'])
{


if($buddy['avatar'])
{

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

				if($buddy['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";

				if($buddy['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";

Zeile 397Zeile 406
elseif($mybb->input['action'] == "whoposted")
{
$numposts = 0;

elseif($mybb->input['action'] == "whoposted")
{
$numposts = 0;

	$altbg = "trow1";

	$altbg = alt_trow();

	$whoposted = '';
$tid = intval($mybb->input['tid']);
$thread = get_thread($tid);

	$whoposted = '';
$tid = intval($mybb->input['tid']);
$thread = get_thread($tid);

Zeile 414Zeile 423
	}

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

	}

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

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

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

	{
error($lang->error_invalidthread);
}

	{
error($lang->error_invalidthread);
}

Zeile 428Zeile 437
	// Does the user have permission to view this thread?
$forumpermissions = forum_permissions($forum['fid']);


	// Does the user have permission to view this thread?
$forumpermissions = forum_permissions($forum['fid']);


	if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1)

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

	{
error_no_permission();
}

	{
error_no_permission();
}

Zeile 477Zeile 486
	$smilies = '';
if($mybb->input['popup'])
{ // make small popup list of smilies

	$smilies = '';
if($mybb->input['popup'])
{ // make small popup list of smilies

		$editor = addslashes(htmlentities($mybb->input['editor']));

		$editor = preg_replace('#([^a-zA-z0-9_-]+)#', '', $mybb->input['editor']);

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

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

Zeile 485Zeile 494
		while($smilie = $db->fetch_array($query))
{
$smilie['insert'] = addslashes($smilie['find']);

		while($smilie = $db->fetch_array($query))
{
$smilie['insert'] = addslashes($smilie['find']);

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

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

			eval("\$smilies .= \"".$templates->get("misc_smilies_popup_smilie")."\";");
if($e == 2)
{

			eval("\$smilies .= \"".$templates->get("misc_smilies_popup_smilie")."\";");
if($e == 2)
{

Zeile 653Zeile 662
	{
$atom1check = "checked=\"checked\"";
$rss2check = '';

	{
$atom1check = "checked=\"checked\"";
$rss2check = '';

	}

	}

	else
{
$atom1check = '';
$rss2check = "checked=\"checked\"";
}

	else
{
$atom1check = '';
$rss2check = "checked=\"checked\"";
}

	$forumselect = makesyndicateforums("", $blah);


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

}


}



if($mybb->input['action'] == "clearcookies")
{


if($mybb->input['action'] == "clearcookies")
{

Zeile 675Zeile 684
	if($mybb->input['key'] != $mybb->user['logoutkey'])
{
error($lang->error_invalidkey);

	if($mybb->input['key'] != $mybb->user['logoutkey'])
{
error($lang->error_invalidkey);

	}

	}


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



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


Zeile 698Zeile 707

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


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

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


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


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


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

 


	if(!is_array($forumcache))
{
// Get Forums

	if(!is_array($forumcache))
{
// Get Forums

Zeile 714Zeile 725
			$forumcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}
}

			$forumcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}
}

 


	if(!is_array($permissioncache))

	if(!is_array($permissioncache))

	{

	{

		$permissioncache = forum_permissions();
}

		$permissioncache = forum_permissions();
}

 

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


	if(is_array($forumcache[$pid]))
{
foreach($forumcache[$pid] as $key => $main)

	if(is_array($forumcache[$pid]))
{
foreach($forumcache[$pid] as $key => $main)

Zeile 737Zeile 756
						$optionselected = '';
}


						$optionselected = '';
}


					if($forum['password'] == '')

					if($forum['password'] == '' && !in_array($forum['fid'], $unviewableforums) || $forum['password'] && $mybb->cookies['forumpass'][$forum['fid']] == md5($mybb->user['uid'].$forum['password']))

					{
$forumlistbits .= "<option value=\"{$forum['fid']}\" $optionselected>$depth {$forum['name']}</option>\n";
}

					{
$forumlistbits .= "<option value=\"{$forum['fid']}\" $optionselected>$depth {$forum['name']}</option>\n";
}

 


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

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