| 1 | <?php |
|---|
| 2 | @ini_set('include_path', ini_get('include_path')); |
|---|
| 3 | @ini_set('arg_separator.output','&'); |
|---|
| 4 | if (intval(ini_get('max_execution_time')) < 300){ |
|---|
| 5 | @ini_set('max_execution_time', '300'); |
|---|
| 6 | } |
|---|
| 7 | if (intval(ini_get('memory_limit')) < 64){ |
|---|
| 8 | @ini_set('memory_limit', '64M'); |
|---|
| 9 | } |
|---|
| 10 | error_reporting(E_ALL); |
|---|
| 11 | |
|---|
| 12 | define('PLOGGER_DIR',dirname(__FILE__) . '/'); |
|---|
| 13 | define('TABLE_PREFIX','plogger_'); |
|---|
| 14 | $config_table = TABLE_PREFIX.'config'; |
|---|
| 15 | |
|---|
| 16 | define('THUMB_SMALL',1); |
|---|
| 17 | define('THUMB_LARGE',2); |
|---|
| 18 | define('THUMB_RSS',3); |
|---|
| 19 | define('THUMB_NAV',4); |
|---|
| 20 | define('THUMB_THEME',5); |
|---|
| 21 | |
|---|
| 22 | if (!headers_sent() && !session_id()) { |
|---|
| 23 | session_start(); |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | if (!class_exists('streamreader')) { |
|---|
| 28 | require_once(PLOGGER_DIR.'plog-includes/lib/gettext/streams.php'); |
|---|
| 29 | require_once(PLOGGER_DIR.'plog-includes/lib/gettext/gettext.php'); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | if (defined('PLOGGER_LOCALE') && PLOGGER_LOCALE!=='' && strlen(PLOGGER_LOCALE) >= 2) { |
|---|
| 33 | $locale = PLOGGER_LOCALE; |
|---|
| 34 | } else { |
|---|
| 35 | $locale = "en_US"; |
|---|
| 36 | } |
|---|
| 37 | $language = strtolower(substr($locale,0,2)); |
|---|
| 38 | |
|---|
| 39 | $mofile = PLOGGER_DIR."plog-content/translations/".$locale.".mo"; |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | if ( is_readable($mofile) && ($locale != 'en_US') ) { |
|---|
| 44 | $input = new FileReader($mofile); |
|---|
| 45 | } else { |
|---|
| 46 | $input = false; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | $plog_l10n = new gettext_reader($input); |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | function plog_tr($text) { |
|---|
| 53 | global $plog_l10n; |
|---|
| 54 | |
|---|
| 55 | if (isset($plog_l10n)){ |
|---|
| 56 | return $plog_l10n->translate($text); |
|---|
| 57 | } else { |
|---|
| 58 | return $text; |
|---|
| 59 | } |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | ?> |
|---|