Changeset 2260 for branches

Show
Ignore:
Timestamp:
11/26/10 16:02:20 (18 months ago)
Author:
petsagouris
Message:

[Branch 1.5] Minor edits in the Hotaru.php file.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/Hotaru.php

    r2237 r2260  
    55 * PHP version 5 
    66 * 
    7  * LICENSE: Hotaru CMS is free software: you can redistribute it and/or  
    8  * modify it under the terms of the GNU General Public License as  
    9  * published by the Free Software Foundation, either version 3 of  
    10  * the License, or (at your option) any later version.  
    11  * 
    12  * Hotaru CMS is distributed in the hope that it will be useful, but WITHOUT  
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  
    14  * FITNESS FOR A PARTICULAR PURPOSE.  
    15  * 
    16  * You should have received a copy of the GNU General Public License along  
     7 * LICENSE: Hotaru CMS is free software: you can redistribute it and/or 
     8 * modify it under the terms of the GNU General Public License as 
     9 * published by the Free Software Foundation, either version 3 of 
     10 * the License, or (at your option) any later version. 
     11 * 
     12 * Hotaru CMS is distributed in the hope that it will be useful, but WITHOUT 
     13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
     14 * FITNESS FOR A PARTICULAR PURPOSE. 
     15 * 
     16 * You should have received a copy of the GNU General Public License along 
    1717 * with Hotaru CMS. If not, see http://www.gnu.org/licenses/. 
    18  *  
     18 * 
    1919 * @category  Content Management System 
    2020 * @package   HotaruCMS 
     
    2626class Hotaru 
    2727{ 
    28         protected $version              = "1.5";  // Hotaru CMS version 
     28        protected $version              = "1.5.0";  // Hotaru CMS version 
    2929        protected $isDebug              = false;    // show db queries and page loading time 
    3030        protected $isAdmin              = false;    // flag to tell if we are in Admin or not 
     
    3232        protected $csrfToken            = '';       // token for CSRF 
    3333        protected $lang                 = array();  // stores language file content 
    34          
     34 
    3535        // objects 
    3636        protected $db;                              // database object 
     
    4242        protected $comment;                         // Comment object 
    4343        protected $includes;                        // for CSS/JavaScript includes 
    44         protected $debug;                           // Debug object 
    4544        protected $pageHandling;                    // PageHandling object 
    46          
     45 
    4746        // page info 
    4847        protected $home                 = '';       // name for front page 
     
    5655        protected $pluginSettings       = array();  // contains all settings for all plugins 
    5756        protected $allPluginDetails     = array();  // contains details of all plugins 
    58          
     57 
    5958        // messages 
    6059        protected $message              = '';       // message to display 
    6160        protected $messageType          = 'green';  // green or red, color of message box 
    6261        protected $messages             = array();  // for multiple messages 
    63          
     62 
    6463        // miscellaneous 
    65         protected $vars                 = array();  // multi-purpose     
    66      
     64        protected $vars                 = array();  // multi-purpose 
     65 
    6766        /** 
    6867         * CONSTRUCTOR - Initialize 
    6968         */ 
    7069        public function __construct($start = '') 
    71         {  
     70        { 
    7271                // define shorthand paths 
    7372                if (!defined('BASE')) { 
    74                         define("BASE", dirname(__FILE__). '/'); 
    75                         define("CACHE", dirname(__FILE__).'/cache/'); 
    76                         define("ADMIN", dirname(__FILE__).'/admin/');                
    77                         define("INSTALL", dirname(__FILE__).'/install/'); 
    78                         define("LIBS", dirname(__FILE__).'/libs/'); 
    79                         define("EXTENSIONS", dirname(__FILE__).'/libs/extensions/'); 
    80                         define("FUNCTIONS", dirname(__FILE__).'/functions/'); 
    81                         define("CONTENT", dirname(__FILE__).'/content/'); 
    82                         define("THEMES", dirname(__FILE__).'/content/themes/'); 
    83                         define("PLUGINS", dirname(__FILE__).'/content/plugins/'); 
    84                         define("ADMIN_THEMES", dirname(__FILE__).'/content/admin_themes/'); 
    85                         define("SITEURL", BASEURL); 
     73                        define('BASE', dirname(__FILE__).'/'); 
     74                        define('CACHE', dirname(__FILE__).'/cache/'); 
     75                        define('ADMIN', dirname(__FILE__).'/admin/'); 
     76                        define('INSTALL', dirname(__FILE__).'/install/'); 
     77                        define('LIBS', dirname(__FILE__).'/libs/'); 
     78                        define('EXTENSIONS', dirname(__FILE__).'/libs/extensions/'); 
     79                        define('FUNCTIONS', dirname(__FILE__).'/functions/'); 
     80                        define('CONTENT', dirname(__FILE__).'/content/'); 
     81                        define('THEMES', dirname(__FILE__).'/content/themes/'); 
     82                        define('PLUGINS', dirname(__FILE__).'/content/plugins/'); 
     83                        define('ADMIN_THEMES', dirname(__FILE__).'/content/admin_themes/'); 
     84                        define('SITEURL', BASEURL); 
    8685                } 
    8786 
     
    9089                // initialize Hotaru 
    9190                if (!$start) { 
    92                          
     91 
    9392                        $init = new Initialize($this); 
    9493 
    9594                        $this->db           = $init->db;            // database object 
    9695                        $this->cage         = $init->cage;          // Inspekt cage 
    97                         $this->isDebug      = $init->isDebug;       // set debug                         
     96                        $this->isDebug      = $init->isDebug;       // set debug 
    9897                        $this->currentUser  = new UserAuth();       // the current user 
    9998                        $this->plugin       = new Plugin();         // instantiate Plugin object 
     
    101100                        $this->includes     = new IncludeCssJs();   // instantiate Includes object 
    102101                        $this->pageHandling = new PageHandling();   // instantiate PageHandling object 
    103                         $this->debug        = new Debug();          // instantiate Debug object 
    104                          
     102 
    105103                        $this->csrf('set');                         // set a csrfToken 
    106104                        $this->db->setHotaru($this);                // pass $h object to EzSQL for error reporting 
    107105                } 
    108106        } 
    109      
    110      
     107 
     108 
    111109/* ************************************************************* 
    112110 * 
     
    124122                $lang = new Language(); 
    125123                $this->lang = $lang->includeLanguagePack($this->lang, 'main'); 
    126                  
     124 
    127125                $this->getPageName();                   // fills $h->pageName 
    128                  
     126 
    129127                switch ($entrance) { 
    130128                        case 'admin': 
    131129                                $this->isAdmin = true; 
    132                                 $this->lang = $lang->includeLanguagePack($this->lang, 'admin');                          
     130                                $this->lang = $lang->includeLanguagePack($this->lang, 'admin'); 
    133131                                $admin = new AdminAuth();               // new Admin object 
    134132                                $this->checkCookie();                   // check cookie reads user details 
     
    144142                                $this->displayTemplate('index');        // displays the index page 
    145143                } 
    146                  
     144 
    147145                $lang->writeLanguageCache($this); 
    148                  
     146 
    149147                exit; 
    150148        } 
    151      
    152      
     149 
     150 
    153151/* ************************************************************* 
    154152 * 
     
    156154 * 
    157155 * *********************************************************** */ 
    158   
    159   
     156 
     157 
    160158        /** 
    161159         * Access modifier to set protected properties 
     
    165163                $this->$var = $val; 
    166164        } 
    167      
    168      
     165 
     166 
    169167        /** 
    170168         * Access modifier to get protected properties 
     
    182180 * 
    183181 * *********************************************************** */ 
    184   
    185       
     182 
     183 
    186184        /** 
    187185         * Include language file if available 
     
    191189                $this->includeLanguage($this->plugin->folder); 
    192190        } 
    193       
    194       
     191 
     192 
    195193        /** 
    196194         * Include All CSS and JavaScript files for this plugin 
     
    199197        { 
    200198                if ($this->isAdmin) { return false; } 
    201                  
     199 
    202200                // include a files that match the name of the plugin folder: 
    203201                $this->includeJs($this->plugin->folder); // folder name, filename 
    204202                $this->includeCss($this->plugin->folder); 
    205203        } 
    206      
    207      
     204 
     205 
    208206        /** 
    209207         * Include All CSS and JavaScript files for this plugin in Admin 
     
    212210        { 
    213211                if (!$this->isAdmin) { return false; } 
    214                  
     212 
    215213                // include a files that match the name of the plugin folder: 
    216214                $this->includeJs($this->plugin->folder); // folder name, filename 
    217215                $this->includeCss($this->plugin->folder); 
    218216        } 
    219      
    220      
     217 
     218 
    221219        /** 
    222220         * Include code as a template before the closing </body> tag 
     
    226224                $this->displayTemplate($this->plugin->folder . '_footer', $this->plugin->folder); 
    227225        } 
    228      
     226 
    229227 
    230228        /** 
     
    238236                return $vars; 
    239237        } 
    240          
    241          
     238 
     239 
    242240        /** 
    243241         * Display Admin settings page 
     
    251249                // The class must have a method called "settings". 
    252250                if (($this->cage->get->testAlnumLines('plugin') != $this->plugin->folder) 
    253                         && ($this->cage->post->testAlnumLines('plugin') != $this->plugin->folder))  
    254                 {  
    255                         return false;  
     251                        && ($this->cage->post->testAlnumLines('plugin') != $this->plugin->folder)) 
     252                { 
     253                        return false; 
    256254                } 
    257                  
     255 
    258256                if (file_exists(PLUGINS . $this->plugin->folder . '/' . $this->plugin->folder . '_settings.php')) { 
    259257                    include_once(PLUGINS . $this->plugin->folder . '/' . $this->plugin->folder . '_settings.php'); 
    260                  
     258 
    261259                    $settings_class = make_name($this->plugin->folder, '_') . 'Settings'; // e.g. CategoriesSettings 
    262260                    $settings_class = str_replace(' ', '', $settings_class); // strip spaces 
    263261                    $settings_object = new $settings_class(); 
    264                     $settings_object->settings($this);   // call the settings function           
     262                    $settings_object->settings($this);   // call the settings function 
    265263                } 
    266264                else { 
     
    270268                return true; 
    271269        } 
    272      
    273      
     270 
     271 
    274272/* ************************************************************* 
    275273 * 
     
    298296                return $this->pageHandling->isHome($this); 
    299297        } 
    300          
    301          
     298 
     299 
    302300        /** 
    303301         * Determine the title tags for the header 
     
    310308                return $this->pageHandling->getTitle($this, $delimiter, $raw); 
    311309        } 
    312      
    313      
     310 
     311 
    314312        /** 
    315313         * Includes a template to display 
     
    323321                $this->pageHandling->displayTemplate($this, $page, $plugin, $include_once); 
    324322        } 
    325      
    326      
     323 
     324 
    327325        /** 
    328326         * Checks if current page (in url or form) matches the page parameter 
     
    334332                return $this->pageHandling->isPage($this, $page); 
    335333        } 
    336      
    337      
    338         /** 
    339          * Check to see if the Admin settings page we are looking at   
     334 
     335 
     336        /** 
     337         * Check to see if the Admin settings page we are looking at 
    340338         * matches the plugin passed to this function. 
    341339         * 
     
    343341         * @return bool 
    344342         * 
    345          *  Notes: This is used in "admin_header_include" so we only include the css,  
     343         *  Notes: This is used in "admin_header_include" so we only include the css, 
    346344         *         javascript etc. for the plugin we're trying to change settings for. 
    347          *  Usage: $h->isSettingsPage('submit') returns true if  
     345         *  Usage: $h->isSettingsPage('submit') returns true if 
    348346         *         page=plugin_settings and plugin=submit in the url. 
    349347         */ 
     
    353351        } 
    354352 
    355      
     353 
    356354        /** 
    357355         * Gets the current page name 
     
    362360                return $this->pageName; 
    363361        } 
    364      
    365      
     362 
     363 
    366364        /** 
    367365         * Converts a friendly url into a standard one 
     
    370368         * return string $standard_url 
    371369         */ 
    372         public function friendlyToStandardUrl($friendly_url)  
     370        public function friendlyToStandardUrl($friendly_url) 
    373371        { 
    374372                return $this->pageHandling->friendlyToStandardUrl($this, $friendly_url); 
    375373        } 
    376      
    377      
     374 
     375 
    378376        /** 
    379377         * Generate either default or friendly urls 
    380378         * 
    381          * @param array $parameters an array of pairs, e.g. 'page' => 'about'  
     379         * @param array $parameters an array of pairs, e.g. 'page' => 'about' 
    382380         * @param string $head either 'index' or 'admin' 
    383381         * @return string 
     
    387385                return $this->pageHandling->url($this, $parameters, $head); 
    388386        } 
    389      
    390      
     387 
     388 
    391389        /** 
    392390         * Pagination with query and row count (better for large sets of data) 
     
    403401                return $paginator->pagination($this, $query, $total_items, $items_per_page, $cache_table); 
    404402        } 
    405      
     403 
    406404 
    407405        /** 
     
    417415                return $paginator->paginationFull($this, $data, $items_per_page); 
    418416        } 
    419      
    420   
     417 
     418 
    421419        /** 
    422420         * Return page numbers bar 
     
    429427                return $paginator->pageBar($this); 
    430428        } 
    431      
     429 
    432430 
    433431/* ************************************************************* 
     
    436434 * 
    437435 * *********************************************************** */ 
    438   
    439   
     436 
     437 
    440438        /** 
    441439         * Build breadcrumbs 
     
    446444                return $breadcrumbs->buildBreadcrumbs($this); 
    447445        } 
    448      
    449      
     446 
     447 
    450448        /** 
    451449         * prepares the RSS link found in breadcrumbs 
     
    454452         * @param array $vars - array of key -> value pairs 
    455453         * @return string 
    456          */     
     454         */ 
    457455        public function rssBreadcrumbsLink($status = '', $vars = array()) 
    458456        { 
     
    460458                return $breadcrumbs->rssBreadcrumbsLink($this, $status, $vars); 
    461459        } 
    462      
    463   
     460 
     461 
    464462 /* ************************************************************* 
    465463 * 
     
    467465 * 
    468466 * *********************************************************** */ 
    469   
    470         /* UserBase & UserAuth functions should be called directly if you want to  
     467 
     468        /* UserBase & UserAuth functions should be called directly if you want to 
    471469           retain the user object being used. E.g. 
    472                  
     470 
    473471                $user = new UserAuth(); 
    474472                $user->getUserBasic($h); 
    475473                $user->updateUserBasic($h); 
    476474        */ 
    477          
    478          
     475 
     476 
    479477        /** 
    480478         * check cookie and log in 
     
    486484                $this->currentUser->checkCookie($this); 
    487485        } 
    488          
    489          
     486 
     487 
    490488        /** 
    491489         * Get basic user details 
    492490         * 
    493          * @param int $userid  
     491         * @param int $userid 
    494492         * @param string $username 
    495493         * @param bool $no_cache - set true to disable caching of SQl results 
     
    503501                return $userbase->getUserBasic($this, $userid, $username, $no_cache); 
    504502        } 
    505          
    506          
     503 
     504 
    507505        /** 
    508506         * Get full user details (i.e. permissions and settings, too) 
    509507         * 
    510          * @param int $userid  
     508         * @param int $userid 
    511509         * @param string $username 
    512510         * @param bool $no_cache - set true to disable caching of SQl results 
     
    520518                return $userbase->getUser($this, $userid, $username, $no_cache); 
    521519        } 
    522          
    523          
     520 
     521 
    524522        /** 
    525523         * Default permissions 
     
    530528         * @return array $perms 
    531529         */ 
    532         public function getDefaultPermissions($role = '', $defaults = 'site', $options_only = false)  
     530        public function getDefaultPermissions($role = '', $defaults = 'site', $options_only = false) 
    533531        { 
    534532                $userbase = new UserBase(); 
    535533                return $userbase->getDefaultPermissions($this, $role, $defaults, $options_only); 
    536534        } 
    537          
    538          
     535 
     536 
    539537        /** 
    540538         * Update Default permissions 
    541539         * 
    542540         * @param array $new_perms from a plugin's install function 
    543          * @param string $defaults - either "site", "base" or "both"  
     541         * @param string $defaults - either "site", "base" or "both" 
    544542         * @param bool $remove - false if adding perms, true if deleting them 
    545543         */ 
    546         public function updateDefaultPermissions($new_perms = array(), $defaults = 'both', $remove = false)  
     544        public function updateDefaultPermissions($new_perms = array(), $defaults = 'both', $remove = false) 
    547545        { 
    548546                $userbase = new UserBase(); 
    549547                return $userbase->updateDefaultPermissions($this, $new_perms, $defaults, $remove); 
    550548        } 
    551          
    552          
     549 
     550 
    553551        /** 
    554552         * Get the default user settings 
     
    562560                return $userbase->getDefaultSettings($this, $type); 
    563561        } 
    564          
    565          
     562 
     563 
    566564        /** 
    567565         * Update the default user settings 
    568566         * 
    569          * @param array $settings  
     567         * @param array $settings 
    570568         * @param string $type either 'site' or 'base' (base for the originals) 
    571569         * @return array 
     
    576574                return $userbase->updateDefaultSettings($this, $settings, $type); 
    577575        } 
    578          
    579          
     576 
     577 
    580578        /** 
    581579         * Get a user's profile or settings data 
     
    588586                return $userbase->getProfileSettingsData($this, $type, $userid, $check_exists_only); 
    589587        } 
    590          
    591          
     588 
     589 
    592590        /** 
    593591         * Physically delete a user 
     
    596594         * @param int $user_id (optional) 
    597595         */ 
    598         public function deleteUser($user_id = 0)  
     596        public function deleteUser($user_id = 0) 
    599597        { 
    600598                $userbase = new UserBase(); 
     
    608606         * @param int $user_id (optional) 
    609607         */ 
    610         public function updateUserLastVisit($user_id = 0)  
     608        public function updateUserLastVisit($user_id = 0) 
    611609        { 
    612610                return $this->currentUser->updateUserLastVisit($this, $user_id); 
    613611        } 
    614          
     612 
    615613 
    616614        /** 
     
    620618         * @return array|false 
    621619         */ 
    622         public function getRoles($type = 'all')  
     620        public function getRoles($type = 'all') 
    623621        { 
    624622                return $this->currentUser->getRoles($this, $type); 
     
    631629         * @return array|false 
    632630         */ 
    633         public function getUniqueRoles()  
     631        public function getUniqueRoles() 
    634632        { 
    635633                return $this->getRoles(); 
    636634        } 
    637635 
    638          
     636 
    639637 /* ************************************************************* 
    640638 * 
     
    642640 * 
    643641 * *********************************************************** */ 
    644          
    645          
     642 
     643 
    646644        /** 
    647645         * Get the username for a given user id 
     
    655653                return $userInfo->getUserNameFromId($this, $id); 
    656654        } 
    657          
    658          
     655 
     656 
    659657        /** 
    660658         * Get the user id for a given username 
     
    668666                return $userInfo->getUserIdFromName($this, $username); 
    669667        } 
    670          
    671          
     668 
     669 
    672670        /** 
    673671         * Get the email from user id 
     
    681679                return $userInfo->getEmailFromId($this, $userid); 
    682680        } 
    683          
    684          
     681 
     682 
    685683        /** 
    686684         * Get the user id from email 
     
    694692                return $userInfo->getUserIdFromEmail($this, $email); 
    695693        } 
    696          
    697          
     694 
     695 
    698696         /** 
    699697         * Checks if the user has an 'admin' role 
     
    706704                return $userInfo->isAdmin($this->db, $username); 
    707705        } 
    708          
    709          
     706 
     707 
    710708        /** 
    711709         * Check if a user exists 
    712710         * 
    713          * @param int $userid  
     711         * @param int $userid 
    714712         * @param string $username 
    715713         * @return int 
     
    722720                return $userInfo->userExists($this->db, $id, $username, $email); 
    723721        } 
    724          
    725          
     722 
     723 
    726724        /** 
    727725         * Check if an username exists in the database (used in forgotten password) 
     
    737735                return $userInfo->nameExists($this, $username, $role, $exclude); 
    738736        } 
    739          
    740          
     737 
     738 
    741739        /** 
    742740         * Check if an email exists in the database (used in forgotten password) 
     
    752750                return $userInfo->emailExists($this, $email, $role, $exclude); 
    753751        } 
    754          
    755          
     752 
     753 
    756754        /** 
    757755         * Get all users with permission to (access admin) 
     
    766764                return $userInfo->getMods($this, $permission, $value); 
    767765        } 
    768          
    769          
     766 
     767 
    770768        /** 
    771769         * Get the ids and names of all users or those with a specified role, sorted alphabetically 
     
    779777                return $userInfo->userIdNameList($this, $role); 
    780778        } 
    781          
    782          
     779 
     780 
    783781        /** 
    784782         * Get full details of all users or batches of users, sorted alphabetically 
     
    794792                return $userInfo->userListFull($this, $id_array, $start, $range); 
    795793        } 
    796          
    797          
     794 
     795 
    798796        /** 
    799797         * Get settings for all users 
    800798         * 
    801          * @param int $userid - optional user id  
     799         * @param int $userid - optional user id 
    802800         * @return array 
    803801         */ 
     
    808806        } 
    809807 
    810      
     808 
    811809 /* ************************************************************* 
    812810 * 
     
    814812 * 
    815813 * *********************************************************** */ 
    816   
    817   
     814 
     815 
    818816        /** 
    819817         * Look for and run actions at a given plugin hook 
     
    830828                return $pluginFunctions->pluginHook($this, $hook, $folder, $parameters, $exclude); 
    831829        } 
    832          
    833          
     830 
     831 
    834832        /** 
    835833         * Get a single plugin's details for Hotaru 
     
    843841                return $pluginFunctions->readPlugin($this, $folder); 
    844842        } 
    845          
    846          
     843 
     844 
    847845        /** 
    848846         * Get a single property from a specified plugin 
     
    857855                return $pluginFunctions->getPluginProperty($this, $property, $folder, $field); 
    858856        } 
    859          
    860          
     857 
     858 
    861859        /** 
    862860         * Get number of active plugins 
     
    869867                return $pluginFunctions->numActivePlugins($this->db); 
    870868        } 
    871          
    872          
     869 
     870 
    873871        /** 
    874872         * Get version number of plugin if active 
     
    881879                return $this->getPluginProperty('plugin_version', $folder); 
    882880        } 
    883          
    884          
     881 
     882 
    885883        /** 
    886884         * Get a plugin's actual name from its folder name 
     
    893891                return $this->getPluginProperty('plugin_name', $folder); 
    894892        } 
    895          
    896          
     893 
     894 
    897895        /** 
    898896         * Get a plugin's folder from its class name 
     
    906904                $this->plugin->folder = $pluginFunctions->getPluginFolderFromClass($this, $class); 
    907905        } 
    908          
    909          
     906 
     907 
    910908        /** 
    911909         * Get a plugin's class from its folder name 
     
    918916                return $this->getPluginProperty('plugin_class', $folder); 
    919917        } 
    920          
    921          
     918 
     919 
    922920        /** 
    923921         * Determines if a plugin "type" is enabled, if not, plugin "folder" 
     
    934932                return $result; 
    935933        } 
    936          
    937          
     934 
     935 
    938936        /** 
    939937         * Determines if a specific plugin is installed 
     
    948946                return $result; 
    949947        } 
    950          
    951          
     948 
     949 
    952950        /** 
    953951         * Determines if a plugin has a settings page or not 
     
    969967 * 
    970968 * *********************************************************** */ 
    971   
    972   
     969 
     970 
    973971        /** 
    974972         * Get the value for a given plugin and setting 
     
    986984                return $pluginSettings->getSetting($this, $setting, $folder); 
    987985        } 
    988          
    989          
     986 
     987 
    990988        /** 
    991989         * Get an array of settings for a given plugin 
     
    1001999                return $pluginSettings->getSettingsArray($this, $folder); 
    10021000        } 
    1003          
    1004          
     1001 
     1002 
    10051003        /** 
    10061004         * Get and unserialize serialized settings 
     
    10151013                return $pluginSettings->getSerializedSettings($this, $folder, $settings_name); 
    10161014        } 
    1017          
    1018          
     1015 
     1016 
    10191017        /** 
    10201018         * Get and store all plugin settings in $h->pluginSettings 
     
    10281026                return $this->pluginSettings; 
    10291027        } 
    1030          
    1031          
     1028 
     1029 
    10321030        /** 
    10331031         * Determine if a plugin setting already exists 
     
    10421040                return $pluginSettings->isSetting($this, $setting, $folder); 
    10431041        } 
    1044          
    1045          
     1042 
     1043 
    10461044        /** 
    10471045         * Update a plugin setting 
     
    10751073                return $themeSettings->readThemeMeta($this, $theme); 
    10761074        } 
    1077          
    1078          
     1075 
     1076 
    10791077        /** 
    10801078         * Get and unserialize serialized settings 
     
    10891087                return $themeSettings->getThemeSettings($this, $theme, $return); 
    10901088        } 
    1091          
    1092          
     1089 
     1090 
    10931091        /** 
    10941092         * Update theme settings 
     
    10971095         * @param string $theme theme folder name 
    10981096         * @param string $column 'value', 'default' or 'both' 
    1099          
     1097 
    11001098         */ 
    11011099        public function updateThemeSettings($settings = array(), $theme = '', $column = 'value') 
     
    11111109 * 
    11121110 * *********************************************************** */ 
    1113   
     1111 
    11141112 
    11151113        /** 
     
    11201118                $this->includes->includeCombined($this, $this->isAdmin); 
    11211119         } 
    1122           
    1123           
     1120 
     1121 
    11241122        /** 
    11251123         * Build an array of css files to combine 
     
    11331131                return $this->includes->includeFile('css', $folder, $filename,$this->isAdmin); 
    11341132         } 
    1135          
    1136          
     1133 
     1134 
    11371135        /** 
    11381136         * Build an array of JavaScript files to combine 
     
    11461144                return $this->includes->includeFile('js', $folder, $filename,$this->isAdmin); 
    11471145         } 
    1148           
    1149           
     1146 
     1147 
    11501148        /** 
    11511149         * Include individual CSS files, not merged into the CSS archive 
     
    11601158                 return $this->includes->includeFileOnce($files, 'css', $folder); 
    11611159         } 
    1162           
    1163           
     1160 
     1161 
    11641162        /** 
    11651163         * Include individual JavaScript files, not merged into the JavaScript archive 
     
    11741172                 return $this->includes->includeFileOnce($files, 'js', $folder); 
    11751173         } 
    1176       
    1177       
     1174 
     1175 
    11781176 /* ************************************************************* 
    11791177 * 
     
    11811179 * 
    11821180 * *********************************************************** */ 
    1183   
    1184   
     1181 
     1182 
    11851183        /** 
    11861184         * Display a SINGLE success or failure message 
     
    11941192                $messages->showMessage($this, $msg, $msg_type); 
    11951193        } 
    1196          
    1197          
     1194 
     1195 
    11981196        /** 
    11991197         * Displays ALL success or failure messages 
     
    12041202                $messages->showMessages($this); 
    12051203        } 
    1206      
    1207      
     1204 
     1205 
    12081206 /* ************************************************************* 
    12091207 * 
     
    12111209 * 
    12121210 * *********************************************************** */ 
    1213   
    1214   
     1211 
     1212 
    12151213        /** 
    12161214         * Displays an announcement at the top of the screen 
     
    12191217         * @return array 
    12201218         */ 
    1221         public function checkAnnouncements($announcement = '')  
     1219        public function checkAnnouncements($announcement = '') 
    12221220        { 
    12231221                $announce = new Announcements(); 
     
    12281226                } 
    12291227        } 
    1230      
    1231      
     1228 
     1229 
    12321230 /* ************************************************************* 
    12331231 * 
     
    12351233 * 
    12361234 * *********************************************************** */ 
    1237   
    1238   
     1235 
     1236 
    12391237        /** 
    12401238         * Shows number of database queries and the time it takes for a page to load 
     
    12441242                Debug::showQueriesAndTime($this); 
    12451243        } 
    1246          
     1244 
    12471245        /** 
    12481246         * Log performance and errors 
     
    12541252                Debug::log($type, $string); 
    12551253        } 
    1256          
     1254 
    12571255        /** 
    12581256         * Generate a system report 
     
    12651263        } 
    12661264 
    1267      
     1265 
    12681266 /* ************************************************************* 
    12691267 * 
     
    12711269 * 
    12721270 * *********************************************************** */ 
    1273   
    1274   
     1271 
     1272 
    12751273        /** 
    12761274         * Includes the SimplePie RSS file and sets the cache 
     
    12871285                return $feeds->newSimplePie($feed, $cache, $cache_duration); 
    12881286        } 
    1289          
    1290          
     1287 
     1288 
    12911289         /** 
    12921290         * Display Hotaru forums feed on Admin front page 
     
    13161314                $feeds->rss($this, $title, $link, $description, $items); 
    13171315        } 
    1318          
    1319          
     1316 
     1317 
    13201318 /* ************************************************************* 
    13211319 * 
     
    13231321 * 
    13241322 * *********************************************************** */ 
    1325   
    1326   
     1323 
     1324 
    13271325         /** 
    13281326         * Admin Pages 
     
    13331331                $admin->pages($this, $page); 
    13341332        } 
    1335          
    1336          
     1333 
     1334 
    13371335         /** 
    13381336         * Admin login/logout 
     
    13451343                return ($action == 'login') ? $admin->adminLogin($this) : $admin->adminLogout($this); 
    13461344        } 
    1347          
    1348          
     1345 
     1346 
    13491347         /** 
    13501348         * Admin login form 
     
    13551353                $admin->adminLoginForm($this); 
    13561354        } 
    1357      
    1358      
     1355 
     1356 
    13591357 /* ************************************************************* 
    13601358 * 
     
    13621360 * 
    13631361 * *********************************************************** */ 
    1364   
    1365   
     1362 
     1363 
    13661364        /** 
    13671365         * Check if site is open or closed. Exit if closed 
     
    13721370        { 
    13731371                if (SITE_OPEN == 'true') { return true; }   // site is open, go back and continue 
    1374                  
     1372 
    13751373                // site closed, but user has admin access so go back and continue as normal 
    13761374                if ($this->currentUser->getPermission('can_access_admin') == 'yes') { return true; } 
    1377                  
     1375 
    13781376                if ($this->pageName == 'admin_login') { return true; } 
    1379                  
     1377 
    13801378                $maintenance = new Maintenance(); 
    13811379                return $maintenance->siteClosed($this, $this->lang); // displays "Site Closed for Maintenance" 
    13821380        } 
    1383          
    1384          
     1381 
     1382 
    13851383        /** 
    13861384         * Open or close the site for maintenance 
     
    13931391                $maintenance->openCloseSite($this, $switch); 
    13941392        } 
    1395          
    1396          
     1393 
     1394 
    13971395        /** 
    13981396         * Optimize all database tables 
     
    14031401                $maintenance->optimizeTables($this); 
    14041402        } 
    1405          
    1406          
     1403 
     1404 
    14071405        /** 
    14081406         * Empty plugin database table 
     
    14161414                $maintenance->emptyTable($this, $table_name, $msg); 
    14171415        } 
    1418          
    1419          
     1416 
     1417 
    14201418        /** 
    14211419         * Delete plugin database table 
     
    14291427                $maintenance->dropTable($this, $table_name, $msg); 
    14301428        } 
    1431          
    1432          
     1429 
     1430 
    14331431        /** 
    14341432         * Remove plugin settings 
     
    14421440                $maintenance->removeSettings($this, $folder, $msg); 
    14431441        } 
    1444          
    1445          
     1442 
     1443 
    14461444        /** 
    14471445         * Deletes rows from pluginsettings that match a given setting or plugin 
     
    14551453                $maintenance->deleteSettings($this, $setting, $folder); 
    14561454        } 
    1457          
    1458          
     1455 
     1456 
    14591457        /** 
    14601458         * Delete all files in the specified directory except placeholder.txt 
     
    14621460         * @param string $dir - path to the cache folder 
    14631461         * @return bool 
    1464          */     
     1462         */ 
    14651463        public function deleteFiles($dir = '') 
    14661464        { 
     
    14681466                return $maintenance->deleteFiles($dir); 
    14691467        } 
    1470          
    1471          
     1468 
     1469 
    14721470        /** 
    14731471         * Calls the delete_files function, then displays a message. 
     
    14811479                return $maintenance->clearCache($this, $folder, $msg); 
    14821480        } 
    1483          
    1484          
     1481 
     1482 
    14851483        /** 
    14861484         * Get all files in the specified directory except placeholder.txt 
     
    14891487         * @param array $exclude - array of file/folder names to exclude 
    14901488         * @return array 
    1491          */     
     1489         */ 
    14921490        public function getFiles($dir = '', $exclude = array()) 
    14931491        { 
     
    14951493                return $maintenance->getFiles($dir, $exclude); 
    14961494        } 
    1497          
    1498          
    1499         /**  
     1495 
     1496 
     1497        /** 
    15001498         * System Report is under Debug Functions 
    15011499         */ 
    1502      
    1503      
     1500 
     1501 
    15041502 /* ************************************************************* 
    15051503 * 
     
    15071505 * 
    15081506 * *********************************************************** */ 
    1509          
    1510          
     1507 
     1508 
    15111509        /** 
    15121510         * Hotaru CMS Smart Caching 
    15131511         * 
    1514          * This function does one query on the database to get the last updated time for a  
     1512         * This function does one query on the database to get the last updated time for a 
    15151513         * specified table. If that time is more recent than the $timeout length (e.g. 10 minutes), 
    1516          * the database will be used. If there hasn't been an update, any cached results from the  
     1514         * the database will be used. If there hasn't been an update, any cached results from the 
    15171515         * last 10 minutes will be used. 
    15181516         * 
     
    15291527                return $caching->smartCache($this, $switch, $table, $timeout, $html_sql, $label); 
    15301528        } 
    1531          
    1532          
     1529 
     1530 
    15331531        /** 
    15341532         * Cache HTML without checking for database updates 
     
    15461544                return $caching->cacheHTML($this, $timeout, $html, $label); 
    15471545        } 
    1548      
    1549      
     1546 
     1547 
    15501548 /* ************************************************************* 
    15511549 * 
     
    15531551 * 
    15541552 * *********************************************************** */ 
    1555   
     1553 
    15561554         /** 
    15571555         * Check if a value is blocked from registration and post submission) 
     
    15671565                return $blocked->isBlocked($this->db, $type, $value, $operator); 
    15681566        } 
    1569          
    1570          
     1567 
     1568 
    15711569         /** 
    1572          * Add or update blocked items  
     1570         * Add or update blocked items 
    15731571         * 
    15741572         * @param string $type - e.g. url, email, ip 
     
    16051603                $language->includeLanguage($this, $folder, $filename); 
    16061604        } 
    1607      
    1608      
     1605 
     1606 
    16091607        /** 
    16101608         * Include a language file for a theme 
     
    16141612         * Note: the language file should be in a plugin folder named 'languages'. 
    16151613         * '_language.php' is appended automatically to the folder of file name. 
    1616          */     
     1614         */ 
    16171615        public function includeThemeLanguage($filename = 'main') 
    16181616        { 
     
    16201618                $language->includeThemeLanguage($this, $filename); 
    16211619        } 
    1622      
    1623      
     1620 
     1621 
    16241622/* ************************************************************* 
    16251623 * 
     
    16421640                return $csrf->csrfInit($this, $type, $script, $life); 
    16431641        } 
    1644      
    1645      
     1642 
     1643 
    16461644/* ************************************************************* 
    16471645 * 
     
    16571655         * @param array $post_row - a post already fetched from the db, just needs reading 
    16581656         * @return bool 
    1659          */     
     1657         */ 
    16601658        public function readPost($post_id = 0, $post_row = NULL) 
    16611659        { 
    16621660                return $this->post->readPost($this, $post_id, $post_row); 
    16631661        } 
    1664          
    1665          
     1662 
     1663 
    16661664        /** 
    16671665         * Gets a single post from the database 
     
    16691667         * @param int $post_id - post id of the post to get 
    16701668         * @return array|false 
    1671          */     
     1669         */ 
    16721670        public function getPost($post_id = 0) 
    16731671        { 
    16741672                return $this->post->getPost($this, $post_id); 
    16751673        } 
    1676          
    1677          
     1674 
     1675 
    16781676        /** 
    16791677         * Add a post to the database 
     
    16851683                return $this->post->addPost($this); 
    16861684        } 
    1687          
    1688          
     1685 
     1686 
    16891687        /** 
    16901688         * Update a post in the database 
    16911689         * 
    16921690         * @return true 
    1693          */     
     1691         */ 
    16941692        public function updatePost() 
    16951693        { 
    16961694                $this->post->updatePost($this); 
    16971695        } 
    1698          
    1699          
    1700         /** 
    1701          * Physically delete a post from the database  
     1696 
     1697 
     1698        /** 
     1699         * Physically delete a post from the database 
    17021700         * 
    17031701         * There's a plugin hook in here to delete their parts, e.g. votes, coments, tags, etc. 
    1704          */     
     1702         */ 
    17051703        public function deletePost() 
    17061704        { 
    17071705                $this->post->deletePost($this); 
    17081706        } 
    1709          
    1710          
     1707 
     1708 
    17111709        /** 
    17121710         * Physically delete all posts by a specified user 
     
    17151713         * @return bool 
    17161714         */ 
    1717         public function deletePosts($user_id = 0)  
     1715        public function deletePosts($user_id = 0) 
    17181716        { 
    17191717                return $this->post->deletePosts($this, $user_id); 
    17201718        } 
    1721          
    1722          
     1719 
     1720 
    17231721        /** 
    17241722         * Delete posts with "processing" status that are older than 30 minutes 
     
    17291727                $this->post->deleteProcessingPosts($this); 
    17301728        } 
    1731          
    1732          
     1729 
     1730 
    17331731        /** 
    17341732         * Update a post's status 
     
    17371735         * @param int $post_id (optional) 
    17381736         * @return true 
    1739          */     
     1737         */ 
    17401738        public function changePostStatus($status = "processing", $post_id = 0) 
    17411739        { 
    17421740                return $this->post->changePostStatus($this, $status, $post_id); 
    17431741        } 
    1744          
    1745          
     1742 
     1743 
    17461744        /** 
    17471745         * Count how many approved posts a user has had 
     
    17491747         * @param int $userid (optional) 
    17501748         * @param int $post_type (optional) 
    1751          * @return int  
     1749         * @return int 
    17521750         */ 
    17531751        public function postsApproved($userid = 0, $post_type = 'news') 
     
    17551753                return $this->post->postsApproved($this, $userid, $post_type); 
    17561754        } 
    1757          
    1758          
     1755 
     1756 
    17591757        /** 
    17601758         * Count posts in the last X hours/minutes for this user 
     
    17641762         * @param int $user_id (optional) 
    17651763         * @param int $post_type (optional) 
    1766          * @return int  
     1764         * @return int 
    17671765         */ 
    17681766        public function countPosts($hours = 0, $minutes = 0, $user_id = 0, $post_type = 'news') 
     
    17701768                return $this->post->countPosts($this, $hours, $minutes, $user_id, $post_type); 
    17711769        } 
    1772          
    1773          
     1770 
     1771 
    17741772        /** 
    17751773         * Checks for existence of a url 
    17761774         * 
    17771775         * @return array|false - array containing existing post 
    1778          */     
     1776         */ 
    17791777        public function urlExists($url = '') 
    17801778        { 
    17811779                return $this->post->urlExists($this, $url); 
    17821780        } 
    1783          
    1784          
     1781 
     1782 
    17851783        /** 
    17861784         * Checks for existence of a title 
     
    17931791                return $this->post->titleExists($this, $title); 
    17941792        } 
    1795          
    1796          
     1793 
     1794 
    17971795        /** 
    17981796         * Checks for existence of a post with given post_url 
     
    18051803                return $this->post->isPostUrl($this, $post_url); 
    18061804        } 
    1807          
    1808          
     1805 
     1806 
    18091807        /** 
    18101808         * Get Unique Post Statuses 
     
    18121810         * @return array|false 
    18131811         */ 
    1814         public function getUniqueStatuses()  
     1812        public function getUniqueStatuses() 
    18151813        { 
    18161814                return $this->post->getUniqueStatuses($this); 
    18171815        } 
    1818          
    1819          
     1816 
     1817 
    18201818        /** 
    18211819         * Prepares and calls functions to send a trackback 
     
    18271825                return $trackback->sendTrackback($this); 
    18281826        } 
    1829      
    1830      
     1827 
     1828 
    18311829/* ************************************************************* 
    18321830 * 
     
    18341832 * 
    18351833 * *********************************************************** */ 
    1836   
     1834 
    18371835 
    18381836        /** 
     
    18481846                return $this->avatar = new Avatar($this, $user_id, $size, $rating); 
    18491847        } 
    1850          
    1851          
     1848 
     1849 
    18521850        /** 
    18531851         * get the plain avatar with no surrounding HTML div 
     
    18591857                return $this->avatar->getAvatar($this); 
    18601858        } 
    1861          
    1862          
     1859 
     1860 
    18631861        /** 
    18641862         * option to display the avatar linked to ther user's profile 
     
    18701868                return $this->avatar->linkAvatar($this); 
    18711869        } 
    1872          
    1873          
     1870 
     1871 
    18741872        /** 
    18751873         * option to display the profile-linked avatar wrapped in a div 
     
    18811879                return $this->avatar->wrapAvatar($this); 
    18821880        } 
    1883      
    1884      
     1881 
     1882 
    18851883/* ************************************************************* 
    18861884 * 
     
    19001898                return $category->getCatId($this, $cat_safe_name); 
    19011899        } 
    1902          
    1903          
     1900 
     1901 
    19041902        /** 
    19051903         * Returns the category name for a given category id or safe name. 
     
    19141912                return $category->getCatName($this, $cat_id, $cat_safe_name); 
    19151913        } 
    1916          
    1917          
    1918         /** 
    1919          * Returns the category safe name for a given category id  
     1914 
     1915 
     1916        /** 
     1917         * Returns the category safe name for a given category id 
    19201918         * 
    19211919         * @param int $cat_id 
     
    19271925                return $category->getCatSafeName($this, $cat_id); 
    19281926        } 
    1929          
    1930          
     1927 
     1928 
    19311929        /** 
    19321930         * Returns parent id 
     
    19401938                return $category->getCatParent($this, $cat_id); 
    19411939        } 
    1942          
    1943          
     1940 
     1941 
    19441942        /** 
    19451943         * Returns child ids 
     
    19531951                return $category->getCatChildren($this, $cat_parent_id); 
    19541952        } 
    1955          
     1953 
    19561954         /** 
    19571955         * Returns Category list ids 
     
    19651963                return $category->getCategories($this, $args); 
    19661964        } 
    1967          
    1968          
     1965 
     1966 
    19691967        /** 
    19701968         * Returns meta description and keywords for the category (if available) 
     
    20392037                return $comment->countComments($this, $digits_only, $no_comments_text); 
    20402038        } 
    2041          
    2042          
     2039 
     2040 
    20432041        /** 
    20442042         * Count all user comments 
     
    20522050                return $comment->countUserComments($this, $user_id); 
    20532051        } 
    2054          
    2055          
     2052 
     2053 
    20562054        /** 
    20572055         * Physically delete all comments by a specified user (and responses) 
     
    20602058         * @return bool 
    20612059         */ 
    2062         public function deleteComments($user_id)  
     2060        public function deleteComments($user_id) 
    20632061        { 
    20642062                $comment = new Comment(); 
    20652063                return $comment->deleteComments($this, $user_id); 
    20662064        } 
    2067          
    2068          
     2065 
     2066 
    20692067        /** 
    20702068         * Get comment from database 
     
    20782076                return $comment->getComment($this, $comment_id); 
    20792077        } 
    2080          
    2081          
     2078 
     2079 
    20822080        /** 
    20832081         * Read comment 
     
    20902088                return $comment->readComment($this, $comment_row); 
    20912089        } 
    2092      
    2093      
     2090 
     2091 
    20942092/* ************************************************************* 
    20952093 * 
     
    21102108                $widget->addWidget($this, $plugin, $function, $args); 
    21112109        } 
    2112          
     2110 
    21132111 
    21142112        /** 
    21152113         * Get widgets from widgets_settings array 
    21162114         * 
    2117          * USAGE: foreach ($widgets as $widget=>$details)  
    2118          * { echo "Name: " . $widget; echo $details['order']; echo $details['args']; }  
    2119          *  
     2115         * USAGE: foreach ($widgets as $widget=>$details) 
     2116         * { echo "Name: " . $widget; echo $details['order']; echo $details['args']; } 
     2117         * 
    21202118         * @param $widget_name - optional for a single widget 
    21212119         * @return array - of widgets 
     
    21262124                return $widget->getArrayWidgets($this, $widget_name); 
    21272125        } 
    2128          
    2129          
     2126 
     2127 
    21302128        /** 
    21312129         * Delete a widget from the widget db table 
     
    21392137                $widget->deleteWidget($this, $function, $plugin); 
    21402138        } 
    2141          
    2142          
     2139 
     2140 
    21432141        /** 
    21442142         * Get plugin name from widget function name 
     
    21512149                return $widget->getPluginFromFunction($this, $function); 
    21522150        } 
    2153      
    2154      
     2151 
     2152 
    21552153/* ************************************************************* 
    21562154 * 
     
    21582156 * 
    21592157 * *********************************************************** */ 
    2160   
     2158 
    21612159        /** 
    21622160         * Send emails 
     
    21732171                return EmailFunctions::email($to, $subject, $body, $from, $headers); 
    21742172        } 
    2175          
    2176          
     2173 
     2174 
    21772175/* ************************************************************* 
    21782176 * 
     
    21922190                return $friends->countFriends($this, $user_id, 'follower'); 
    21932191        } 
    2194          
    2195          
     2192 
     2193 
    21962194        /** 
    21972195         * count following 
     
    22052203                return $friends->countFriends($this, $user_id, 'following'); 
    22062204        } 
    2207          
    2208          
     2205 
     2206 
    22092207        /** 
    22102208         * get followers 
     
    22192217                return $friends->getFriends($this, $user_id, 'follower', $return); 
    22202218        } 
    2221          
    2222          
     2219 
     2220 
    22232221        /** 
    22242222         * get people this user is following 
     
    22332231                return $friends->getFriends($this, $user_id, 'following', $return); 
    22342232        } 
    2235          
    2236          
     2233 
     2234 
    22372235        /** 
    22382236         * Is current user being followed by user X? 
     
    22462244                return $friends->checkFriends($this, $user_id, 'follower'); 
    22472245        } 
    2248          
    2249          
     2246 
     2247 
    22502248        /** 
    22512249         * Is current user following user X? 
     
    22592257                return $friends->checkFriends($this, $user_id, 'following'); 
    22602258        } 
    2261          
    2262          
     2259 
     2260 
    22632261        /** 
    22642262         * Follow / become a fan of user X 
     
    22722270                return $friends->updateFriends($this, $user_id, 'follow'); 
    22732271        } 
    2274          
    2275          
     2272 
     2273 
    22762274        /** 
    22772275         * Unfollow / stop being a fan of user X 
     
    22852283                return $friends->updateFriends($this, $user_id, 'unfollow'); 
    22862284        } 
    2287          
    2288          
     2285 
     2286 
    22892287 /* ************************************************************* 
    22902288 * 
     
    22922290 * 
    22932291 * *********************************************************** */ 
    2294   
    2295   
     2292 
     2293 
    22962294        /** 
    22972295         * Get the latest site activity 
     
    23072305                return $activity->getLatestActivity($this, $limit, $userid, $type); 
    23082306        } 
    2309          
    2310          
     2307 
     2308 
    23112309        /** 
    23122310         * Check if an action already exists 
     
    23202318                return $activity->activityExists($this, $args); 
    23212319        } 
    2322          
    2323          
     2320 
     2321 
    23242322        /** 
    23252323         * Insert new activity 
     
    23322330                return $activity->insertActivity($this, $args); 
    23332331        } 
    2334          
    2335          
     2332 
     2333 
    23362334        /** 
    23372335         * Update activity 
     
    23442342                return $activity->updateActivity($this, $args); 
    23452343        } 
    2346          
    2347          
     2344 
     2345 
    23482346        /** 
    23492347         * Remove activity 
     
    23562354                return $activity->removeActivity($this, $args); 
    23572355        } 
    2358          
    2359          
     2356 
     2357 
    23602358 /* ************************************************************* 
    23612359 * 
     
    23632361 * 
    23642362 * *********************************************************** */ 
    2365   
     2363 
    23662364 
    23672365        /** 
     
    23772375                return $pm->getMessages($this, $box, $type); 
    23782376        } 
    2379          
    2380          
     2377 
     2378 
    23812379        /** 
    23822380         * Get Message 
     
    23902388                return $pm->getMessage($this, $message_id); 
    23912389        } 
    2392           
    2393           
     2390 
     2391 
    23942392        /** 
    23952393         * Mark message as read 
     
    24022400                $pm->markRead($this, $message_id); 
    24032401        } 
    2404          
    2405          
     2402 
     2403 
    24062404        /** 
    24072405         * Delete Message 
     
    24162414                $pm->deleteMessage($this, $message_id, $box); 
    24172415        } 
    2418          
    2419          
     2416 
     2417 
    24202418        /** 
    24212419         * Send Message 
     
    24392437 * 
    24402438 * *********************************************************** */ 
    2441   
    2442  
    2443         /** 
    2444          * Get Individual Vote Rating  
     2439 
     2440 
     2441        /** 
     2442         * Get Individual Vote Rating 
    24452443         * 
    24462444         * @param int $post_id