Changeset 2239 for branches

Show
Ignore:
Timestamp:
11/26/10 12:11:27 (18 months ago)
Author:
nick_ramsay
Message:

[1.5] Libs updates from 1.4.2.

Location:
branches/1.5/libs
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/libs/AdminPages.php

    r2197 r2239  
    371371                                DB_PREFIX . 'posts', 
    372372                                DB_PREFIX . 'postvotes', 
    373                                 DB_PREFIX . 'relates', 
    374373                                DB_PREFIX . 'site', 
    375374                                DB_PREFIX . 'tags', 
  • branches/1.5/libs/Announcements.php

    r2001 r2239  
    8888                $announcements = array(); 
    8989 
    90                 if (SITEID == 1) { 
    91                     // Check if install file has been deleted 
    92                     $filename = INSTALL . 'install.php'; 
    93                     if (file_exists($filename)) { 
    94                             array_push($announcements, $h->lang['admin_announcement_delete_install']); 
    95                     } 
     90            // Check if install file has been deleted 
     91            $filename = INSTALL . 'install.php'; 
     92            if (file_exists($filename)) { 
     93                    array_push($announcements, $h->lang['admin_announcement_delete_install']); 
     94            } 
    9695 
    97                     // Check if install file has not been run 
    98                     $sql = "SELECT miscdata_value FROM " . TABLE_MISCDATA . " WHERE miscdata_key = %s"; 
    99                     $hotaru_version = $h->db->get_var($h->db->prepare($sql, 'hotaru_version')); 
    100                     if (version_compare($h->version, $hotaru_version, '>')) { 
    101                             array_push($announcements, $h->lang['admin_announcement_run_install']); 
    102                     } 
    103                 } 
     96            // Check if install file has not been run 
     97            $sql = "SELECT miscdata_value FROM " . TABLE_MISCDATA . " WHERE miscdata_key = %s"; 
     98            $hotaru_version = $h->db->get_var($h->db->prepare($sql, 'hotaru_version')); 
     99            if (version_compare($h->version, $hotaru_version, '>')) { 
     100                    array_push($announcements, $h->lang['admin_announcement_run_install']); 
     101            } 
    104102                 
    105103                // Site is currently undergoing maintenance 
  • branches/1.5/libs/Initialize.php

    r2197 r2239  
    4646                $this->setTableConstants(); 
    4747 
     48                $this->MakeCacheFolders(); 
    4849                $this->getFiles(); 
    4950                $this->cage = $this->initInspektCage(); 
    5051                $this->db = $this->initDatabase(); 
    5152 
    52                 $this->getCurrentSiteID(); 
    5353                $this->errorReporting(); 
    5454 
     
    109109                        "TABLE_POSTVOTES" => "postvotes", 
    110110                        "TABLE_SETTINGS" => "settings", 
    111                         "TABLE_SITE" => "site", 
    112111                        "TABLE_TAGS" => "tags", 
    113112                        "TABLE_TEMPDATA" => "tempdata", 
     
    125124        } 
    126125 
    127         /** 
    128          * Sets the current SiteID if multiple sites. 
    129          */ 
    130         public function getCurrentSiteID() 
    131         { 
    132                 $siteid = 1; 
    133                 $siteurl = BASEURL; 
    134  
    135                 if (!defined('SITEID')) { 
    136                         define('SITEID', $siteid); 
    137                 } 
    138                 if (!defined('SITEURL')) { 
    139                         define('SITEURL', $siteurl); 
    140                 } 
    141                 if (!defined('CACHE')) { 
    142  
    143                         define('CACHE', BASE.'cache/'.$siteid.'/'); 
    144  
    145                         // first array item is needed to create the SITEID base folder 
    146                         $dirs = array('', 'debug_logs/', 'db_cache/', 'css_js_cache/', 'html_cache/', 'rss_cache/', 'lang_cache/'); 
    147  
    148                         foreach ($dirs as $dir) { 
    149                                 if (!is_dir(CACHE.$dir)) { 
    150                                         mkdir(CACHE.$dir); 
    151                                 } 
    152                         } 
    153                 } 
    154  
    155                 return FALSE; 
    156         } 
    157126 
    158127        /** 
     
    248217        } 
    249218 
     219 
     220        /** 
     221         * Make cache folders if they don't already exist 
     222         */ 
     223        public function MakeCacheFolders() 
     224        { 
     225                // create a debug_logs folder if one doesn't exist. 
     226                if (!is_dir(CACHE . 'debug_logs')) { mkdir(CACHE . 'debug_logs'); } 
     227 
     228                // create a db_cache folder if one doesn't exist. 
     229                if (!is_dir(CACHE . 'db_cache')) { mkdir(CACHE . 'db_cache'); } 
     230 
     231                // create a css_js_cache folder if one doesn't exist. 
     232                if (!is_dir(CACHE . 'css_js_cache')) { mkdir(CACHE . 'css_js_cache'); } 
     233 
     234                // create a lang_cache folder if one doesn't exist. 
     235                if (!is_dir(CACHE . 'lang_cache')) { mkdir(CACHE . 'lang_cache'); } 
     236 
     237                // create an rss_cache folder if one doesn't exist. 
     238                if (!is_dir(CACHE . 'rss_cache')) { mkdir(CACHE . 'rss_cache'); } 
     239 
     240                // create an html_cache folder if one doesn't exist. 
     241                if (!is_dir(CACHE . 'html_cache')) { mkdir(CACHE . 'html_cache'); } 
     242        } 
     243 
     244 
    250245        /** 
    251246         * Set up database cache