| 3 | | error_reporting(E_ALL ^ E_NOTICE); |
|---|
| | 3 | // load settings and version information |
|---|
| | 4 | error_reporting(E_ALL ^ E_NOTICE); |
|---|
| | 5 | require_once(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."settings.inc.php"); |
|---|
| | 6 | require_once(JLOG_BASEPATH."scripts".DIRECTORY_SEPARATOR."version.inc.php"); |
|---|
| | 7 | |
|---|
| | 8 | // redirect to update-script if new jlog version was installed |
|---|
| | 9 | if(!defined('JLOG_INSTALLED_VERSION') OR version_compare(JLOG_INSTALLED_VERSION, JLOG_SOFTWARE_VERSION, '<')) { |
|---|
| | 10 | if(dirname($_SERVER['PHP_SELF']) !== "/") $dir = dirname($_SERVER['PHP_SELF']); |
|---|
| | 11 | header("Location: http://".$_SERVER['HTTP_HOST'].$dir."/admin/update.php"); |
|---|
| | 12 | exit; |
|---|
| | 13 | } |
|---|
| 5 | | define("JLOG_VERSION", '1.1.0'); |
|---|
| 6 | | define("JLOG_DB_CONTENT", JLOG_DB_PREFIX."content"); |
|---|
| 7 | | define("JLOG_DB_COMMENTS", JLOG_DB_PREFIX."comments"); |
|---|
| 8 | | define("JLOG_DB_CATASSIGN", JLOG_DB_PREFIX."catassign"); |
|---|
| 9 | | define("JLOG_DB_CATEGORIES", JLOG_DB_PREFIX."categories"); |
|---|
| 10 | | define("JLOG_DB_ATTRIBUTES", JLOG_DB_PREFIX."attributes"); |
|---|
| | 15 | // define constants for names of tables in database |
|---|
| | 16 | define("JLOG_DB_CONTENT", JLOG_DB_PREFIX."content"); |
|---|
| | 17 | define("JLOG_DB_COMMENTS", JLOG_DB_PREFIX."comments"); |
|---|
| | 18 | define("JLOG_DB_CATASSIGN", JLOG_DB_PREFIX."catassign"); |
|---|
| | 19 | define("JLOG_DB_CATEGORIES", JLOG_DB_PREFIX."categories"); |
|---|
| | 20 | define("JLOG_DB_ATTRIBUTES", JLOG_DB_PREFIX."attributes"); |
|---|
| 12 | | // need this in every page |
|---|
| 13 | | if(!defined('JLOG_LANGUAGE')) { |
|---|
| 14 | | if(dirname($_SERVER['PHP_SELF']) !== "/") $dir = dirname($_SERVER['PHP_SELF']); |
|---|
| 15 | | header("Location: http://".$_SERVER['HTTP_HOST'].$dir."/admin/update.php"); |
|---|
| 16 | | } |
|---|
| 17 | | require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang.'.JLOG_LANGUAGE.'.inc.php'); |
|---|
| 18 | | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'database.class.php'); |
|---|
| 19 | | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'bbcode.php'); |
|---|
| 20 | | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'general.func.php'); |
|---|
| 21 | | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'comments.php'); |
|---|
| | 22 | // we need these files on every page |
|---|
| | 23 | require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang.'.JLOG_LANGUAGE.'.inc.php'); |
|---|
| | 24 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'database.class.php'); |
|---|
| | 25 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'bbcode.php'); |
|---|
| | 26 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'general.func.php'); |
|---|
| | 27 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'comments.php'); |
|---|
| 31 | | } |
|---|
| 32 | | @mysql_select_db( JLOG_DB ); |
|---|
| 33 | | @mysql_query("SET NAMES utf8"); |
|---|
| 34 | | @mysql_query("SET sql_mode=''"); |
|---|
| | 37 | } |
|---|
| | 38 | // select our database |
|---|
| | 39 | $select = @mysql_select_db(JLOG_DB); |
|---|
| | 40 | if ($connect == FALSE) { |
|---|
| | 41 | mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error()); |
|---|
| | 42 | die("<strong>".$l['db_error']."</strong><br />".$l['plz_try_again']."."); |
|---|
| | 43 | } |
|---|
| | 44 | // do some settings |
|---|
| | 45 | @mysql_query("SET NAMES utf8"); |
|---|
| | 46 | @mysql_query("SET sql_mode=''"); |
|---|
| 36 | | // need this in every page, too but with database |
|---|
| 37 | | setlocale(LC_TIME, $l['locale']); |
|---|
| 38 | | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'categories.class.php'); |
|---|
| 39 | | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'jlogPlugins.class.php'); |
|---|
| 40 | | $plugins = new JlogPluginManager(JLOG_BASEPATH.'plugins'.DIRECTORY_SEPARATOR); |
|---|
| | 48 | // some more code that needs to run for every page - however, this |
|---|
| | 49 | // code requires an established connection to the database |
|---|
| | 50 | setlocale(LC_TIME, $l['locale']); |
|---|
| | 51 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'categories.class.php'); |
|---|
| | 52 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'jlogPlugins.class.php'); |
|---|
| | 53 | $plugins = new JlogPluginManager(JLOG_BASEPATH.'plugins'.DIRECTORY_SEPARATOR); |
|---|