function show_array($array, $die=0) { echo "
"; print_r($array); echo ""; if($die) die(); } /////// Remove Keys of Empty Array; function array_exclude($array, $exclude) { $new_array = array(); foreach($array as $v) { if(!in_array($v, $exclude)) $new_array[] = $v; } return $new_array; } ?> /*-------------------------------------------------------------------------- *Module: CORE *Filename: startup.inc.php *Description: Start Up Core Include *Version: 1.0.0 (2010-02-16) *Copyright: Freetimers Internet ------------------------------------------------------------------------- */ // this is the custom database class which records all queries include('database.class.php'); require("mobiledetect.class.php"); $device = new mobiledetect(); /* database name * path * username * password */ if(strpos($_SERVER['SERVER_ADDR'],'127.0.0')===false) { $dbservname = "localhost"; } else { $dbservname = "preview.freetimers.com"; } include("dbconfig.inc.php"); // do not change the details of db's below //$db2 = new database('queryLogging',$dbservname,'freetimers','freetimers'); //$db3 = new database('support',$dbservname,'freetimers','freetimers'); //$db2 = new database('queryLogging',$dbservname,'logging','doomed'); //$db3 = new database('support',$dbservname,'supportAdmin','leg7dog'); // this contains all the server variables... include('config.class.php'); $config = new config(); include('sessions.class.php'); $session = new sessions(); //include('faq.class.php'); //$faq= new faq(); // Organise the directory structure? //include('page.class.php'); //$page = new page(); // Contains random helpfull functions for use anywhere include('functions.class.php'); $functions = new functions(); // Has the functions that control the static pages. include('pages.class.php'); $pages = new pages(); // Controls everything to do with admins and clients //include('users.class.php'); //$users = new users(); //$session = new sessions(); // Controls the modules include('modules.class.php'); $modules = new modules(); // Controls the multisites include('sites.class.php'); $sites = new sites(); // Controls the languages include('languages.class.php'); $languages = new languages(); // Controls the helpers include('helper.class.php'); $helper = new helper(); // Controls the gallery include('gallery.class.php'); $gallery = new gallery(); // Controls the multisites //include('menus.class.php'); //$menus = new menus(); // Controls the mailing include('mail.class.php'); $mail = new mail(); // Controls the forms include('forms.class.php'); $forms = new forms(); // Controls the form items include('form_items.class.php'); $form_items = new form_items(); // So we can page results include('pagination.class.php'); // WYSIWYG editor include('FCKeditor/fckeditor.php'); // fck editor and content printing related bits include('fck.class.php'); //Set HTMLPurifier and defaults /* require_once('HTMLPurifier.auto.php'); $html_config = HTMLPurifier_Config::createDefault(); // configuration goes here: $html_config->set('Core.Encoding', 'UTF-8'); // replace with your encoding $html_config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); // replace with your doctype $html_config->set('HTML.DefinitionID', 'webadmin-custom.html'); $html_config->set('HTML.DefinitionRev', 1); $html_config->set('Cache.DefinitionImpl', null); // remove this later! $def = $html_config->getHTMLDefinition(true); $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top'); */ //show_array($def); // Date Manangement Class include('date.class.php'); // Uploaders Class include('uploads.class.php'); $date = new date(); // Countries, regions etc Class include('places.class.php'); $places = new places(); // Browser Class include('browser.class.php'); $browser = new browser(); /* LOAD THE INCLUDED MODULE CLASSES. */ $getModules = $db->query("SELECT * FROM modules order by id"); if ($db->num_rows($getModules) > 0) { while($rowModules = $db->next_record($getModules)) { if (is_dir($config->siteRoot.'/modules/'.$rowModules['folder'].'/')) { if (file_exists($config->siteRoot.'/modules/'.$rowModules['folder'].'/'.$rowModules['folder'].'.class.php')) { include($config->siteRoot.'/modules/'.$rowModules['folder'].'/'.$rowModules['folder'].'.class.php'); $$rowModules['folder'] = new $rowModules['folder']; } } } } ?>