_getConfig(); $this->_setTemplate(); } /* the configuration file handler */ function _getConfig() { global $lm_absolute_path; include ($lm_absolute_path."config.php"); $this->configArr['lm_absolute_path']=$lm_absolute_path; $this->configArr['lm_website']=$lm_website; $this->configArr['lm_title']=$lm_title; $this->configArr['lm_online'] = $lm_online ; $this->configArr['lm_offline_msg']=$lm_offline_msg; $this->configArr['lm_hideauthor']=$lm_hideauthor; $this->configArr['lm_hidecreate']=$lm_hidecreate; $this->configArr['lm_hidemodified']=$lm_hidemodified; $this->configArr['lm_hideprint']=$lm_hideprint; $this->configArr['lm_hideemail']=$lm_hideemail; $this->configArr['lm_db']=$lm_db; $this->configArr['lm_prefix']=$lm_prefix; $this->configArr['lm_dbhost']=$lm_dbhost; $this->configArr['lm_dbname']=$lm_dbname; $this->configArr['lm_dbusername']=$lm_dbusername; $this->configArr['lm_dbpassword']=$lm_dbpassword; $this->configArr['lm_cache']=$lm_cache; $this->configArr['lm_qcache']=$lm_qcache; $this->configArr['lm_name']=$lm_name ; $this->configArr['lm_username']=$lm_username; $this->configArr['lm_password']=$lm_password; $this->configArr['lm_email']=$lm_email; $this->configArr['lm_event']=$lm_event; $this->configArr['lm_language']=$lm_language; $this->configArr['lm_template']=$lm_template; $this->configArr['lm_keywords']=$lm_keywords; $this->configArr['lm_desc']=$lm_desc; $this->configArr['lm_gzip']=$lm_gzip; $this->configArr['lm_seo']=$lm_seo; $this->configArr['lm_error_level']=$lm_error_level; $this->configArr['lm_show_count']=$lm_show_count; $this->configArr['lm_locale']=$lm_locale; $this->configArr['lm_offset']=$lm_offset; $this->configArr['lm_userregistration']=$lm_userregistration; $this->configArr['lm_useractivation']=$lm_useractivation; $this->configArr['lm_emailpass']=$lm_emailpass; $this->configArr['lm_adminlang']=$lm_adminlang; $this->configArr['lm_htmledit']=$lm_htmledit; $this->configArr['lm_updates']=$lm_updates; $this->configArr['lm_rand']=$lm_rand; } function getVar($var) { return $this->configArr[$var]; } function setVar($var,$val) { $this->configArr[$var]=$val; } function setConfig() { global $lm_absolute_path; $cf = fopen('config.php','w',$lm_absolute_path); fwrite($cf,"configArr as $var=>$val) { $write='$'.$var."='".$val."';\n"; fwrite($cf,$write,strlen($write)); } fwrite($cf,"\$lm_version_num=\"1.0.4\";\n?>"); } /* redirect a browser */ function redir( $url, $msg='' ) { global $lm_website; if (trim( $msg )) { if (strpos( $url, '?' )) { $url .= "&sysmsg=$msg"; } else { $url .= "?sysmsg=$msg"; } } if(!strstr($url,"http"))$url=$lm_website.$url; if (headers_sent()) { echo "Redirecting ..."; echo "\n"; } else { header( "Location:$url" ); //header ("Refresh: 0 url=$url"); } exit(); } /* template handler */ function _setTemplate() { global $lm_absolute_path; $cur_template=''; // TemplateChooser Start $user_template = getParam( $_COOKIE, 'user_template', '' ); $change_template = getParam( $_POST, 'change_template', $user_template ); if ($change_template) { // check that template exists in case it was deleted if (file_exists( "$lm_absolute_path/templates/$change_template/index.php" )) { $lifetime = time()+(60*10); $cur_template = $change_template; setcookie( "user_template", "$change_template", $lifetime); } else { setcookie( "user_template", "", time()-3600 ); } } // TemplateChooser End $this->_template = $cur_template; } function getTemplate() { if($this->_template!='')return $this->_template; else return $this->getVar('lm_template'); } } /*intitalize the classes for usage */ $limbocore=new limboCore(); //for compatibility < 1.3 foreach($limbocore->configArr as $var=>$val)${str_replace("lm_","",$var)}=$val; ?>