root/trunk/plog-globals.php

Revision 588, 1.4 KB (checked in by kimparsell, 3 weeks ago)

+ Minor markup changes for install/upgrade process.
+ Minor admin section changes to make action notices consistent.
+ Miscellaneous cleanup.

Line 
1<?php
2@ini_set('include_path', ini_get('include_path'));
3@ini_set('arg_separator.output','&amp;');
4if (intval(ini_get('max_execution_time')) < 300){
5    @ini_set('max_execution_time', '300');
6}
7if (intval(ini_get('memory_limit')) < 64){
8    @ini_set('memory_limit', '64M');
9}
10error_reporting(E_ALL);
11
12define('PLOGGER_DIR',dirname(__FILE__) . '/');
13define('TABLE_PREFIX','plogger_');
14$config_table = TABLE_PREFIX.'config';
15
16define('THUMB_SMALL',1);
17define('THUMB_LARGE',2);
18define('THUMB_RSS',3);
19define('THUMB_NAV',4);
20define('THUMB_THEME',5);
21
22if (!headers_sent() && !session_id()) {
23    session_start();
24}
25
26
27if (!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
32if (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// If the mo file does not exist or is not readable, or if the locale is
42// en_US, do not load the mo.
43if ( 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// Return a translated string.
52function 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?>
Note: See TracBrowser for help on using the browser.