Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Ubercms Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Benden" data-source="post: 22085" data-attributes="member: 70"><p>[CODE] <?php</p><p>/*=======================================================================</p><p>| UberCMS - Advanced Website and Content Management System for uberEmu</p><p>| #######################################################################</p><p>| Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK'</p><p>| http://www.meth0d.org & http://www.sulake.biz</p><p>| #######################################################################</p><p>| This program is free software: you can redistribute it and/or modify</p><p>| it under the terms of the GNU General Public License as published by</p><p>| the Free Software Foundation, either version 3 of the License, or</p><p>| (at your option) any later version.</p><p>| #######################################################################</p><p>| This program is distributed in the hope that it will be useful,</p><p>| but WITHOUT ANY WARRANTY; without even the implied warranty of</p><p>| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</p><p>| GNU General Public License for more details.</p><p>\======================================================================*/</p><p></p><p></p><p>// ############################################################################</p><p>// Prepare the local environment</p><p></p><p>define('UBER', true);</p><p>define('DS', DIRECTORY_SEPARATOR);</p><p>define('LB', chr(13));</p><p>define('CWD', str_replace('manage' . DS, '', dirname(__FILE__) . DS));</p><p>define('INCLUDES', CWD . 'inc' . DS);</p><p>define('USER_IP', $_SERVER['REMOTE_ADDR']);</p><p></p><p>set_magic_quotes_runtime('0');</p><p>error_reporting(E_ALL);</p><p></p><p>session_start();</p><p></p><p></p><p>// ############################################################################</p><p>// Initialize core classes</p><p></p><p>require_once INCLUDES . "class.core.php";</p><p>require_once INCLUDES . "class.db.mysql.php";</p><p>require_once INCLUDES . "class.cron.php";</p><p>require_once INCLUDES . "class.users.php";</p><p>require_once INCLUDES . "class.tpl.php";</p><p></p><p>$core = new uberCore();</p><p>$cron = new uberCron();</p><p>$users = new uberUsers();</p><p>$tpl = new uberTpl();</p><p></p><p></p><p>// ############################################################################</p><p>// Execute some required core functionality</p><p></p><p>$core->ParseConfig();</p><p></p><p>$db = new MySQL($core->config['MySQL']['hostname'], $core->config['MySQL']['username'],</p><p> $core->config['MySQL']['password'], $core->config['MySQL']['database']);</p><p>$db->Connect();</p><p></p><p>$cron->Execute();</p><p></p><p>// ############################################################################</p><p>// Session handling</p><p></p><p>if (isset($_SESSION['UBER_USER_N']) && isset($_SESSION['UBER_USER_H']))</p><p>{</p><p> $userN = $_SESSION['UBER_USER_N'];</p><p> $userH = $_SESSION['UBER_USER_H'];</p><p> </p><p> if ($users->ValidateUser($userN, $userH))</p><p> {</p><p> define('LOGGED_IN', true);</p><p> define('USER_NAME', $userN);</p><p> define('USER_ID', $users->name2id($userN));</p><p> define('USER_HASH', $userH);</p><p> </p><p> $users->CacheUser(USER_ID);</p><p> }</p><p> else</p><p> {</p><p> @session_destroy();</p><p> header('Location: ./index.html');</p><p> exit;</p><p> } </p><p>}</p><p>else</p><p>{</p><p> define('LOGGED_IN', false);</p><p> define('USER_NAME', 'Guest');</p><p> define('USER_ID', -1);</p><p> define('USER_HASH', null);</p><p>}</p><p></p><p>define('FORCE_MAINTENANCE', ((uberCore::GetMaintenanceStatus() == "1") ? true : false));</p><p></p><p>if (FORCE_MAINTENANCE && !defined('IN_MAINTENANCE'))</p><p>{</p><p> if (!LOGGED_IN || !$users->HasFuse(USER_ID, 'fuse_ignore_maintenance'))</p><p> {</p><p> header("Location: " . WWW . "/maintenance.html");</p><p> exit;</p><p> }</p><p>}</p><p></p><p>if ((!defined('BAN_PAGE') || !BAN_PAGE) && ($users->IsIpBanned(USER_IP) || (LOGGED_IN && $users->IsUserBanned(USER_NAME))))</p><p>{</p><p> header("Location: " . WWW . "/banned.php");</p><p> exit;</p><p>}</p><p></p><p>$core->CheckCookies();</p><p></p><p>// ############################################################################</p><p>// Some commonly used functions for easy access</p><p></p><p>function dbquery($strQuery = '')</p><p>{</p><p> global $db;</p><p> </p><p> if($db->IsConnected())</p><p> {</p><p> return $db->DoQuery($strQuery);</p><p> }</p><p> </p><p> return $db->Error('Could not process query, no active db connection detected..');</p><p>}</p><p></p><p>function filter($strInput = '')</p><p>{</p><p> global $core;</p><p> </p><p> return $core->FilterInputString($strInput);</p><p>}</p><p></p><p>function clean($strInput = '', $ignoreHtml = false, $nl2br = false)</p><p>{</p><p> global $core;</p><p> </p><p> return $core->CleanStringForOutput($strInput, $ignoreHtml, $nl2br);</p><p>}</p><p></p><p>function shuffle_assoc(&$array)</p><p>{</p><p> $keys = array_keys($array);</p><p></p><p> shuffle($keys);</p><p></p><p> foreach($keys as $key)</p><p> {</p><p> $new[$key] = $array[$key];</p><p> }</p><p></p><p> $array = $new;</p><p></p><p> return true;</p><p>}</p><p></p><p>?></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="Benden, post: 22085, member: 70"] [CODE] <?php /*======================================================================= | UberCMS - Advanced Website and Content Management System for uberEmu | ####################################################################### | Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK' | http://www.meth0d.org & http://www.sulake.biz | ####################################################################### | This program is free software: you can redistribute it and/or modify | it under the terms of the GNU General Public License as published by | the Free Software Foundation, either version 3 of the License, or | (at your option) any later version. | ####################################################################### | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. \======================================================================*/ // ############################################################################ // Prepare the local environment define('UBER', true); define('DS', DIRECTORY_SEPARATOR); define('LB', chr(13)); define('CWD', str_replace('manage' . DS, '', dirname(__FILE__) . DS)); define('INCLUDES', CWD . 'inc' . DS); define('USER_IP', $_SERVER['REMOTE_ADDR']); set_magic_quotes_runtime('0'); error_reporting(E_ALL); session_start(); // ############################################################################ // Initialize core classes require_once INCLUDES . "class.core.php"; require_once INCLUDES . "class.db.mysql.php"; require_once INCLUDES . "class.cron.php"; require_once INCLUDES . "class.users.php"; require_once INCLUDES . "class.tpl.php"; $core = new uberCore(); $cron = new uberCron(); $users = new uberUsers(); $tpl = new uberTpl(); // ############################################################################ // Execute some required core functionality $core->ParseConfig(); $db = new MySQL($core->config['MySQL']['hostname'], $core->config['MySQL']['username'], $core->config['MySQL']['password'], $core->config['MySQL']['database']); $db->Connect(); $cron->Execute(); // ############################################################################ // Session handling if (isset($_SESSION['UBER_USER_N']) && isset($_SESSION['UBER_USER_H'])) { $userN = $_SESSION['UBER_USER_N']; $userH = $_SESSION['UBER_USER_H']; if ($users->ValidateUser($userN, $userH)) { define('LOGGED_IN', true); define('USER_NAME', $userN); define('USER_ID', $users->name2id($userN)); define('USER_HASH', $userH); $users->CacheUser(USER_ID); } else { @session_destroy(); header('Location: ./index.html'); exit; } } else { define('LOGGED_IN', false); define('USER_NAME', 'Guest'); define('USER_ID', -1); define('USER_HASH', null); } define('FORCE_MAINTENANCE', ((uberCore::GetMaintenanceStatus() == "1") ? true : false)); if (FORCE_MAINTENANCE && !defined('IN_MAINTENANCE')) { if (!LOGGED_IN || !$users->HasFuse(USER_ID, 'fuse_ignore_maintenance')) { header("Location: " . WWW . "/maintenance.html"); exit; } } if ((!defined('BAN_PAGE') || !BAN_PAGE) && ($users->IsIpBanned(USER_IP) || (LOGGED_IN && $users->IsUserBanned(USER_NAME)))) { header("Location: " . WWW . "/banned.php"); exit; } $core->CheckCookies(); // ############################################################################ // Some commonly used functions for easy access function dbquery($strQuery = '') { global $db; if($db->IsConnected()) { return $db->DoQuery($strQuery); } return $db->Error('Could not process query, no active db connection detected..'); } function filter($strInput = '') { global $core; return $core->FilterInputString($strInput); } function clean($strInput = '', $ignoreHtml = false, $nl2br = false) { global $core; return $core->CleanStringForOutput($strInput, $ignoreHtml, $nl2br); } function shuffle_assoc(&$array) { $keys = array_keys($array); shuffle($keys); foreach($keys as $key) { $new[$key] = $array[$key]; } $array = $new; return true; } ?> [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Ubercms Help
Top