Vergleich admin/adminfunctions.php - 1.2.0 - 1.2.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: adminfunctions.php 2164 2006-08-30 06:17:49Z chris $

 * $Id: adminfunctions.php 3311 2007-09-13 13:55:27Z chris $

 */

$cssselectors = array(

 */

$cssselectors = array(

Zeile 84Zeile 84
	{
$htmltag = str_replace("<html", "<html lang=\"".$lang->settings['htmllang']."\"", $htmltag);
}

	{
$htmltag = str_replace("<html", "<html lang=\"".$lang->settings['htmllang']."\"", $htmltag);
}

 


	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo $htmltag;
echo "<head>\n";

	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo $htmltag;
echo "<head>\n";

Zeile 100Zeile 101
	if($onload)
{
echo "<body onload=\"$onload\">\n";

	if($onload)
{
echo "<body onload=\"$onload\">\n";

	}

	}

	else
{
echo "<body class=\"main_body\">\n";

	else
{
echo "<body class=\"main_body\">\n";

Zeile 116Zeile 117
	echo "<tr><td class=\"hoptobuttons\">";
if(!is_array($links))
{

	echo "<tr><td class=\"hoptobuttons\">";
if(!is_array($links))
{

		$links[] = $links;

		$links = array($links);

	}
foreach($links as $key => $val)

	}
foreach($links as $key => $val)

	{

	{

		echo $val;
}
echo "</td></tr>";

		echo $val;
}
echo "</td></tr>";

Zeile 127Zeile 128
}

function startform($script, $name="", $action="", $autocomplete=1)

}

function startform($script, $name="", $action="", $autocomplete=1)

{

{

	global $admin_session;
$acomplete = "";
if($autocomplete == 0)

	global $admin_session;
$acomplete = "";
if($autocomplete == 0)

	{

	{

		$acomplete = " autocomplete=\"off\"";
}
if($name != '')

		$acomplete = " autocomplete=\"off\"";
}
if($name != '')

	{

	{

    	$name = " name=\"$name\"";
}
echo "<form action=\"$script\" method=\"post\"$name enctype=\"multipart/form-data\"$acomplete>\n";

    	$name = " name=\"$name\"";
}
echo "<form action=\"$script\" method=\"post\"$name enctype=\"multipart/form-data\"$acomplete>\n";

Zeile 152Zeile 153
	echo "<table cellpadding=\"$padding\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"tback\">";
}
function tableheader($title, $anchor="", $colspan=2)

	echo "<table cellpadding=\"$padding\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"tback\">";
}
function tableheader($title, $anchor="", $colspan=2)

{
global $bgcolor;


{
global $bgcolor;


	if($anchor)
{
$anchor = "<a name=\"$anchor\">$title</a>";

	if($anchor)
{
$anchor = "<a name=\"$anchor\">$title</a>";

Zeile 261Zeile 262
		$ac = " autocomplete=\"off\"";
}
if($value != '')

		$ac = " autocomplete=\"off\"";
}
if($value != '')

	{

	{

		$value = " value=\"{$value}\"";
}
echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\" width=\"60%\"><input type=\"password\" class=\"inputbox\" name=\"$name\" size=\"$size\"$ac$value /></td>\n</tr>\n";

		$value = " value=\"{$value}\"";
}
echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\" width=\"60%\"><input type=\"password\" class=\"inputbox\" name=\"$name\" size=\"$size\"$ac$value /></td>\n</tr>\n";

}

}

function maketextareacode($title, $name, $value="", $rows="4", $columns="40")

function maketextareacode($title, $name, $value="", $rows="4", $columns="40")

{
$bgcolor = getaltbg();
$value = htmlspecialchars_uni($value);

{
$bgcolor = getaltbg();
$value = htmlspecialchars_uni($value);

	echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\" width=\"60%\"><textarea name=\"$name\" rows=\"$rows\" cols=\"$columns\">$value</textarea></td>\n</tr>\n";
}
function makehiddencode($name, $value="", $nameid="name")

	echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\" width=\"60%\"><textarea name=\"$name\" rows=\"$rows\" cols=\"$columns\">$value</textarea></td>\n</tr>\n";
}
function makehiddencode($name, $value="", $nameid="name")

Zeile 278Zeile 279
	echo "<input type=\"hidden\" $nameid=\"$name\" value=\"$value\" />\n";
}
function makeyesnocode($title, $name, $value="yes")

	echo "<input type=\"hidden\" $nameid=\"$name\" value=\"$value\" />\n";
}
function makeyesnocode($title, $name, $value="yes")

{

{

	global $lang;
$bgcolor = getaltbg();
if($value == "no")

	global $lang;
$bgcolor = getaltbg();
if($value == "no")

	{

	{

		$nocheck = " checked=\"checked\"";
}
else

		$nocheck = " checked=\"checked\"";
}
else

Zeile 296Zeile 297
	global $lang;
$bgcolor = getaltbg();
if($value == "off")

	global $lang;
$bgcolor = getaltbg();
if($value == "off")

	{

	{

		$offcheck = "checked";
}
else

		$offcheck = "checked";
}
else

	{

	{

		$oncheck = "checked";
}
echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\" width=\"60%\"><label><input type=\"radio\" name=\"$name\" value=\"on\" $oncheck>&nbsp;$lang->on</label> &nbsp;&nbsp;<label><input type=\"radio\" name=\"$name\" value=\"off\" $offcheck>&nbsp;$lang->off</label></td>\n</tr>\n";

		$oncheck = "checked";
}
echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\" width=\"60%\"><label><input type=\"radio\" name=\"$name\" value=\"on\" $oncheck>&nbsp;$lang->on</label> &nbsp;&nbsp;<label><input type=\"radio\" name=\"$name\" value=\"off\" $offcheck>&nbsp;$lang->off</label></td>\n</tr>\n";

Zeile 331Zeile 332
		else
{
echo "<option value=\"$item[$tableid]\">$item[$optiondisp]</option>\n";

		else
{
echo "<option value=\"$item[$tableid]\">$item[$optiondisp]</option>\n";

		}
}

		}
}

	if($extra)
{
$eq_pos = strpos($extra, "=");
if($eq_pos !== false)

	if($extra)
{
$eq_pos = strpos($extra, "=");
if($eq_pos !== false)

		{

		{

			$exp = explode("=", $extra, 2);
$extra = $exp[1];
$value = $exp[0];

			$exp = explode("=", $extra, 2);
$extra = $exp[1];
$value = $exp[0];

		}

		}

		else
{
$value = "0";

		else
{
$value = "0";

Zeile 350Zeile 351
		if($selected == $value)
{
echo "<option value=\"$value\" selected>$extra</option>\n";

		if($selected == $value)
{
echo "<option value=\"$value\" selected>$extra</option>\n";

		}

		}

		else
{
echo "<option value=\"$value\">$extra</option>\n";

		else
{
echo "<option value=\"$value\">$extra</option>\n";

Zeile 368Zeile 369
		echo "<option value=\"\"> $blank_label</option>";
}
if(!is_array($options))

		echo "<option value=\"\"> $blank_label</option>";
}
if(!is_array($options))

	{
$options[] = $options;
}

	{
$options = array($options);
}

	foreach($options as $value => $label)

	foreach($options as $value => $label)

	{

	{

		if($value == $selected)

		if($value == $selected)

		{

		{

			echo "<option value=\"$value\" selected=\"selected\">$label</option>\n";

			echo "<option value=\"$value\" selected=\"selected\">$label</option>\n";

		}
else
{
echo "<option value=\"$value\">$label</option>\n";
}
}
echo "</select>\n</td>\n</tr>\n";
}
function makedateselect($title, $name, $day, $month, $year)
{
$dname = $name."[day]";
$mname = $name."[month]";
$yname = $name."[year]";

for($i = 1; $i <= 31; $i++)
{
if($day == $i)
{
$daylist .= "<option value=\"$i\" selected>$i</option>\n";
}

		}




















		else
{

		else
{

			$daylist .= "<option value=\"$i\">$i</option>\n";

			echo "<option value=\"$value\">$label</option>\n";

		}
}

		}
}

 
	echo "</select>\n</td>\n</tr>\n";
}





	$monthsel[$month] = "selected";
$monthlist .= "<option value=\"\">------------</option>";
$monthlist .= "<option value=\"01\" $monthsel[01]>January</option>\n";
$monthlist .= "<option value=\"02\" $monthsel[02]>February</option>\n";
$monthlist .= "<option value=\"03\" $monthsel[03]>March</option>\n";
$monthlist .= "<option value=\"04\" $monthsel[04]>April</option>\n";
$monthlist .= "<option value=\"05\" $monthsel[05]>May</option>\n";
$monthlist .= "<option value=\"06\" $monthsel[06]>June</option>\n";
$monthlist .= "<option value=\"07\" $monthsel[07]>July</option>\n";
$monthlist .= "<option value=\"08\" $monthsel[08]>August</option>\n";
$monthlist .= "<option value=\"09\" $monthsel[09]>September</option>\n";
$monthlist .= "<option value=\"10\" $monthsel[10]>October</option>\n";
$monthlist .= "<option value=\"11\" $monthsel[11]>November</option>\n";
$monthlist .= "<option value=\"12\" $monthsel[12]>December</option>\n";
$dateselect = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>\n";
$dateselect .= "<td><b><small>Day</small></b><br />\n<select name=\"$dname\"><option value=\"\">--</option>\n$daylist</select></td>\n";
$dateselect .= "<td><b><small>Month</small></b><br />\n<select name=\"$mname\">$monthlist</select></td>\n";
$dateselect .= "<td><b><small>Year</small></b><br />\n<input name=\"$yname\" value=\"$year\" size=\"4\"></td>\n";
$dateselect .= "</tr></table>";

$bgcolor = getaltbg();

echo "<tr>\n<td class=\"$bgcolor\" valign=\"top\" width=\"40%\">$title</td>\n<td class=\"$bgcolor\" valign=\"top\">$dateselect</tr>\n";
}

 
function makebuttoncode($name, $value, $type="submit", $onclick="", $nameid="name")
{
if($onclick != '')

function makebuttoncode($name, $value, $type="submit", $onclick="", $nameid="name")
{
if($onclick != '')

Zeile 879Zeile 839
function cpfooter($showversion=1)
{
global $mybb, $db, $maintimer, $lang;

function cpfooter($showversion=1)
{
global $mybb, $db, $maintimer, $lang;

 


	echo "<div align=\"center\">\n<br />\n<br />\n";
$totaltime = $maintimer->stop();
$lang->footer_stats = sprintf($lang->footer_stats, $totaltime, $db->query_count);

	echo "<div align=\"center\">\n<br />\n<br />\n";
$totaltime = $maintimer->stop();
$lang->footer_stats = sprintf($lang->footer_stats, $totaltime, $db->query_count);

Zeile 890Zeile 851
	{
$mybbversion = $mybb->version;
}

	{
$mybbversion = $mybb->version;
}

	echo "<font size=\"1\" face=\"Verdana,Arial,Helvetica\">\n".$lang->footer_powered_by."\n<b>\n<a href=\"http://www.mybboard.com\" target=\"_blank\">MyBB</a> $mybbversion\n</b>\n<br />\n".$lang->footer_copyright." &copy; 2002-".my_date("Y")." <a href=\"http://www.mybboard.com\">MyBB Group</a>\n<br />\n".$lang->footer_stats."\n</font>\n</div>\n";

	echo "<font size=\"1\" face=\"Verdana,Arial,Helvetica\">\n".$lang->footer_powered_by."\n<b>\n<a href=\"http://www.mybboard.net\" target=\"_blank\">MyBB</a> $mybbversion\n</b>\n<br />\n".$lang->footer_copyright." &copy; 2002-".my_date("Y")." <a href=\"http://www.mybboard.net\">MyBB Group</a>\n<br />\n".$lang->footer_stats."\n</font>\n</div>\n";

	echo "</body>\n";
echo "</html>";
}

	echo "</body>\n";
echo "</html>";
}

Zeile 901Zeile 862
	if($bgcolor == "altbg1")
{
$bgcolor = "altbg2";

	if($bgcolor == "altbg1")
{
$bgcolor = "altbg2";

	}
else

	}
else

	{
$bgcolor = "altbg1";
}
return $bgcolor;

	{
$bgcolor = "altbg1";
}
return $bgcolor;

}

}

function startnav()

function startnav()

{
echo "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"100%\" class=\"lnavbordercolor\">\n";
echo "<tr>\n<td>\n";
echo "<table cellpadding=\"6\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n";
}

{
echo "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"100%\" class=\"lnavbordercolor\">\n";
echo "<tr>\n<td>\n";
echo "<table cellpadding=\"6\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n";
}

function makenavoption($name, $url)
{
global $navoptions;

function makenavoption($name, $url)
{
global $navoptions;

Zeile 933Zeile 894
	echo "<ul>\n";
echo $navoptions;
echo "</ul>\n</td>\n";

	echo "<ul>\n";
echo $navoptions;
echo "</ul>\n</td>\n";

	echo "</table>\n";
echo "</td>\n</tr>\n</table>\n";
echo "<br />\n";



	echo "</tr>\n";
echo "</table>\n";
echo "</td>\n</tr>\n</table>\n";
echo "<br />\n";


	$navoptions = "";
}


	$navoptions = "";
}






function endnav()
{
echo "</table>\n";
echo "</td>\n</tr>\n</table>\n";
echo "<br />\n";

function endnav()
{
echo "</table>\n";
echo "</td>\n</tr>\n</table>\n";
echo "<br />\n";

}
function makenavgroup($name="")

}
function makenavgroup($name="")

{
global $noframes, $navoptions, $navselects;
if($noframes)

{
global $noframes, $navoptions, $navselects;
if($noframes)

Zeile 969Zeile 931
function makehopper($name, $values, $onchange="")
{
if(!is_array($values))

function makehopper($name, $values, $onchange="")
{
if(!is_array($values))

	{
$values[] = $values;

	{
$values = array($values);

	}
foreach($values as $action => $title)

	}
foreach($values as $action => $title)

	{

	{

		$options .= "<option value=\"$action\">$title</option>\n";
}
$buttononchange = "";
if($onchange)
{

		$options .= "<option value=\"$action\">$title</option>\n";
}
$buttononchange = "";
if($onchange)
{

	  $buttononchange = " onclick=\"{$onchange} this.form.submit(); return false;\"";
$onchange .= " ";
}

	  	$buttononchange = " onclick=\"{$onchange} this.form.submit(); return false;\"";
$onchange .= " ";
}

	return "<select name=\"$name\" onchange=\"{$onchange}this.form.submit();\">\n$options</select>\n&nbsp;\n<input type=\"submit\" value=\"Go\"$buttononchange />\n";
}


	return "<select name=\"$name\" onchange=\"{$onchange}this.form.submit();\">\n$options</select>\n&nbsp;\n<input type=\"submit\" value=\"Go\"$buttononchange />\n";
}


Zeile 1000Zeile 962
function forumselect($name, $selected="",$fid="0",$depth="", $shownone="1", $extra="", $extra2="")
{
global $db, $forumselect, $lang, $cforumcache;

function forumselect($name, $selected="",$fid="0",$depth="", $shownone="1", $extra="", $extra2="")
{
global $db, $forumselect, $lang, $cforumcache;


if(!is_array($cforumcache))


if(!is_array($cforumcache))

	{
$options = array(
'order_by' => 'disporder'

	{
$options = array(
'order_by' => 'disporder'

Zeile 1055Zeile 1017
		}
$forumselect .= ">$depth$startforum[name]</option>";
$depth .= "--";

		}
$forumselect .= ">$depth$startforum[name]</option>";
$depth .= "--";

	}

if(is_array($cforumcache['pid'][$fid]))

	}

if(is_array($cforumcache['pid'][$fid]))

	{
foreach($cforumcache['pid'][$fid] as $forum)
{

	{
foreach($cforumcache['pid'][$fid] as $forum)
{

Zeile 1085Zeile 1047
{
global $db, $forumchecklist, $lang, $cforumcache;
if(!is_array($cforumcache))

{
global $db, $forumchecklist, $lang, $cforumcache;
if(!is_array($cforumcache))

	{

	{

		$options = array(
'order_by' => 'disporder'
);
$query = $db->simple_select(TABLE_PREFIX."forums", "name, fid, pid", "", $options);
while($forum = $db->fetch_array($query))

		$options = array(
'order_by' => 'disporder'
);
$query = $db->simple_select(TABLE_PREFIX."forums", "name, fid, pid", "", $options);
while($forum = $db->fetch_array($query))

		{

		{

			$cforumcache['pid'][$forum['pid']][$forum['fid']] = $forum;
$cforumcache['fid'][$forum['fid']] = $forum;

			$cforumcache['pid'][$forum['pid']][$forum['fid']] = $forum;
$cforumcache['fid'][$forum['fid']] = $forum;

		}
}

		}
}


if(!$fid)


if(!$fid)

	{

	{

		if($extra)
{
$selected1 = '';

		if($extra)
{
$selected1 = '';

			if($selected == -1)





			if(!is_array($selected)) 
{
$selected = array($selected);
}
if(in_array(-1, $selected))

			{
$selected1 = ' checked="checked"';
}

			{
$selected1 = ' checked="checked"';
}

Zeile 1114Zeile 1080
	{
$startforum = $cforumcache['fid'][$fid];
$forumchecklist .= "$depth<input type=\"checkbox\" name=\"{$name}[]\" value=\"$startforum[fid]\"";

	{
$startforum = $cforumcache['fid'][$fid];
$forumchecklist .= "$depth<input type=\"checkbox\" name=\"{$name}[]\" value=\"$startforum[fid]\"";

		if($selected == $startforum['fid'] || (is_array($selected) && in_array($forum['fid'], $selected)))
{

		if(is_array($selected) && (in_array($startforum['fid'], $selected) || in_array($forum['fid'], $selected)))
{

			$forumchecklist .= ' checked="checked"';
}
$forumchecklist .= " /> $startforum[name]<br />\n";

			$forumchecklist .= ' checked="checked"';
}
$forumchecklist .= " /> $startforum[name]<br />\n";

Zeile 1128Zeile 1094
		{
forum_checkbox_list($name, $selected, $forum['fid'], $depth, $extra);
}

		{
forum_checkbox_list($name, $selected, $forum['fid'], $depth, $extra);
}

	}


	}


	return $forumchecklist;
}


	return $forumchecklist;
}


Zeile 1143Zeile 1109
		exit;
}
}

		exit;
}
}





function getadminpermissions($get_uid="", $get_gid="")
{
global $db, $mybb;

function getadminpermissions($get_uid="", $get_gid="")
{
global $db, $mybb;

 
	

	// Set UID and GID if none
$uid = $get_uid;
$gid = $get_gid;

	// Set UID and GID if none
$uid = $get_uid;
$gid = $get_gid;

 
	
$gid_array = array();


	if($uid === "")
{
$uid = $mybb->user['uid'];

	if($uid === "")
{
$uid = $mybb->user['uid'];

	}


	}


	if(!$gid)
{

	if(!$gid)
{

		$gid = $mybb->usergroup['gid'];














		// Prepare user's groups since the group isn't specified
$gid_array[] = (-1) * intval($mybb->user['usergroup']);
$additional_groups = explode(',', $mybb->user['additionalgroups']);
// Make sure gids are negative
foreach($additional_groups as $g)
{
$gid_array[] = (-1) * abs($g);
}
}
else
{
// Group is specified
// Make sure gid is negative
$gid = (-1) * abs($gid);

	}

	}


// Make sure gid is negative
$gid = (-1) * abs($gid);

 

// What are we trying to find?
if($get_gid && !$get_uid)
{


// What are we trying to find?
if($get_gid && !$get_uid)
{

 
		// A group only


		$options = array(
"order_by" => "uid",
"order_dir" => "ASC",
"limit" => "1"
);


		$options = array(
"order_by" => "uid",
"order_dir" => "ASC",
"limit" => "1"
);


		// A group only

 
		$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='$gid' OR uid='0') AND permsset != ''", $options);
$perms = $db->fetch_array($query);
return $perms;
}
else
{

		$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='$gid' OR uid='0') AND permsset != ''", $options);
$perms = $db->fetch_array($query);
return $perms;
}
else
{

 
		// A user and/or group


		$options = array(
"order_by" => "uid",
"order_dir" => "DESC"
);

		$options = array(
"order_by" => "uid",
"order_dir" => "DESC"
);

		// A user and/or group
$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='$uid' OR uid='0' OR uid='$gid') AND permsset != ''", $options);









		
// Prepare user's groups into SQL format
$group_sql = '';
foreach($gid_array as $gid)
{
$group_sql .= " OR uid='{$gid}'";
}

$perms_group = array();
$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='{$uid}'{$group_sql}) AND permsset != ''", $options);

		while($perm = $db->fetch_array($query))
{
// Sorting out which permission is which
if($perm['uid'] > 0)
{
$perms_user = $perm;

		while($perm = $db->fetch_array($query))
{
// Sorting out which permission is which
if($perm['uid'] > 0)
{
$perms_user = $perm;

			}


				return $perms_user;
}

			elseif($perm['uid'] < 0)

			elseif($perm['uid'] < 0)

			{
$perms_group = $perm;
}

			{
$perms_group[] = $perm;
}

			else
{
$perms_def = $perm;

			else
{
$perms_def = $perm;

 
			}
}

// Figure out group permissions...ugh.
foreach($perms_group as $gperms)
{
if(!isset($final_group_perms))
{
// Use this group as the base for admin group permissions
$final_group_perms = $gperms;
continue;
}

// Loop through each specific permission to find the highest permission
foreach($gperms as $perm_name => $perm_value)
{
if($final_group_perms[$perm_name] != 'yes' && $perm_value == 'yes')
{
$final_group_perms[$perm_name] = 'yes';
}

			}
}

// Send specific user, or group permissions before default.

			}
}

// Send specific user, or group permissions before default.

		if(isset($perms_user))
{
return $perms_user;
}
elseif(isset($perms_group))

		// If user's permission are explicitly set, they've already been returned above.
if(isset($final_group_perms))




		{

		{

			return $perms_group;

			return $final_group_perms;

		}
else
{

		}
else
{

Zeile 1221Zeile 1230
function logadmin()
{
global $mybbadmin, $db, $mybb;

function logadmin()
{
global $mybbadmin, $db, $mybb;

	$scriptname = basename($_SERVER['PHP_SELF']);

	$scriptname = basename($_SERVER['SCRIPT_NAME']);

	$qstring = explode("&", $_SERVER['QUERY_STRING']);
$sep = '';
foreach($qstring as $key => $value)

	$qstring = explode("&", $_SERVER['QUERY_STRING']);
$sep = '';
foreach($qstring as $key => $value)

Zeile 1988Zeile 1997
				{
echo "<option value=\"default\">- $lang->set_as_default</option>";
}

				{
echo "<option value=\"default\">- $lang->set_as_default</option>";
}

 
				echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";

			}

			}

			echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";

 
			echo "<option value=\"\" style=\"font-weight: bold;\">$lang->other_options</option>\n";
echo "<option value=\"download\">- $lang->export_theme</option>\n";
echo "</select>&nbsp;<input type=\"button\" onclick=\"theme_hop($theme[tid]);\" value=\"$lang->go\" /></td>\n";

			echo "<option value=\"\" style=\"font-weight: bold;\">$lang->other_options</option>\n";
echo "<option value=\"download\">- $lang->export_theme</option>\n";
echo "</select>&nbsp;<input type=\"button\" onclick=\"theme_hop($theme[tid]);\" value=\"$lang->go\" /></td>\n";

Zeile 2125Zeile 2134
		{
$array[$key] = killempty($val);
$val = $array[$key];

		{
$array[$key] = killempty($val);
$val = $array[$key];

		}

		}

		if(empty($val))
{
unset($array[$key]);

		if(empty($val))
{
unset($array[$key]);

		}
}

		}
}

	return $array;
}


	return $array;
}


Zeile 2161Zeile 2170
		else
{
$dropdown .= "<option value=\"{$d}\">{$d}</option>\n";

		else
{
$dropdown .= "<option value=\"{$d}\">{$d}</option>\n";

		}

		}

	}
$dropdown .= "</select>\n";


	}
$dropdown .= "</select>\n";


Zeile 2177Zeile 2186
		$month = $lang->$month_lang;

if($m == $options['selected_month'])

		$month = $lang->$month_lang;

if($m == $options['selected_month'])

		{

		{

			$dropdown .= "<option selected=\"selected\" value=\"{$m}\">{$month}</option>\n";
}
else

			$dropdown .= "<option selected=\"selected\" value=\"{$m}\">{$month}</option>\n";
}
else

Zeile 2186Zeile 2195
		}
}
$dropdown .= "</select>\n";

		}
}
$dropdown .= "</select>\n";





	// Add years to the dropdown.
$this_year = my_date("Y");
$years = array();

	// Add years to the dropdown.
$this_year = my_date("Y");
$years = array();

Zeile 2195Zeile 2204
	if(array_key_exists('years_back', $options) && array_key_exists('years_ahead', $options))
{
for($y = $this_year-$options['years_back']; $y <= ($this_year+$options['years_ahead']); $y++)

	if(array_key_exists('years_back', $options) && array_key_exists('years_ahead', $options))
{
for($y = $this_year-$options['years_back']; $y <= ($this_year+$options['years_ahead']); $y++)

	    {
$years[$y] = $y;
}

	    {
$years[$y] = $y;
}

	}
else
{

	}
else
{

Zeile 2211Zeile 2220
	// And the years.
$dropdown .= "<select name=\"{$id}_year\">\n";
if(isset($options['blank_fields']) && $options['blank_fields'] == true)

	// And the years.
$dropdown .= "<select name=\"{$id}_year\">\n";
if(isset($options['blank_fields']) && $options['blank_fields'] == true)

	{

	{

		$dropdown .= "<option value=\"0\"></option>\n";
}
foreach($years as $k => $v)

		$dropdown .= "<option value=\"0\"></option>\n";
}
foreach($years as $k => $v)

	{

	{

		if($k == $options['selected_year'] || (!$options['selected_year'] && $k == $this_year && !isset($options['no_selected_year'])))
{
$dropdown .= "<option selected=\"selected\" value=\"{$k}\">{$v}</option>\n";

		if($k == $options['selected_year'] || (!$options['selected_year'] && $k == $this_year && !isset($options['no_selected_year'])))
{
$dropdown .= "<option selected=\"selected\" value=\"{$k}\">{$v}</option>\n";

		}

		}

		else
{
$dropdown .= "<option value=\"{$k}\">{$v}</option>\n";

		else
{
$dropdown .= "<option value=\"{$k}\">{$v}</option>\n";

Zeile 2232Zeile 2241
	{
// Build hours HTML.
$dropdown .= "<select name=\"{$id}_hours\">\n";

	{
// Build hours HTML.
$dropdown .= "<select name=\"{$id}_hours\">\n";

		if(isset($options['blank_fields']) && $options['blank_fields'] == true)

		if(isset($options['blank_fields']) && $options['blank_fields'] == true)

		{
$dropdown .= "<option value=\"0\"></option>\n";
}

		{
$dropdown .= "<option value=\"0\"></option>\n";
}

Zeile 2245Zeile 2254
			else
{
$dropdown .= "<option value=\"{$h}\">{$h}</option>\n";

			else
{
$dropdown .= "<option value=\"{$h}\">{$h}</option>\n";

			}

			}

		}
$dropdown .= "</select>\n";


		}
$dropdown .= "</select>\n";


Zeile 2258Zeile 2267
		for($min = 0; $min <= 59; $min++)
{
if($min == $options['selected_minute'])

		for($min = 0; $min <= 59; $min++)
{
if($min == $options['selected_minute'])

			{

			{

				$dropdown .= "<option selected=\"selected\" value=\"{$min}\">{$min}</option>\n";
}
else

				$dropdown .= "<option selected=\"selected\" value=\"{$min}\">{$min}</option>\n";
}
else

Zeile 2267Zeile 2276
			}
}
$dropdown .= "</select>\n";

			}
}
$dropdown .= "</select>\n";

	}


	}


	return $dropdown;

}

	return $dropdown;

}

Zeile 2362Zeile 2371
function is_super_admin($uid)
{
global $config;

function is_super_admin($uid)
{
global $config;

 
	$config['super_admins'] = str_replace(" ", "", $config['super_admins']);

	if(strpos(",{$config['super_admins']},", ",{$uid},") === false)
{
return false;

	if(strpos(",{$config['super_admins']},", ",{$uid},") === false)
{
return false;

Zeile 2411Zeile 2421
		}
}
return $navigation;

		}
}
return $navigation;

 
}

function fetch_iconv_encoding($mysql_encoding)
{
$mysql_encoding = explode("_", $mysql_encoding);
switch($mysql_encoding[0])
{
case "utf8":
return "utf-8";
break;
case "latin1":
return "iso-8859-1";
break;
default:
return $mysql_encoding[0];
}

}
?>

}
?>