kostenloser Webspace werbefrei: lima-city


PHP-Fusion - Maintanance Infuse

lima-cityForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    psd

    psd hat kostenlosen Webspace.

    Hey,

    bei mir giebt der browser folgende warnungen aus und läd die seite nicht:

    Warning: require_once() [function.require-once]: Unable to access ../maincore.php in /home/webpages/lima-city/psd/html/cms/index.php on line 18
    
    Warning: require_once(../maincore.php) [function.require-once]: failed to open stream: No such file or directory in /home/webpages/lima-city/psd/html/cms/index.php on line 18
    
    Fatal error: require_once() [function.require]: Failed opening required '../maincore.php' (include_path='.:/usr/lib/php/') in /home/webpages/lima-city/psd/html/cms/index.php on line 18


    Hier die Datei:

    <?php
    /*-------------------------------------------------------+
    | PHP-Fusion Content Management System
    | Copyright (C) 2002 - 2008 Nick Jones
    | http://www.php-fusion.co.uk/
    +--------------------------------------------------------+
    | Filename: maintenance.php
    | Author: Nick Jones (Digitanium)
    +--------------------------------------------------------+
    | This program is released as free software under the
    | Affero GPL license. You can redistribute it and/or
    | modify it under the terms of this license which you
    | can read by viewing the included agpl.txt or online
    | at www.gnu.org/licenses/agpl.html. Removal of this
    | copyright header is strictly prohibited without
    | written permission from the original author(s).
    +--------------------------------------------------------*/
    require_once "maincore.php";
    include THEME."theme.php";
    
    if (!$settings['maintenance']) { redirect("index.php"); }
    
    echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
    echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";
    echo "<html>\n<head>\n";
    echo "<title>".$settings['sitename']."</title>\n";
    echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
    echo "<meta name='description' content='".$settings['description']."' />\n";
    echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
    echo "<style type='text/css'>html, body { height:100%; }</style>\n";
    echo "<link rel='stylesheet' href='".THEME."styles.css' type='text/css' media='screen'/>\n";
    echo "<link rel='shortcut icon' href='".IMAGES."favicon.ico' type='image/x-icon' />\n";
    echo "</head>\n<body class='tbl2'>\n";
    
    echo "<table style='width:100%;height:100%'>\n<tr>\n<td>\n";
    
    echo "<table cellpadding='0' cellspacing='1' width='80%' class='tbl-border center'>\n<tr>\n";
    echo "<td class='tbl1'>\n<div style='text-align:center'><br />\n";
    echo "<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' /><br /><br />\n";
    echo stripslashes(nl2br($settings['maintenance_message']))."<br /><br />\n";
    echo "Powered by <a href='http://www.php-fusion.co.uk'>PHP-Fusion</a> &copy; 2003 - ".date("Y")."<br /><br />\n";
    echo "</div>\n</td>\n</tr>\n</table>\n";
    
    if (!iMEMBER) {
    	echo "<div align='center'><br />\n";
    	echo "<form name='loginform' method='post' action='".FUSION_SELF."'>\n";
    	echo $locale['global_101'].": <input type='text' name='user_name' class='textbox' style='width:100px' />\n";
    	echo $locale['global_102'].": <input type='password' name='user_pass' class='textbox' style='width:100px' />\n";
    	echo "<input type='checkbox' name='remember_me' value='y' title='".$locale['global_103']."' />\n";
    	echo "<input type='submit' name='login' value='".$locale['global_104']."' class='button' />\n";
    	echo "</form>\n</div>\n";
    }
    
    echo "</td>\n</tr>\n</table>\n";
    
    echo "</body>\n</html>\n";
    
    ob_end_flush();
    ?>


    und die require
    <?php
    /*-------------------------------------------------------+
    | PHP-Fusion Content Management System
    | Copyright (C) 2002 - 2008 Nick Jones
    | http://www.php-fusion.co.uk/
    +--------------------------------------------------------+
    | Filename: maincore.php
    | Author: Nick Jones (Digitanium)
    +--------------------------------------------------------+
    | This program is released as free software under the
    | Affero GPL license. You can redistribute it and/or
    | modify it under the terms of this license which you
    | can read by viewing the included agpl.txt or online
    | at www.gnu.org/licenses/agpl.html. Removal of this
    | copyright header is strictly prohibited without
    | written permission from the original author(s).
    +--------------------------------------------------------*/
    if (eregi("maincore.php", $_SERVER['PHP_SELF'])) { die(); }
    
    error_reporting(E_ALL);
    
    // Calculate script start/end time
    function get_microtime() {
    	list($usec, $sec) = explode(" ", microtime()); 
    	return ((float)$usec + (float)$sec); 
    }
    
    // Define script start time
    define("START_TIME", get_microtime());
    
    // Prevent any possible XSS attacks via $_GET.
    foreach ($_GET as $check_url) {
    	if (!is_array($check_url)) {
    		$check_url = str_replace("\"", "", $check_url);
    		if ((eregi("<[^>]*script*\"?[^>]*>", $check_url)) || (eregi("<[^>]*object*\"?[^>]*>", $check_url)) ||
    			(eregi("<[^>]*iframe*\"?[^>]*>", $check_url)) || (eregi("<[^>]*applet*\"?[^>]*>", $check_url)) ||
    			(eregi("<[^>]*meta*\"?[^>]*>", $check_url)) || (eregi("<[^>]*style*\"?[^>]*>", $check_url)) ||
    			(eregi("<[^>]*form*\"?[^>]*>", $check_url)) || (eregi("\([^>]*\"?[^)]*\)", $check_url)) ||
    			(eregi("\"", $check_url))) {
    		die ();
    		}
    	}
    }
    unset($check_url);
    
    // Start Output Buffering
    //ob_start("ob_gzhandler"); //Uncomment this line to enable output compression.
    ob_start();
    
    // Locate config.php and set the basedir path
    $folder_level = ""; $i = 0;
    while (!file_exists($folder_level."config.php")) {
    	$folder_level .= "../"; $i++;
    	if ($i == 5) { die("Config file not found"); }
    }
    require_once $folder_level."config.php";
    define("BASEDIR", $folder_level);
    
    // If config.php is empty, activate setup.php script
    if (!isset($db_name)) { redirect("setup.php"); }
    
    // Multisite definitions
    require_once BASEDIR."includes/multisite_include.php";
    
    // Establish mySQL database connection
    $link = dbconnect($db_host, $db_user, $db_pass, $db_name);
    
    // Fetch the Site Settings from the database and store them in the $settings variable
    $settings = dbarray(dbquery("SELECT * FROM ".DB_SETTINGS));
    
    // Sanitise $_SERVER globals
    $_SERVER['PHP_SELF'] = cleanurl($_SERVER['PHP_SELF']);
    $_SERVER['QUERY_STRING'] = isset($_SERVER['QUERY_STRING']) ? cleanurl($_SERVER['QUERY_STRING']) : "";
    $_SERVER['REQUEST_URI'] = isset($_SERVER['REQUEST_URI']) ? cleanurl($_SERVER['REQUEST_URI']) : "";
    $PHP_SELF = cleanurl($_SERVER['PHP_SELF']);
    // Common definitions
    define("IN_FUSION", TRUE);
    define("FUSION_REQUEST", isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] != "" ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']);
    define("FUSION_QUERY", isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : "");
    define("FUSION_SELF", basename($_SERVER['PHP_SELF']));
    define("USER_IP", $_SERVER['REMOTE_ADDR']);
    define("QUOTES_GPC", (ini_get('magic_quotes_gpc') ? TRUE : FALSE));
    // Path definitions
    define("ADMIN", BASEDIR."administration/");
    define("IMAGES", BASEDIR."images/");
    define("IMAGES_A", IMAGES."articles/");
    define("IMAGES_N", IMAGES."news/");
    define("IMAGES_NC", IMAGES."news_cats/");
    define("RANKS", IMAGES."ranks/");
    define("INCLUDES", BASEDIR."includes/");
    define("LOCALE", BASEDIR."locale/");
    define("LOCALESET", $settings['locale']."/");
    define("FORUM", BASEDIR."forum/");
    define("INFUSIONS", BASEDIR."infusions/");
    define("PHOTOS", IMAGES."photoalbum/");
    define("THEMES", BASEDIR."themes/");
    
    // Predefine mysql_cache variables
    $smiley_cache = ""; $bbcode_cache = ""; $groups_cache = ""; $forum_rank_cache = ""; $forum_mod_rank_cache = "";
    
    // MySQL database functions
    function dbquery($query) {
    	$result = @mysql_query($query);
    	if (!$result) {
    		echo mysql_error();
    		return false;
    	} else {
    		return $result;
    	}
    }
    
    function dbcount($field, $table, $conditions = "") {
    	$cond = ($conditions ? " WHERE ".$conditions : "");
    	$result = @mysql_query("SELECT Count".$field." FROM ".$table.$cond);
    	if (!$result) {
    		echo mysql_error();
    		return false;
    	} else {
    		$rows = mysql_result($result, 0);
    		return $rows;
    	}
    }
    
    function dbresult($query, $row) {
    	$result = @mysql_result($query, $row);
    	if (!$result) {
    		echo mysql_error();
    		return false;
    	} else {
    		return $result;
    	}
    }
    
    function dbrows($query) {
    	$result = @mysql_num_rows($query);
    	return $result;
    }
    
    function dbarray($query) {
    	$result = @mysql_fetch_assoc($query);
    	if (!$result) {
    		echo mysql_error();
    		return false;
    	} else {
    		return $result;
    	}
    }
    
    function dbarraynum($query) {
    	$result = @mysql_fetch_row($query);
    	if (!$result) {
    		echo mysql_error();
    		return false;
    	} else {
    		return $result;
    	}
    }
    
    function dbconnect($db_host, $db_user, $db_pass, $db_name) {
    	$db_connect = @mysql_connect($db_host, $db_user, $db_pass);
    	$db_select = @mysql_select_db($db_name);
    	if (!$db_connect) {
    		die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Unable to establish connection to MySQL</b><br />".mysql_errno()." : ".mysql_error()."</div>");
    	} elseif (!$db_select) {
    		die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Unable to select MySQL database</b><br />".mysql_errno()." : ".mysql_error()."</div>");
    	}
    }
    
    // Initialise the $locale array
    $locale = array();
    
    // Load the Global language file
    include LOCALE.LOCALESET."global.php";
    
    // Check if users full or partial ip is blacklisted
    $sub_ip1 = substr(USER_IP, 0, strlen(USER_IP) - strlen(strrchr(USER_IP, ".")));
    $sub_ip2 = substr($sub_ip1, 0, strlen($sub_ip1) - strlen(strrchr($sub_ip1, ".")));
    
    if (dbcount("(*)", DB_BLACKLIST, "blacklist_ip='".USER_IP."' OR blacklist_ip='$sub_ip1' OR blacklist_ip='$sub_ip2'")) {
    	redirect("http://www.google.com/");
    }
    
    // PHP-Fusion user cookie functions
    if (!isset($_COOKIE[COOKIE_PREFIX.'visited'])) {
    	$result = dbquery("UPDATE ".DB_SETTINGS." SET counter=counter+1");
    	setcookie(COOKIE_PREFIX."visited", "yes", time() + 31536000, "/", "", "0");
    }
    
    //check that site or user theme exists
    function theme_exists($theme) {
    	if (!file_exists(THEMES) || !is_dir(THEMES)) {
    		return false;	
    	} else if (file_exists(THEMES.$theme."/theme.php") && file_exists(THEMES.$theme."/styles.css")) {
    		define("THEME", THEMES.$theme."/");
    		return true;
    	} else {
    		$dh = opendir(THEMES);
    		while (false !== ($entry = readdir($dh))) {
    			if ($entry != "." && $entry != ".." && is_dir(THEMES.$entry)) {
    				if (file_exists(THEMES.$entry."/theme.php") && file_exists(THEMES.$entry."/styles.css")) {
    					define("THEME", THEMES.$entry."/");
    					return true;
    					exit;
    				}
    			}
    		}
    		closedir($dh);
    		if (!defined("THEME")) {
    			return false;
    		}
    	}
    }
    
    if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) {
    	$user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($_POST['user_name']));
    	$user_pass = md5($_POST['user_pass']);
    	$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$user_name."' AND user_password='".md5($user_pass)."' LIMIT 1");
    	if (dbrows($result)) {
    		$data = dbarray($result);
    		$cookie_value = $data['user_id'].".".$user_pass;
    		if ($data['user_status'] == 0) {	
    			$cookie_exp = isset($_POST['remember_me']) ? time() + 3600 * 24 * 30 : time() + 3600 * 3;
    			header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
    			setcookie(COOKIE_PREFIX."user", $cookie_value, $cookie_exp, "/", "", "0");
    			redirect(BASEDIR."setuser.php?user=".$data['user_name'], true);
    		} elseif ($data['user_status'] == 1) {
    			redirect(BASEDIR."setuser.php?error=1", true);
    		} elseif ($data['user_status'] == 2) {
    			redirect(BASEDIR."setuser.php?error=2", true);
    		}
    	} else {
    		redirect(BASEDIR."setuser.php?error=3");
    	}
    }
    
    if (isset($_COOKIE[COOKIE_PREFIX.'user'])) {
    	$cookie_vars = explode(".", $_COOKIE[COOKIE_PREFIX.'user']);
    	$cookie_1 = isnum($cookie_vars['0']) ? $cookie_vars['0'] : "0";
    	$cookie_2 = (preg_check("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");
    	$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_id='$cookie_1' AND user_password='".md5($cookie_2)."' LIMIT 1");
    	unset($cookie_vars,$cookie_1,$cookie_2);
    	if (dbrows($result)) {
    		$userdata = dbarray($result);
    		if ($userdata['user_status'] == 0) {
    			if ($userdata['user_theme'] != "Default" && file_exists(THEMES.$userdata['user_theme']."/theme.php") && ($settings['userthemes'] == 1 || $userdata['user_level'] >= 102)) {
    				if (!theme_exists($userdata['user_theme'])) {
    					echo "<strong>".$settings['sitename']." - ".$locale['global_300'].".</strong><br /><br />\n";
    					echo $locale['global_301'];
    					die();
    				}
    			} else {
    				if (!theme_exists($settings['theme'])) {
    					echo "<strong>".$settings['sitename']." - ".$locale['global_300'].".</strong><br /><br />\n";
    					echo $locale['global_301'];
    					die();
    				}
    			}
    			if ($userdata['user_offset'] <> 0) {
    				$settings['timeoffset'] = $settings['timeoffset'] + $userdata['user_offset'];
    			}
    			if (!isset($_COOKIE[COOKIE_PREFIX.'lastvisit']) || !isnum($_COOKIE[COOKIE_PREFIX.'lastvisit'])) {
    				$result = dbquery("UPDATE ".DB_USERS." SET user_threads='' WHERE user_id='".$userdata['user_id']."'");
    				setcookie(COOKIE_PREFIX."lastvisit", $userdata['user_lastvisit'], time() + 3600, "/", "", "0");			
    				$lastvisited = $userdata['user_lastvisit'];
    			} else {
    				$lastvisited = $_COOKIE[COOKIE_PREFIX.'lastvisit'];
    			}
    			if ($userdata['user_level'] > 101) {
    				if (isset($_COOKIE[COOKIE_PREFIX.'admin']) && (!eregi(str_replace("../", "", "/".ADMIN), FUSION_REQUEST) || USER_IP != $userdata['user_ip'])) {
    					setcookie(COOKIE_PREFIX."admin", "", time() - 7200, "/", "", "0");
    				}
    			}
    		} else {
    			header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
    			setcookie(COOKIE_PREFIX."user", "", time() - 7200, "/", "", "0");
    			setcookie(COOKIE_PREFIX."lastvisit", "", time() - 7200, "/", "", "0");
    			redirect(BASEDIR."index.php", true);
    		}
    	} else {
    		header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
    		setcookie(COOKIE_PREFIX."user", "", time() - 7200, "/", "", "0");
    		setcookie(COOKIE_PREFIX."lastvisit", "", time() - 7200, "/", "", "0");
    		redirect(BASEDIR."index.php", true);
    	}
    } else {
    	if (!theme_exists($settings['theme'])) {
    		echo "<strong>".$settings['sitename']." - ".$locale['global_300'].".</strong><br /><br />\n";
    		echo $locale['global_301'];
    		die();
    	}
    	$userdata = "";	$userdata['user_level'] = 0; $userdata['user_rights'] = ""; $userdata['user_groups'] = "";
    }
    
    // Redirect browser using header or script function
    function redirect($location, $script = false) {
    	if (!$script) {
    		header("Location: ".str_replace("&amp;", "&", $location));
    		exit;
    	} else {
    		echo "<script type='text/javascript'>document.location.href='".str_replace("&amp;", "&", $location)."'</script>\n";
    		exit;
    	}
    }
    
    // Clean URL Function, prevents entities in server globals
    function cleanurl($url) {
    	$bad_entities = array("&", "\"", "'", '\"', "\'", "<", ">", "(", ")", "*");
    	$safe_entities = array("&amp;", "", "", "", "", "", "", "", "", "");
    	$url = str_replace($bad_entities, $safe_entities, $url);
    	return $url;
    }
    
    // Strip Input Function, prevents HTML in unwanted places
    function stripinput($text) {
    	if (QUOTES_GPC) $text = stripslashes($text);
    	$search = array("&", "\"", "'", "\\", '\"', "\'", "<", ">", "&nbsp;");
    	$replace = array("&amp;", "&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;", "&gt;", " ");
    	$text = str_replace($search, $replace, $text);
    	return $text;
    }
    
    // stripslash function, only stripslashes if magic_quotes_gpc is on
    function stripslash($text) {
    	if (QUOTES_GPC) { $text = stripslashes($text); }
    	return $text;
    }
    
    // stripslash function, add correct number of slashes depending on quotes_gpc
    function addslash($text) {
    	if (!QUOTES_GPC) {
    		$text = addslashes(addslashes($text));
    	} else {
    		$text = addslashes($text);
    	}
    	return $text;
    }
    
    // htmlentities is too agressive so we use this function
    function phpentities($text) {
    	$search = array("&", "\"", "'", "\\", "<", ">");
    	$replace = array("&amp;", "&quot;", "&#39;", "&#92;", "&lt;", "&gt;");
    	$text = str_replace($search, $replace, $text);
    	return $text;
    }
    
    // Trim a line of text to a preferred length
    function trimlink($text, $length) {
    	$dec = array("&", "\"", "'", "\\", '\"', "\'", "<", ">");
    	$enc = array("&amp;", "&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;", "&gt;");
    	$text = str_replace($enc, $dec, $text);
    	if (strlen($text) > $length) $text = substr($text, 0, ($length-3))."...";
    	$text = str_replace($dec, $enc, $text);
    	return $text;
    }
    
    // Validate numeric input
    function isnum($value) {
    	if (!is_array($value)) {
    		return (preg_match("/^[0-9]+$/", $value));
    	} else {
    		return false;
    	}
    }
    
    // custom preg-match function
    function preg_check($expression, $value) {
    	if (!is_array($value)) {
    		return preg_match($expression, $value);
    	} else {
    		return false;
    	}
    }
    
    // Cache smileys mysql
    function cache_smileys() {
    	global $smiley_cache;
    	$result = dbquery("SELECT * FROM ".DB_SMILEYS);
    	if (dbrows($result)) {
    		$smiley_cache = array();
    		while ($data = dbarray($result)) {
    			$smiley_cache[] = array(
    				"smiley_code" => $data['smiley_code'],
    				"smiley_image" => $data['smiley_image'],
    				"smiley_text" => $data['smiley_text']
    			);
    		}
    	} else {
    		$smiley_cache = array();
    	}
    }
    
    // Parse smiley bbcode
    function parsesmileys($message) {
    	global $smiley_cache;
    	if (!preg_match("#(\[code\](.*?)\[/code\]|\[geshi=(.*?)\](.*?)\[/geshi\]|\[php\](.*?)\[/php\])#si", $message)) {
    		if (!$smiley_cache) { cache_smileys(); }
    		if (is_array($smiley_cache) && count($smiley_cache)) {
    			foreach ($smiley_cache as $smiley) {
    				$smiley_code = preg_quote($smiley['smiley_code']);
    				$smiley_image = "<img src='".get_image("smiley_".$smiley['smiley_text'])."' alt='".$smiley['smiley_text']."' style='vertical-align:middle;' />";
    				$message = preg_replace("#{$smiley_code}#si", $smiley_image, $message);
    			}
    		}
    	}
    	return $message;
    }
    
    // Show smiley icons in comments, forum and other post pages
    function displaysmileys($textarea, $form = "inputform") {
    	global $smiley_cache;
    	$smileys = ""; $i = 0;
    	if (!$smiley_cache) { cache_smileys(); }
    	if (is_array($smiley_cache) && count($smiley_cache)) {
    		foreach ($smiley_cache as $smiley) {
    			if ($i != 0 && ($i % 10 == 0)) { $smileys .= "<br />\n"; $i++; }
    			$smileys .= "<img src='".get_image("smiley_".$smiley['smiley_text'])."' alt='".$smiley['smiley_text']."' onclick=\"insertText('".$textarea."', '".$smiley['smiley_code']."', '".$form."');\" />\n";
    		}
    	}
    	return $smileys;
    }
    
    // Cache bbcode mysql
    function cache_bbcode() {
    	global $bbcode_cache;
    	$result = dbquery("SELECT * FROM ".DB_BBCODES." ORDER BY bbcode_order ASC");
    	if (dbrows($result)) {
    		$bbcode_cache = array();
    		while ($data = dbarray($result)) {
    			$bbcode_cache[] = $data['bbcode_name'];
    		}
    	} else {
    		$bbcode_cache = array();
    	}
    }
    
    // Parse bbcode
    function parseubb($text, $selected=false) {
    	global $bbcode_cache;
    	if (!$bbcode_cache) { cache_bbcode(); }
    	if (is_array($bbcode_cache) && count($bbcode_cache)) {
    		if ($selected) { $sel_bbcodes = explode("|", $selected); }
    		foreach ($bbcode_cache as $bbcode) {
    			if ($selected && in_array($bbcode, $sel_bbcodes)) {
    				if (file_exists(INCLUDES."bbcodes/".$bbcode."_bbcode_include.php")) {
    					if (file_exists(LOCALE.LOCALESET."bbcodes/".$bbcode.".php")) {
    						include (LOCALE.LOCALESET."bbcodes/".$bbcode.".php");
    					} elseif (file_exists(LOCALE."English/bbcodes/".$bbcode.".php")) {
    						include (LOCALE."English/bbcodes/".$bbcode.".php");
              }
    					include (INCLUDES."bbcodes/".$bbcode."_bbcode_include.php");
    				}
    			} elseif (!$selected) {
    				if (file_exists(INCLUDES."bbcodes/".$bbcode."_bbcode_include.php")) {
    					if (file_exists(LOCALE.LOCALESET."bbcodes/".$bbcode.".php")) {
    						include (LOCALE.LOCALESET."bbcodes/".$bbcode.".php");
    					} elseif (file_exists(LOCALE."English/bbcodes/".$bbcode.".php")) {
    						include (LOCALE."English/bbcodes/".$bbcode.".php");
              }
    					include (INCLUDES."bbcodes/".$bbcode."_bbcode_include.php");
    				}
    			}
    		}
    	}	
    	$text = descript($text, false);
    	return $text;
    }
    
    // Javascript email encoder by Tyler Akins
    // http://rumkin.com/tools/mailto_encoder/
    function hide_email($email, $title = "", $subject = "") {
    	if (strpos($email, "@")) {
    		$parts = explode("@", $email);
    		$MailLink = "<a href='mailto:".$parts[0]."@".$parts[1];
    		if ($subject != "") { $MailLink .= "?subject=".urlencode($subject); }
    		$MailLink .= "'>".($title?$title:$parts[0]."@".$parts[1])."</a>";
    		$MailLetters = "";
    		for ($i = 0; $i < strlen($MailLink); $i++) {
    			$l = substr($MailLink, $i, 1);
    			if (strpos($MailLetters, $l) === false) {
    				$p = rand(0, strlen($MailLetters));
    				$MailLetters = substr($MailLetters, 0, $p).$l.substr($MailLetters, $p, strlen($MailLetters));
    			}
    		}
    		$MailLettersEnc = str_replace("\\", "\\\\", $MailLetters);
    		$MailLettersEnc = str_replace("\"", "\\\"", $MailLettersEnc);
    		$MailIndexes = "";
    		for ($i = 0; $i < strlen($MailLink); $i ++) {
    			$index = strpos($MailLetters, substr($MailLink, $i, 1));
    			$index += 48;
    			$MailIndexes .= chr($index);
    		}
    		$MailIndexes = str_replace("\\", "\\\\", $MailIndexes);
    		$MailIndexes = str_replace("\"", "\\\"", $MailIndexes);
    		
    		$res = "<script type='text/javascript'>";
    		$res .= "ML=\"".str_replace("<", "xxxx", $MailLettersEnc)."\";";
    		$res .= "MI=\"".str_replace("<", "xxxx", $MailIndexes)."\";";
    		$res .= "ML=ML.replace(/xxxx/g, '<');";
    		$res .= "MI=MI.replace(/xxxx/g, '<');";	$res .= "OT=\"\";";
    		$res .= "for(j=0;j < MI.length;j++){";
    		$res .= "OT+=ML.charAt(MI.charCodeAt(j)-48);";
    		$res .= "}document.write(OT);";
    		$res .= "</script>";
    	
    		return $res;
    	} else {
    		return $email;
    	}
    }
    
    // Format spaces and tabs in code bb tags
    function formatcode($text) {
    	$text = str_replace("  ", "&nbsp; ", $text);
    	$text = str_replace("  ", " &nbsp;", $text);
    	$text = str_replace("\t", "&nbsp; &nbsp;", $text);
    	$text = preg_replace("/^ {1}/m", "&nbsp;", $text);
    	return $text;
    }
    
    // Highlights given words in subject
    function highlight_words($word, $subject) {
    	if (is_array($word)) {
    		$regex_chars = "*|#.+?(){}[]^$/";
    		for ($j = 0; $j < count($word); $j++) {
    			for ($i = 0; $i < strlen($regex_chars); $i++) {
    				$char = substr($regex_chars, $i, 1);
    				$word[$j] = str_replace($char, '\\'.$char, $word[$j]);
    			}
    			$subject = preg_replace("/(".$word[$j].")/is", "<span style='background-color:yellow;font-weight:bold;padding-left:2px;padding-right:2px'>\\1</span>", $subject);
    		}
    	}
    	return $subject;
    }
    
    // This function sanitises news & article submissions
    function descript($text, $striptags = true) {
    	// Convert problematic ascii characters to their true values
    	$search = array("40","41","58","65","66","67","68","69","70",
    		"71","72","73","74","75","76","77","78","79","80","81",
    		"82","83","84","85","86","87","88","89","90","97","98",
    		"99","100","101","102","103","104","105","106","107",
    		"108","109","110","111","112","113","114","115","116",
    		"117","118","119","120","121","122"
    		);
    	$replace = array("(",")",":","a","b","c","d","e","f","g","h",
    		"i","j","k","l","m","n","o","p","q","r","s","t","u",
    		"v","w","x","y","z","a","b","c","d","e","f","g","h",
    		"i","j","k","l","m","n","o","p","q","r","s","t","u",
    		"v","w","x","y","z"
    		);
    	$entities = count($search);
    	for ($i=0; $i < $entities; $i++) {
    		$text = preg_replace("#(&\#)(0*".$search[$i]."+);*#si", $replace[$i], $text);
    	}
    	$text = preg_replace('#(&\#x)([0-9A-F]+);*#si', "", $text);
    	$text = preg_replace('#(<[^>]+[/\"\'\s])(onmouseover|onmousedown|onmouseup|onmouseout|onmousemove|onclick|ondblclick|onfocus|onload|xmlns)[^>]*>#iU', ">", $text);
    	$text = preg_replace('#([a-z]*)=([\`\'\"]*)script:#iU', '$1=$2nojscript...', $text);
    	$text = preg_replace('#([a-z]*)=([\`\'\"]*)javascript:#iU', '$1=$2nojavascript...', $text);
    	$text = preg_replace('#([a-z]*)=([\'\"]*)vbscript:#iU', '$1=$2novbscript...', $text);
    	$text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU', "$1>", $text);
    	$text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU', "$1>", $text);
    	if ($striptags) {
    		do {
    			$thistext = $text;
    			$text = preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i', "", $text);
    		} while ($thistext != $text);
    	}
    	return $text;
    }
    
    // Scan image files for malicious code
    function verify_image($file) {
    	$txt = file_get_contents($file);
    	$image_safe = true;
    	if (preg_match('#&(quot|lt|gt|nbsp|<?php);#i', $txt)) { $image_safe = false; }
    	elseif (preg_match("#&\#x([0-9a-f]+);#i", $txt)) { $image_safe = false; }
    	elseif (preg_match('#&\#([0-9]+);#i', $txt)) { $image_safe = false; }
    	elseif (preg_match("#([a-z]*)=([\`\'\"]*)script:#iU", $txt)) { $image_safe = false; }
    	elseif (preg_match("#([a-z]*)=([\`\'\"]*)javascript:#iU", $txt)) { $image_safe = false; }
    	elseif (preg_match("#([a-z]*)=([\'\"]*)vbscript:#iU", $txt)) { $image_safe = false; }
    	elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU", $txt)) { $image_safe = false; }
    	elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU", $txt)) { $image_safe = false; }
    	elseif (preg_match("#</*(applet|link|style|script|iframe|frame|frameset)[^>]*>#i", $txt)) { $image_safe = false; }
    	return $image_safe;
    }
    
    // captcha routines
    function make_captcha() {
    	global $settings;
    	$captcha_string = ""; $captcha_encode = "";
    	$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    	for ($i = 0; $i < 5; $i++) {
    		$captcha_string .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
    	}
    	for ($i = 0; $i < 31; $i++) {
    		$captcha_encode .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
    	}
    	$result = mysql_query("INSERT INTO ".DB_PREFIX."captcha (captcha_datestamp, captcha_ip, captcha_encode, captcha_string) VALUES('".time()."', '".USER_IP."', '$captcha_encode', '$captcha_string')");
    	if ($settings['validation_method'] == "image") {
    		return "<input type='hidden' name='captcha_encode' value='".$captcha_encode."' /><img src='".INCLUDES."captcha_include.php?captcha_code=".$captcha_encode."' alt='' />\n";
    	} else {
    		return "<input type='hidden' name='captcha_encode' value='".$captcha_encode."' /><strong>".$captcha_string."</strong>\n";
    	}
    }
    
    function check_captcha($captchs_encode, $captcha_string) {
    	if (preg_check("/^[0-9A-Za-z]+$/", $captchs_encode) && preg_check("/^[0-9A-Za-z]+$/", $captcha_string)) {
    		$result = dbquery("SELECT * FROM ".DB_CAPTCHA." WHERE captcha_ip='".USER_IP."' AND captcha_encode='".$captchs_encode."' AND captcha_string='".$captcha_string."'");
    		if (dbrows($result)) {
    			$result = dbquery("DELETE FROM ".DB_CAPTCHA." WHERE captcha_ip='".USER_IP."' AND captcha_encode='".$captchs_encode."' AND captcha_string='".$captcha_string."'");
    			return true;
    		} else {
    			return false;
    		}
    	} else {
    		return false;
    	}
    }
    
    // Replace offensive words with the defined replacement word
    function censorwords($text) {
    	global $settings;
    	if ($settings['bad_words_enabled'] == "1" && $settings['bad_words'] != "" ) {
    		$word_list = explode("\r\n", $settings['bad_words']);
    		for ($i=0; $i < count($word_list); $i++) {
    			if ($word_list[$i] != "") $text = preg_replace("/".$word_list[$i]."/si", $settings['bad_word_replace'], $text);
    		}
    	}
    	return $text;
    }
    
    // Display the user's level
    function getuserlevel($userlevel) {
    	global $locale;
    	if ($userlevel == 101) { return $locale['user1']; 
    	} elseif ($userlevel == 102) { return $locale['user2'];
    	} elseif ($userlevel == 103) { return $locale['user3']; }
    }
    
    // Check if Administrator has correct rights assigned
    function checkrights($right) {
    	if (iADMIN && in_array($right, explode(".", iUSER_RIGHTS))) {
    		return true;
    	} else {
    		return false;
    	}
    }
    
    // Check if user is assigned to the specified user group
    function checkgroup($group) {
    	if (iSUPERADMIN) { return true; }
    	elseif (iADMIN && ($group == "0" || $group == "101" || $group == "102")) { return true;
    	} elseif (iMEMBER && ($group == "0" || $group == "101")) { return true;
    	} elseif (iGUEST && $group == "0") { return true;
    	} elseif (iMEMBER && in_array($group, explode(".", iUSER_GROUPS))) {
    		return true;
    	} else {
    		return false;
    	}
    }
    
    // Cache groups mysql
    function cache_groups() {
    	global $groups_cache;
    	$result = dbquery("SELECT * FROM ".DB_USER_GROUPS." ORDER BY group_id ASC");
    	if (dbrows($result)) {
    		$groups_cache = array();
    		while ($data = dbarray($result)) {
    			$groups_cache[] = $data;
    		}
    	} else {
    		$groups_cache = array();
    	}
    }
    
    // Compile access levels & user group array
    function getusergroups() {
    	global $locale, $groups_cache;
    	$groups_array = array(
    		array("0", $locale['user0']),
    		array("101", $locale['user1']),
    		array("102", $locale['user2']),
    		array("103", $locale['user3'])
    	);
    	if (!$groups_cache) { cache_groups(); }
    	if (is_array($groups_cache) && count($groups_cache)) {
    		foreach ($groups_cache as $group) {
    			array_push($groups_array, array($group['group_id'], $group['group_name']));
    		}
    	}
    	return $groups_array;
    }
    
    // Get the name of the access level or user group
    function getgroupname($group_id, $return_desc = false) {
    	global $locale, $groups_cache;
    	if ($group_id == "0") { return $locale['user0'];
    	} elseif ($group_id == "101") { return $locale['user1']; exit;
    	} elseif ($group_id == "102") { return $locale['user2']; exit;
    	} elseif ($group_id == "103") { return $locale['user3']; exit;
    	} else {
    		if (!$groups_cache) { cache_groups(); }
    		if (is_array($groups_cache) && count($groups_cache)) {
    			foreach ($groups_cache as $group) {
    				if ($group_id == $group['group_id']) { return ($return_desc ? ($group['group_description'] ? $group['group_description'] : '-') : $group['group_name']); exit; }
    			}
    		}
    	}
    	return "N/A";
    }
    
    function groupaccess($field) {
    	if (iGUEST) { return "$field = '0'";
      } elseif (iSUPERADMIN) { return "1 = 1";
    	} elseif (iADMIN) { $res = "($field='0' OR $field='101' OR $field='102'";
    	} elseif (iMEMBER) { $res = "($field='0' OR $field='101'";
    	}
    	if (iUSER_GROUPS != "" && !iSUPERADMIN) { $res .= " OR $field='".str_replace(".", "' OR $field='", iUSER_GROUPS)."'"; }
    	$res .= ")";
    	return $res;
    }
    
    // Create a list of files or folders and store them in an array
    function makefilelist($folder, $filter, $sort=true, $type="files") {
    	$res = array();
    	$filter = explode("|", $filter); 
    	$temp = opendir($folder);
    	while ($file = readdir($temp)) {
    		if ($type == "files" && !in_array($file, $filter)) {
    			if (!is_dir($folder.$file)) { $res[] = $file; }
    		} elseif ($type == "folders" && !in_array($file, $filter)) {
    			if (is_dir($folder.$file)) { $res[] = $file; }
    		}
    	}
    	closedir($temp);
    	if ($sort) { sort($res); }
    	return $res;
    }
    
    // Create a selection list from an array created by makefilelist()
    function makefileopts($files, $selected = "") {
    	$res = "";
    	for ($i = 0; $i < count($files); $i++) {
    		$sel = ($selected == $files[$i] ? " selected='selected'" : "");
    		$res .= "<option value='".$files[$i]."'$sel>".$files[$i]."</option>\n";
    	}
    	return $res;
    }
    
    function makepagenav($start, $count, $total, $range = 0, $link = "") {
    
    	global $locale;
    
    	if ($link == "") { $link = FUSION_SELF."?"; }
    
    	$pg_cnt = ceil($total / $count);
    	if ($pg_cnt <= 1) { return ""; }
    
    	$idx_back = $start - $count;
    	$idx_next = $start + $count;
    	$cur_page = ceil(($start + 1) / $count);
    
    	$res = $locale['global_092']." ".$cur_page.$locale['global_093'].$pg_cnt.": ";
    	if($idx_back >= 0) {
    		if($cur_page > ($range + 1)) {
    			$res .= "<a href='".$link."rowstart=0'>1</a>...";
    		}
    	}
    	$idx_fst = max($cur_page - $range, 1);
    	$idx_lst = min($cur_page + $range, $pg_cnt);
    	if ($range == 0) {
    		$idx_fst = 1;
    		$idx_lst = $pg_cnt;
    	}
    	for ($i = $idx_fst; $i <= $idx_lst; $i++) {
    		$offset_page = ($i - 1) * $count;
    		if ($i == $cur_page) {
    			$res .= "<span><strong>".$i."</strong></span>";
    		} else {
    			$res .= "<a href='".$link."rowstart=".$offset_page."'>".$i."</a>";
    		}
    	}
    	if ($idx_next < $total) {
    		if ($cur_page < ($pg_cnt - $range)) {
    			$res .= "...<a href='".$link."rowstart=".($pg_cnt - 1) * $count."'>".$pg_cnt."</a>\n";
    		}
    	}
    	
    	return "<div class='pagenav'>\n".$res."</div>\n";
    }
    
    // Format the date & time accordingly
    function showdate($format, $val) {
    	global $settings;
    	if ($format == "shortdate" || $format == "longdate" || $format == "forumdate") {
    		return strftime($settings[$format], $val + ($settings['timeoffset']*3600));
    	} else {
    		return strftime($format, $val + ($settings['timeoffset'] * 3600));
    	}
    }
    
    // Translate bytes into kb, mb, gb or tb by CrappoMan
    function parsebytesize($size, $digits = 2, $dir = false) {
    	$kb = 1024; $mb = 1024 * $kb; $gb= 1024 * $mb; $tb = 1024 * $gb;
    	if (($size == 0) && ($dir)) { return "Empty"; }
    	elseif ($size < $kb) { return $size."Bytes"; }
    	elseif ($size < $mb) { return round($size / $kb,$digits)."Kb"; }
    	elseif ($size < $gb) { return round($size / $mb,$digits)."Mb"; }
    	elseif ($size < $tb) { return round($size / $gb,$digits)."Gb"; }
    	else { return round($size / $tb, $digits)."Tb"; }
    }
    
    // User level, Admin Rights & User Group definitions
    define("iGUEST", $userdata['user_level'] == 0 ? 1 : 0);
    define("iMEMBER", $userdata['user_level'] >= 101 ? 1 : 0);
    define("iADMIN", $userdata['user_level'] >= 102 ? 1 : 0);
    define("iSUPERADMIN", $userdata['user_level'] == 103 ? 1 : 0);
    define("iUSER", $userdata['user_level']);
    define("iUSER_RIGHTS", $userdata['user_rights']);
    define("iUSER_GROUPS", substr($userdata['user_groups'], 1));
    
    if (iADMIN) {
    	define("iAUTH", substr($userdata['user_password'], 16, 32));
    	$aidlink = "?aid=".iAUTH;
    }
    
    include INCLUDES."system_images.php";
    ?>


    hoffe ihr könnt mir helfen.
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. Hallo!
    Auf welcher Seite hast du denn das Problem?
    Beim php-fusion, das in deinem Lima-root liegt, funktioniert das maintenance-Modul für die Galerie offenbar bestens.
    Du meinst doch die "Maintenance infusion", richtig? =>
    http://php-fusion.hobbysites.net/infusions/pro_download_panel/download.php?did=22
  4. Autor dieses Themas

    psd

    psd hat kostenlosen Webspace.

    Ja hab das problem durch neuaufsetzten des cms beseitigt nur hab ich das jetzt im forum wleches rein garnichts damit zu tun hatte ^^.

    Den fehler hatte / habe ich in der Index.php , am ende hat nicht mal mehr der login funktioniert ^^
    Hab jetzt einfach die DB und das cms gelöscht und neu aufgesetzt, jetzt scheint alles zu klappen bis auf das forum.....

    Da bekomm ich nun db fehler:

    Table 'db_140128_3.fusion_fb_settings' doesn't existTable 'db_140128_3.fusion_fb_settings' doesn't exist
    Table 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't exist
    Notice: Undefined index: fb101 in /home/webpages/lima-city/psd/html/administration/forums.php on line 327
    
    	
    Table 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't existTable 'db_140128_3.fusion_fb_forums' doesn't exist


    die forum.php dazu

    <?php
    /*-------------------------------------------------------+
    | PHP-Fusion Content Management System
    | Copyright (C) 2002 - 2008 Nick Jones
    | http://www.php-fusion.co.uk/
    +--------------------------------------------------------+
    | Filename: forums.php
    | Author: Nick Jones (Digitanium)
    +--------------------------------------------------------+
    | This program is released as free software under the
    | Affero GPL license. You can redistribute it and/or
    | modify it under the terms of this license which you
    | can read by viewing the included agpl.txt or online
    | at www.gnu.org/licenses/agpl.html. Removal of this
    | copyright header is strictly prohibited without
    | written permission from the original author(s).
    +--------------------------------------------------------*/
    require_once "../maincore.php";
    require_once THEMES."templates/admin_header.php";
    include LOCALE.LOCALESET."admin/forums.php";
    
    $fb4 = dbarray(dbquery("select * from ".DB_PREFIX."fb_settings"));
    if($fb4['fboard_on']) redirect(INFUSIONS."fusionboard4/admin.php".$aidlink."&section=forums");
    
    if (!checkrights("F") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
    
    if (isset($_GET['action']) && $_GET['action'] == "prune") { require_once "forums_prune.php"; }
    
    if (isset($_GET['action']) && $_GET['action'] == "refresh") {
    	$i = 1; $k = 1;
    	$result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='0' ORDER BY forum_order");
    	while ($data = dbarray($result)) {
    		$result2 = dbquery("UPDATE ".DB_FORUMS." SET forum_order='$i' WHERE forum_id='".$data['forum_id']."'");
    		$result2 = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='".$data['forum_id']."' ORDER BY forum_order");
    		while ($data2 = dbarray($result2)) {
    			$result3 = dbquery("UPDATE ".DB_FORUMS." SET forum_order='$k' WHERE forum_id='".$data2['forum_id']."'");
    			$k++;
    		}
    		$i++; $k = 1;
    	}
    	redirect(FUSION_SELF.$aidlink);
    }
    
    if (isset($_GET['status']) && !isset($message)) {
    	if ($_GET['status'] == "savecn") {
    		$message = $locale['410'];
    	} elseif ($_GET['status'] == "savecu") {
    		$message = $locale['411'];
    	} elseif ($_GET['status'] == "savefn") {
    		$message = $locale['510'];
    	} elseif ($_GET['status'] == "savefu") {
    		$message = $locale['511'];
    	} elseif ($_GET['status'] == "savefm") {
    		$message = $locale['515'];
    	} elseif ($_GET['status'] == "delcn") {
    		$message = $locale['412']."<br />\n<span class='small'>".$locale['413']."</span>";
    	} elseif ($_GET['status'] == "delcy") {
    		$message = $locale['414'];
    	} elseif ($_GET['status'] == "delfn") {
    		$message = $locale['512']."<br />\n<span class='small'>".$locale['513']."</span>";
    	} elseif ($_GET['status'] == "delfy") {
    		$message = $locale['514'];
    	}
    	if ($message) {	echo "<div class='admin-message'>".$message."</div>\n"; }
    }	
    
    if (isset($_POST['save_cat'])) {
    	$cat_name = trim(stripinput($_POST['cat_name']));
    	if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "cat")) {
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_name='$cat_name' WHERE forum_id='".$_GET['forum_id']."'");
    		redirect(FUSION_SELF.$aidlink."&status=savecu");
    	} else {
    		if ($cat_name) {
    			$cat_order = isnum($_POST['cat_order']) ? $_POST['cat_order'] : "";
    			if(!$cat_order) $cat_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".DB_FORUMS." WHERE forum_cat='0'"),0)+1;
    			$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_cat='0' AND forum_order>='$cat_order'");	
    			$result = dbquery("INSERT INTO ".DB_FORUMS." (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_poll, forum_vote, forum_attach, forum_lastpost, forum_lastuser) VALUES ('0', '$cat_name', '$cat_order', '', '', '0', '0', '0', '0', '0', '0', '0', '0')");
    			redirect(FUSION_SELF.$aidlink."&status=savecn");
    		}
    	}
    } elseif (isset($_POST['save_forum'])) {
    	$forum_name = trim(stripinput($_POST['forum_name']));
    	$forum_description = trim(stripinput($_POST['forum_description']));
    	$forum_cat = isnum($_POST['forum_cat']) ? $_POST['forum_cat'] : 0;
    	if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "forum")) {
    		$forum_mods = $_POST['forum_mods'];
    		$forum_access = isnum($_POST['forum_access']) ? $_POST['forum_access'] : 0;
    		$forum_post = isnum($_POST['forum_post']) ? $_POST['forum_post'] : 0;
    		$forum_reply = isnum($_POST['forum_reply']) ? $_POST['forum_reply'] : 0;
    		$forum_attach = isnum($_POST['forum_attach']) ? $_POST['forum_attach'] : 0;
    		$forum_poll = isnum($_POST['forum_poll']) ? $_POST['forum_poll'] : 0;
    		$forum_vote = isnum($_POST['forum_vote']) ? $_POST['forum_vote'] : 0;
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_name='$forum_name', forum_cat='$forum_cat', forum_description='$forum_description', forum_moderators='$forum_mods', forum_access='$forum_access', forum_post='$forum_post', forum_reply='$forum_reply', forum_attach='$forum_attach', forum_poll='$forum_poll', forum_vote='$forum_vote' WHERE forum_id='".$_GET['forum_id']."'");
    		// start fb4 mod
    		
    		$forum_icon = addslash(stripinput($_POST['forum_icon']));
    		$forum_parent = ((isset($_POST['forum_parent']) && isNum($_POST['forum_parent'])) ? $_POST['forum_parent'] : 0);
    		$result = dbquery("UPDATE ".$db_prefix."fb_forums set forum_icon='$forum_icon', forum_parent='$forum_parent' where forum_id='".$_GET['forum_id']."'");
    		
    		// end fb4 mod
    		redirect(FUSION_SELF.$aidlink."&status=savefu");
    	} else {
    		if ($forum_name) {
    			$forum_order = isnum($_POST['forum_order']) ? $_POST['forum_order'] : "";
    			if(!$forum_order) $forum_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".DB_FORUMS." WHERE forum_cat='$forum_cat'"),0)+1;
    			$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'");	
    			$result = dbquery("INSERT INTO ".DB_FORUMS." (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_attach, forum_poll, forum_vote, forum_lastpost, forum_lastuser) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '103', '101', '101', '101', '0', '0', '0', '0', '0')");
    			$forum_parent = ((isset($_POST['forum_parent']) && isNum($_POST['forum_parent'])) ? $_POST['forum_parent'] : 0);
    			$result = dbquery("INSERT INTO ".DB_PREFIX."fb_forums (forum_id, forum_icon,forum_parent) VALUES('".mysql_insert_id()."', '', '$forum_parent')");
    			redirect(FUSION_SELF.$aidlink."&status=savefn");
    		} else {
    			redirect(FUSION_SELF.$aidlink);
    		}
    	}
    } elseif ((isset($_GET['action']) && $_GET['action'] == "mu") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['order']) && isnum($_GET['order']))) {
    	if (isset($_GET['t']) && $_GET['t'] == "cat") {
    		$data = dbarray(dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='0' AND forum_order='".$_GET['order']."'"));
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_id='".$data['forum_id']."'");
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order-1 WHERE forum_id='".$_GET['forum_id']."'");
    	} elseif ((isset($_GET['t']) && $_GET['t'] == "forum") && (isset($_GET['cat']) && isnum($_GET['cat']))) {
    		$data = dbarray(dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='$cat' AND forum_order='".$_GET['order']."'"));
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_id='".$data['forum_id']."'");
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order-1 WHERE forum_id='".$_GET['forum_id']."'");
    	}
    	redirect(FUSION_SELF.$aidlink);
    } elseif ((isset($_GET['action']) && $_GET['action'] == "md") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['order']) && isnum($_GET['order']))) {
    	if (isset($_GET['t']) && $_GET['t'] == "cat") {
    		$data = dbarray(dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='0' AND forum_order='".$_GET['order']."'"));
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order-1 WHERE forum_id='".$data['forum_id']."'");
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_id='".$_GET['forum_id']."'");
    	} elseif ((isset($_GET['t']) && $_GET['t'] == "forum") && (isset($_GET['cat']) && isnum($_GET['cat']))) {
    		$data = dbarray(dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='".$_GET['cat']."' AND forum_order='".$_GET['order']."'"));
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order-1 WHERE forum_id='".$data['forum_id']."'");
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_id='".$_GET['forum_id']."'");
    	}
    	redirect(FUSION_SELF.$aidlink);
    } elseif ((isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "cat")) {
    	if (!dbcount("(forum_id)", DB_FORUMS, "forum_cat='".$_GET['forum_id']."'")) {
    		$data = dbarray(dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_id='".$_GET['forum_id']."'"));
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order-1 WHERE forum_cat='0' AND forum_order>'".$data['forum_order']."'");
    		$result = dbquery("DELETE FROM ".DB_FORUMS." WHERE forum_id='".$_GET['forum_id']."'");
    		redirect(FUSION_SELF.$aidlink."&status=delcy");
    	} else {
    		redirect(FUSION_SELF.$aidlink."&status=delcn");
    	}
    } elseif ((isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "forum")) {
    	if (!dbcount("(thread_id)", DB_THREADS, "forum_id='".$_GET['forum_id']."'")) {
    		$data = dbarray(dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_id='".$_GET['forum_id']."'"));
    		$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order-1 WHERE forum_cat='".$data['forum_cat']."' AND forum_order>'".$data['forum_order']."'");
    		$result = dbquery("DELETE FROM ".DB_FORUMS." WHERE forum_id='".$_GET['forum_id']."'");
    		redirect(FUSION_SELF.$aidlink."&status=delfy");
    	} else {
    		redirect(FUSION_SELF.$aidlink."&status=delfn");
    	}
    } else {
    	if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id']))) {
    		if (isset($_GET['t']) && $_GET['t'] == "cat") {
    			$result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_id='".$_GET['forum_id']."'");
    			if (dbrows($result)) {
    				$data = dbarray($result);
    				$cat_name = $data['forum_name'];
    				$cat_title = $locale['401'];
    				$cat_action = FUSION_SELF.$aidlink."&amp;action=edit&amp;forum_id=".$data['forum_id']."&amp;t=cat";
    				$forum_title = $locale['500'];
    				$forum_action = FUSION_SELF.$aidlink;
    			} else {
    				redirect(FUSION_SELF.$aidlink);
    			}
    		} elseif (isset($_GET['t']) && $_GET['t'] == "forum") {
    			$result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_id='".$_GET['forum_id']."'");
    			if (dbrows($result)) {
    				$data = dbarray($result);
    				$forum_name = $data['forum_name'];
    				$forum_description = $data['forum_description'];
    				$forum_cat = $data['forum_cat'];
    				$forum_access = $data['forum_access'];
    				$forum_post = $data['forum_post'];
    				$forum_reply = $data['forum_reply'];
    				$forum_attach = $data['forum_attach'];
    				$forum_poll = $data['forum_poll'];
    				$forum_vote = $data['forum_vote'];
    				$forum_title = $locale['501'];
    				$forum_action = FUSION_SELF.$aidlink."&amp;action=edit&amp;forum_id=".$data['forum_id']."&amp;t=forum";
    				$cat_title = $locale['400'];
    				$cat_action = FUSION_SELF.$aidlink;
    				// fB4 Mod Start
    				$fbResult = dbquery("select * from ".$db_prefix."fb_forums where forum_id='".$_GET['forum_id']."'");
    				if(dbrows($fbResult)){
    					$fbData = dbarray($fbResult);
    					$forum_icon = stripslash($fbData['forum_icon']);
    					$forum_parent = $fbData['forum_parent'];
    				} else {
    					$fbQuery = dbquery("insert into ".$db_prefix."fb_forums (forum_id, forum_icon) VALUES('".$_GET['forum_id']."', '')");
    					$forum_icon = "";
    					$forum_parent = "";
    				}
    				// fb4 Mod End
    			} else {
    				redirect(FUSION_SELF.$aidlink);
    			}
    		}
    	} else {
    		$cat_name = "";
    		$cat_order = "";
    		$cat_title = $locale['400'];
    		$cat_action = FUSION_SELF.$aidlink;
    		$forum_name = "";
    		$forum_description = "";
    		$forum_cat = 0;
    		$forum_order = "";
    		$forum_access = 0;
    		$forum_post = 0;
    		$forum_reply = 0;
    		$forum_attach = 0;
    		$forum_poll = 0;
    		$forum_vote = 0;
    		$forum_title = $locale['500'];
    		$forum_action = FUSION_SELF.$aidlink;
    		// fB4 Mod Start
    		$forum_icon = "";
    		$forum_parent = "";
    		// fb4 Mod End
    	}
    	if (!isset($_GET['t']) || $_GET['t'] != "forum") {
    		opentable($cat_title);
    		echo "<form name='addcat' method='post' action='$cat_action'>\n";
    		echo "<table align='center' cellpadding='0' cellspacing='0' width='300'>\n<tr>\n";
    		echo "<td class='tbl'>".$locale['420']."<br />\n";
    		echo "<input type='text' name='cat_name' value='".$cat_name."' class='textbox' style='width:230px;' /></td>\n";
    		echo "<td width='50' class='tbl'>";
    		if (!isset($_GET['action']) || $_GET['action'] != "edit") {
    			echo $locale['421']."<br />\n<input type='text' name='cat_order' value='".$cat_order."' class='textbox' style='width:45px;' />";
    		}
    		echo "</td>\n</tr>\n<tr>\n";
    		echo "<td align='center' colspan='2' class='tbl'>\n";
    		echo "<input type='submit' name='save_cat' value='".$locale['422']."' class='button' /></td>\n";
    		echo "</tr>\n</table>\n</form>\n";
    		closetable();
    	}
    	if (!isset($_GET['t']) || $_GET['t'] != "cat") {
    		$cat_opts = ""; $sel = "";
    		$result2 = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='0' ORDER BY forum_order");
    		if (dbrows($result2)) {
    			while ($data2 = dbarray($result2)) {
    				if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['t']) && $_GET['t'] == "forum")) { $sel = ($data2['forum_id'] == $forum_cat ? " selected='selected'" : ""); }
    				$cat_opts .= "<option value='".$data2['forum_id']."'".$sel.">".$data2['forum_name']."</option>\n";
    			}
    	
    			function create_options($selected, $hide=array(), $off=false) {
    				global $locale; $option_list = ""; $options = getusergroups();
    				if ($off) { $option_list = "<option value='0'>".$locale['531']."</option>\n"; }
    				while(list($key, $option) = each($options)){
    					if (!in_array($option['0'], $hide)) {
    						$sel = ($selected == $option['0'] ? " selected='selected'" : "");
    						$option_list .= "<option value='".$option['0']."'$sel>".$option['1']."</option>\n";
    					}
    				}
    				return $option_list;
    			}
    			
    			opentable($forum_title);
    			echo "<form name='addforum' method='post' action='$forum_action'>\n";
    			echo "<table align='center' cellpadding='0' cellspacing='0' width='300'>\n<tr>\n";
    			echo "<td colspan='2' class='tbl'>".$locale['520']."<br />\n";
    			echo "<input type='text' name='forum_name' value='".$forum_name."' class='textbox' style='width:285px;' /></td>\n";
    			echo "</tr>\n<tr>\n";
    			echo "<td colspan='2' class='tbl'>".$locale['521']."<br />\n";
    			echo "<input type='text' name='forum_description' value='".$forum_description."' class='textbox' style='width:285px;' /></td>\n";
    			echo "</tr>\n<tr>\n";
    			echo "<td class='tbl'>".$locale['522']."<br />\n";
    			echo "<select name='forum_cat' class='textbox' style='width:225px;'>\n".$cat_opts."</select></td>\n";
    			echo "<td width='55' class='tbl'>";
    			if (!isset($_GET['action']) || $_GET['action'] != "edit") {
    				echo $locale['523']."<br />\n<input type='text' name='forum_order' value='".$forum_order."' class='textbox' style='width:45px;' />";
    				echo "</td>\n</tr>\n";
    			} else {
    				echo "</td></tr>\n";
    			}
    			// fb4 Mod Begin
    			
    			// Old Code below
    			//echo "</td>\n</tr>\n</table>\n";
    			
    			if (isset($_GET['action']) && $_GET['action'] == "edit") {
    			
    				$forumIconImages = makefileopts(makefilelist(INFUSIONS."fusionboard4/images/forum_icons/", ".|..|index.php"), $forum_icon);
    				
    				echo "<tr><td colspan='2' class='tbl'>".$locale['fb100']."<br />\n";
    				echo "<select name='forum_icon' class='textbox' style='width:285px;' />\n";
    				echo "<option value=''>---</option>\n$forumIconImages\n";
    				echo "</td>\n";
    				echo "</tr>\n<tr>\n";
    				
    			}
    			
    			function renderChildren($parent, $level=1){
    					global $forum_parent;
    					$children = "";
    					$p_res = dbquery("select * from ".DB_PREFIX."forums f
    					left join ".DB_PREFIX."fb_forums f2 on f2.forum_id=f.forum_id
    					where f2.forum_parent='$parent'");
    					while($p_data = dbarray($p_res)){
    						$children .= "<option value='".$p_data['forum_id']."'".($p_data['forum_id']==$forum_parent ? " SELECTED" : "").">";
    						for($i = $level; $i--; $i > 0){
    							$children .= "--";
    						}
    						$children .= $p_data['forum_name']."</option>\n";
    						$children .= renderChildren($p_data['forum_id'], ($level+1));
    					}
    					return $children;
    				}
    				
    				$possibleParents = "";
    				$c_res = dbquery("select * from ".$db_prefix."forums where forum_cat='0'");
    				while($c_data = dbarray($c_res)){
    					$possibleParents .= "<optgroup label='".$c_data['forum_name']."'>\n";
    					$p_res = dbquery("select * from ".$db_prefix."forums f
    					left join ".$db_prefix."fb_forums f2 on f2.forum_id=f.forum_id
    					where f2.forum_parent='0' and f.forum_cat='".$c_data['forum_id']."'");
    					while($p_data = dbarray($p_res)){
    						$possibleParents .= "<option value='".$p_data['forum_id']."'".($p_data['forum_id']==$forum_parent ? " SELECTED" : "").">".$p_data['forum_name']."</option>\n";
    						$possibleParents .= renderChildren($p_data['forum_id']);
    					}
    					$possibleParents .= "</optgroup>\n";
    				}
    				
    				echo "<td colspan='2' class='tbl'>".$locale['fb101']."<br />\n";
    				echo "<select name='forum_parent' class='textbox' style='width:285px;' />\n";
    				echo "<option value=''>---</option>\n$possibleParents\n";
    				echo "</td>\n";
    				echo "</tr>\n<tr>\n";
    				
    			if (!isset($_GET['action']) || $_GET['action'] != "edit") {
    				echo "<tr>\n";
    				echo "<td align='center' colspan='2' class='tbl'>\n";
    				echo "<input type='submit' name='save_forum' value='".$locale['532']."' class='button' />";
    				echo "</td>\n</tr>\n";
    			}
    			
    			echo "</table>\n";
    			
    			// fb4 Mod End
    			
    			if (isset($_GET['action']) && $_GET['action'] == "edit") {
    				echo "<table align='center' cellpadding='0' cellspacing='0' width='300'>\n<tr>\n";
    				echo "<td class='tbl2' colspan='2'><strong>".$locale['524']."</strong></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['525']."</td>\n";
    				echo "<td class='tbl'><select name='forum_access' class='textbox' style='width:150px;'>\n".create_options($forum_access, array(), false)."</select></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['526']."</td>\n";
    				echo "<td class='tbl'><select name='forum_post' class='textbox' style='width:150px;'>\n".create_options($forum_post, array(0), true)."</select></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['527']."</td>\n";
    				echo "<td class='tbl'><select name='forum_reply' class='textbox' style='width:150px;'>\n".create_options($forum_reply, array(0), true)."</select></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['528']."</td>\n";
    				echo "<td class='tbl'><select name='forum_attach' class='textbox' style='width:150px;'>\n".create_options($forum_attach, array(0), true)."</select></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['529']."</td>\n";
    				echo "<td class='tbl'><select name='forum_poll' class='textbox' style='width:150px;'>\n".create_options($forum_poll, array(0), true)."</select></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['530']."</td>\n";
    				echo "<td class='tbl'><select name='forum_vote' class='textbox' style='width:150px;'>\n".create_options($forum_vote, array(0), true)."</select></td>\n";
    				echo "</tr>\n"; //";
    				if (!isset($_GET['action']) || $_GET['action'] != "edit") {
    					echo "<tr>\n<td align='center' colspan='2' class='tbl'>\n";
    					echo "<input type='submit' name='save_forum' value='".$locale['532']."' class='button' /></td>\n";
    					echo "</tr>\n</table>\n";
    				}
    			}
    			if (!isset($_GET['action'])) echo "\n</form>";
    			if (isset($_GET['action']) && $_GET['action'] == "edit") {
    				$mod_groups = getusergroups();
    				while(list($key, $mod_group) = each($mod_groups)){
    					if ($mod_group['0'] != "0" && $mod_group['0'] != "101" && $mod_group['0'] != "103") {
    						if (!preg_match("(^{$mod_group['0']}$|^{$mod_group['0']}\.|\.{$mod_group['0']}\.|\.{$mod_group['0']}$)", $data['forum_moderators'])) {
    							$mods1_user_id[] = $mod_group['0'];
    							$mods1_user_name[] = $mod_group['1'];
    						} else {
    							$mods2_user_id[] = $mod_group['0'];
    							$mods2_user_name[] = $mod_group['1'];
    						}
    					}
    				}
    				echo "<tr>\n<td class='tbl2' colspan='2'><strong>".$locale['533']."</strong></td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td align='center' colspan='2' class='tbl'>\n<select multiple='multiple' size='10' name='modlist1' id='modlist1' class='textbox' style='width:140px' onchange=\"addUser('modlist2','modlist1');\">\n";
    				for ($i=0;$i < count($mods1_user_id);$i++) {
    					echo "<option value='".$mods1_user_id[$i]."'>".$mods1_user_name[$i]."</option>\n";
    				}
    				echo "</select>\n";
    				echo "<select multiple='multiple' size='10' name='modlist2' id='modlist2' class='textbox' style='width:140px' onchange=\"addUser('modlist1','modlist2');\">\n";
    				if (isset($mods2_user_id) && is_array($mods2_user_id)) {
    					for ($i=0;$i < count($mods2_user_id);$i++) {
    						echo "<option value='".$mods2_user_id[$i]."'>".$mods2_user_name[$i]."</option>\n";
    					}
    				}
    				echo "</select>\n";
    				echo "</td>\n";
    				echo "</tr>\n<tr>\n";
    				echo "<td align='center' colspan='2'><br />\n";
    				echo "<input type='hidden' name='forum_mods' />\n";
    				echo "<input type='hidden' name='forum_id' value='".$data['forum_id']."' />\n";
    				echo "<input type='hidden' name='save_forum' />\n";
    				echo "<input type='button' name='save' value='".$locale['532']."' class='button' onclick='saveMods();' /></td>\n";
    				echo "</tr>\n</table>\n</form>\n";
    				echo "<script type='text/javascript'>\n"."function addUser(toGroup,fromGroup) {\n";
    				echo "var listLength = document.getElementById(toGroup).length;\n";
    				echo "var selItem = document.getElementById(fromGroup).selectedIndex;\n";
    				echo "var selText = document.getElementById(fromGroup).options[selItem].text;\n";
    				echo "var selValue = document.getElementById(fromGroup).options[selItem].value;\n";
    				echo "var i; var newItem = true;\n";
    				echo "for (i = 0; i < listLength; i++) {\n";
    				echo "if (document.getElementById(toGroup).options[i].text == selText) {\n";
    				echo "newItem = false; break;\n}\n}\n"."if (newItem) {\n";
    				echo "document.getElementById(toGroup).options[listLength] = new Option(selText, selValue);\n";
    				echo "document.getElementById(fromGroup).options[selItem] = null;\n}\n}\n";
    	
    				echo "function saveMods() {\n"."var strValues = \"\";\n";
    				echo "var boxLength = document.getElementById('modlist2').length;\n";
    				echo "var count = 0;\n"."	if (boxLength != 0) {\n"."for (i = 0; i < boxLength; i++) {\n";
    				echo "if (count == 0) {\n"."strValues = document.getElementById('modlist2').options[i].value;\n";
    				echo "} else {\n"."strValues = strValues + \".\" + document.getElementById('modlist2').options[i].value;\n";
    				echo "}\n"."count++;\n}\n}\n";
    				echo "if (strValues.length == 0) {\n"."document.forms['addforum'].submit();\n";
    				echo "} else {\n"."document.forms['addforum'].forum_mods.value = strValues;\n";
    				echo "document.forms['addforum'].submit();\n}\n}\n</script>\n";
    			}
    			closetable();
    	}
    	}
    	opentable($locale['550']);
    	$i = 1; $k = 1;
    	echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
    	$result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat='0' ORDER BY forum_order");
    	if (dbrows($result) != 0) {
    		echo "<tr>\n<td class='tbl2'><strong>".$locale['551']."</strong></td>\n";
    		echo "<td align='center' colspan='2' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['552']."</strong></td>\n";
    		echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['553']."</strong></td>\n";
    		echo "</tr>\n";
    		$i = 1;
    		while ($data = dbarray($result)) {
    		
    			echo "<tr>\n<td class='tbl2'><strong>".$data['forum_name']."</strong></td>\n";
    			echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_order']."</td>\n";
    			echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>\n";
    			if (dbrows($result) != 1) {
    				$up = $data['forum_order'] - 1;	$down = $data['forum_order'] + 1;
    				if ($i == 1) {
    					echo "<a href='".FUSION_SELF.$aidlink."&amp;action=md&amp;order=$down&amp;forum_id=".$data['forum_id']."&amp;t=cat'><img src='".get_image("down")."' alt='".$locale['557']."' title='".$locale['557']."' style='border:0px;' /></a>\n";
    				} elseif ($i < dbrows($result)) {
    					echo "<a href='".FUSION_SELF.$aidlink."&amp;action=mu&amp;order=$up&amp;forum_id=".$data['forum_id']."&amp;t=cat'><img src='".get_image("up")."' alt='".$locale['556']."' title='".$locale['558']."' style='border:0px;' /></a>\n";
    					echo "<a href='".FUSION_SELF.$aidlink."&amp;action=md&amp;order=$down&amp;forum_id=".$data['forum_id']."&amp;t=cat'><img src='".get_image("down")."' alt='".$locale['557']."' title='".$locale['557']."' style='border:0px;' /></a>\n";
    				} else {
    					echo "<a href='".FUSION_SELF.$aidlink."&amp;action=mu&amp;order=$up&amp;forum_id=".$data['forum_id']."&amp;t=cat'><img src='".get_image("up")."' alt='".$locale['556']."' title='".$locale['558']."' style='border:0px;' /></a>\n";
    				}
    			}
    			$i++;
    			echo "</td>\n";
    			echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;forum_id=".$data['forum_id']."&amp;t=cat'>".$locale['554']."</a> ::\n";
    			echo "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;forum_id=".$data['forum_id']."&amp;t=cat' onclick=\"return confirm('".$locale['440']."');\">".$locale['555']."</a></td>\n";
    			echo "</tr>\n";
    			$result2 = dbquery("SELECT * FROM ".DB_FORUMS."
    			where forum_cat='".$data['forum_id']."'  ORDER BY forum_order");
    			if (dbrows($result2)) {
    				$k = 1;
    				while ($data2 = dbarray($result2)) {
    					
    					$fb_res = dbquery("select * from ".$db_prefix."fb_forums where forum_id='".$data2['forum_id']."'");
    					if(dbrows($fb_res)){
    						$fb_data = dbarray($fb_res);
    						if($fb_data['forum_parent'] !== "0") continue;
    					}
    					
    					echo renderForum($data2, $result2, $k);
    					$k++;
    					echo forumChildren($data2['forum_id']);
    					
    				}
    			}
    			
    		}
    		echo "<tr>\n<td align='center' colspan='5' class='tbl2'>[ <a href='".FUSION_SELF.$aidlink."&amp;action=refresh'>".$locale['562']."</a> ]</td>\n</tr>\n";
    	} else {
    		echo "<tr>\n<td align='center' class='tbl1'>".$locale['560']."</td>\n</tr>\n";
    	}
    	echo "</table>\n";
    	closetable();
    }
    
    function renderForum($data2, $result2, $k, $indent=""){
    	
    	global $aidlink, $locale;
    	
    	$forumR = "";
    	$forumR .= "<tr>\n";
    	$forumR .= "<td class='tbl1'>$indent<span class='alt'>".$data2['forum_name']."</span>\n";
    	$forumR .= "[<a href='".FUSION_SELF.$aidlink."&amp;action=prune&amp;forum_id=".$data2['forum_id']."'>".$locale['563']."</a>]<br />\n";
    	$forumR .= ($data2['forum_description'] ? "$indent<span class='small'>".$data2['forum_description']."</span>" : "")."</td>\n";
    	$forumR .= "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data2['forum_order']."</td>\n";
    	$forumR .= "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>\n";
    	if (dbrows($result2) != 1) {
    		$up = $data2['forum_order'] - 1; $down = $data2['forum_order'] + 1;
    		if ($k == 1) {
    			$forumR .= "<a href='".FUSION_SELF.$aidlink."&amp;action=md&amp;order=$down&amp;forum_id=".$data2['forum_id']."&amp;t=forum&amp;cat=".$data2['forum_cat']."'><img src='".get_image("down")."' alt='".$locale['557']."' title='".$locale['557']."' style='border:0px;' /></a>\n";
    		} elseif ($k < dbrows($result2)) {
    			$forumR .= "<a href='".FUSION_SELF.$aidlink."&amp;action=mu&amp;order=$up&amp;forum_id=".$data2['forum_id']."&amp;t=forum&amp;cat=".$data2['forum_cat']."'><img src='".get_image("up")."' alt='".$locale['556']."' title='".$locale['558']."' style='border:0px;' /></a>\n";
    			$forumR .= "<a href='".FUSION_SELF.$aidlink."&amp;action=md&amp;order=$down&amp;forum_id=".$data2['forum_id']."&amp;t=forum&amp;cat=".$data2['forum_cat']."'><img src='".get_image("down")."' alt='".$locale['557']."' title='".$locale['557']."' style='border:0px;' /></a>\n";
    		} else {
    			$forumR .= "<a href='".FUSION_SELF.$aidlink."&amp;action=mu&amp;order=$up&amp;forum_id=".$data2['forum_id']."&amp;t=forum&amp;cat=".$data2['forum_cat']."'><img src='".get_image("up")."' alt='".$locale['556']."' title='".$locale['558']."' style='border:0px;' /></a>\n";
    		}
    	}
    	$forumR .= "</td>\n";
    	$forumR .= "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;forum_id=".$data2['forum_id']."&amp;t=forum'>".$locale['554']."</a> ::\n";
    	$forumR .= "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;forum_id=".$data2['forum_id']."&amp;t=forum' onclick=\"return confirm('".$locale['570']."');\">".$locale['555']."</a></td>\n";
    	$forumR .= "</tr>\n";
    	
    	return $forumR;
    }
    
    function forumChildren($parent, $level=1){
    
    	$result = dbquery("select * from ".DB_PREFIX."forums f
    	left join ".DB_PREFIX."fb_forums f2 on f2.forum_id=f.forum_id
    	where f2.forum_parent='$parent'");
    	
    	$forumR = "";
    	
    	if (dbrows($result)) {
    		$k = 1;
    		$children = "";
    		for($i = $level; $i--; $i > 0){
    			$children .= "&emsp;";
    		}
    		while ($data = dbarray($result)) {
    			
    			$forumR .= renderForum($data, $result, $k, $children);
    			$k++;
    			$forumR .= forumChildren($data['forum_id'], ($level+1));
    			
    		}
    	}
    	
    	return $forumR;
    }
    
    require_once THEMES."templates/footer.php";
    ?>


    was mich eben wündert ist das die db einträge aber vorhanden sind
  5. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!