Changeset 2973

Show
Ignore:
Timestamp:
01/12/09 00:42:11 (6 months ago)
Author:
michaeltwofish
Message:

Standardising documentation so that doxygen generates documentation. It still misses a couple of files, not sure why, and produces some warnings we might want to look at fixing. Also, lots of changes to bring the code in line with the coding standard.

Location:
trunk/htdocs/system/classes
Files:
87 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/acl.php

    r2864 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    1216 * grants that permission. 
    1317 * 
    14  * @package Habari 
    1518 **/ 
    16  
    1719class ACL { 
    1820    /** 
  • trunk/htdocs/system/classes/actionhandler.php

    r2873 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    59 * extend this class for the Controller to call their actions. 
    610 * 
    7  * @package Habari 
    811 */ 
    912class ActionHandler 
  • trunk/htdocs/system/classes/adminhandler.php

    r2968 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari AdminHandler Class 
    49 * Backbone of the admin area, handles requests and functionality. 
    510 * 
    6  * @package Habari 
    711 * @todo Clean this mess up 
    812 */ 
    9  
    1013class AdminHandler extends ActionHandler 
    1114{ 
  • trunk/htdocs/system/classes/ajaxhandler.php

    r2862 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Handles Ajax requests, sending them to plugin sinks. 
    59 * 
    6  * @package Habari 
    710 */ 
    8  
    911class AjaxHandler extends ActionHandler 
    1012{ 
  • trunk/htdocs/system/classes/apccache.php

    r2592 r2973  
    11<?php 
    2  
    32/** 
    43 * @package Habari 
    54 * 
     5 */ 
     6 
     7/** 
     8 * 
    69 * Contains the APCCache class 
    710 */ 
    8  
    911class APCCache extends Cache 
    1012{ 
  • trunk/htdocs/system/classes/atomhandler.php

    r2948 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38    * Habari AtomHandler class 
    49    * Produces Atom feeds and accepts Atom Publishing Protocol input 
    510    * 
    6     * @package Habari 
    711    * @todo Apply system error handling 
    812    */ 
    9  
    1013class AtomHandler extends ActionHandler 
    1114{ 
  • trunk/htdocs/system/classes/bitmask.php

    r2864 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Class to wrap around bitmap field functionality 
  • trunk/htdocs/system/classes/cache.php

    r2078 r2973  
    33 * @package Habari 
    44 * 
    5  * Contains the abstract Cache class. 
    65 */ 
    76 
     
    98 * Habari Cache Class 
    109 * 
    11  * Base class for caching computationally expensive or bandwidth intensive data 
     10 * Base abstract class for caching computationally expensive or bandwidth intensive data 
    1211 */ 
    1312abstract class Cache 
  • trunk/htdocs/system/classes/colorutils.php

    r2592 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
  • trunk/htdocs/system/classes/comment.php

    r2862 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Habari CommentRecord Class 
    5  * 
    6  * @package Habari 
    79 * 
    810 * Includes an instance of the CommentInfo class; for holding inforecords about the comment 
     
    302304    { 
    303305        if ( is_numeric( $value ) ) { 
    304             $this->newfields['status']= $value; 
     306            $this->newfields['status'] = $value; 
    305307        } 
    306308        else { 
     
    310312                case "approve": 
    311313                case "ham": 
    312                     $this->newfields['status']= self::STATUS_APPROVED; 
     314                    $this->newfields['status'] = self::STATUS_APPROVED; 
    313315                    break; 
    314316                case "unapproved": 
    315317                case "unapprove": 
    316                     $this->newfields['status']= self::STATUS_UNAPPROVED; 
     318                    $this->newfields['status'] = self::STATUS_UNAPPROVED; 
    317319                    break; 
    318320                case "spam": 
    319                     $this->newfields['status']= self::STATUS_SPAM; 
     321                    $this->newfields['status'] = self::STATUS_SPAM; 
    320322                    break; 
    321323                case "deleted": 
    322                     $this->newfields['status']= self::STATUS_DELETED; 
     324                    $this->newfields['status'] = self::STATUS_DELETED; 
    323325                    break; 
    324326            } 
  • trunk/htdocs/system/classes/commentinfo.php

    r1283 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
     7/** 
     8 * Comment metadata 
     9 */ 
    310class CommentInfo extends InfoRecords { 
    411 
  • trunk/htdocs/system/classes/comments.php

    r2826 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari Comments Class 
    49 * 
    5  * @package Habari 
    610 */ 
    7  
    811class Comments extends ArrayObject 
    912{ 
     
    9396                    } 
    9497                    else { 
    95                         $where[]= "type= ?"; 
    96                         $params[]= Comment::type( $paramset['type'] ); 
     98                        $where[] = "type= ?"; 
     99                        $params[] = Comment::type( $paramset['type'] ); 
    97100                    } 
    98101                } 
     
    119122                /* do searching */ 
    120123                if ( isset( $paramset['post_author'] ) ) { 
    121                     $joins['posts']= ' INNER JOIN {posts} ON {comments}.post_id = {posts}.id'; 
     124                    $joins['posts'] = ' INNER JOIN {posts} ON {comments}.post_id = {posts}.id'; 
    122125                    if ( is_array( $paramset['post_author'] ) ) { 
    123126                        $where[] = "{posts}.user_id IN (" . implode( ',', array_fill( 0, count( $paramset['post_author'] ), '?' ) ) . ")"; 
     
    133136                        // Support 'criteria_fields' => 'author,ip' rather than 'criteria_fields' => array( 'author', 'ip' ) 
    134137                        if ( !is_array( $paramset['criteria_fields'] ) && is_string( $paramset['criteria_fields'] ) ) { 
    135                             $paramset['criteria_fields']= explode( ',', $paramset['criteria_fields'] ); 
     138                            $paramset['criteria_fields'] = explode( ',', $paramset['criteria_fields'] ); 
    136139                        } 
    137140                    } 
     
    169172                    $params[] = $startDate->sql; 
    170173                    $params[] = $startDate->modify( '+1 day' )->sql; 
    171                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
    172                     //$params[]= date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
     174                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
     175                    //$params[] = date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
    173176                } 
    174177                elseif ( isset( $paramset['month'] ) ) { 
     
    178181                    $params[] = $startDate->sql; 
    179182                    $params[] = $startDate->modify( '+1 month' )->sql; 
    180                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], 1, $paramset['year'] ) ); 
    181                     //$params[]= date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'] + 1, 0, $paramset['year'] ) ); 
     183                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], 1, $paramset['year'] ) ); 
     184                    //$params[] = date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'] + 1, 0, $paramset['year'] ) ); 
    182185                } 
    183186                elseif ( isset( $paramset['year'] ) ) { 
     
    187190                    $params[] = $startDate->sql; 
    188191                    $params[] = $startDate->modify( '+1 year' )->sql; 
    189                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, 0, 1, 1, $paramset['year'] ) ); 
    190                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, -1, 1, 1, $paramset['year'] + 1 ) ); 
     192                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, 1, 1, $paramset['year'] ) ); 
     193                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, -1, 1, 1, $paramset['year'] + 1 ) ); 
    191194                } 
    192195 
     
    561564        $params = array( 'email' => $email, 'count' => 'email'); 
    562565        if ( FALSE !== $status ) { 
    563             $params['status']= $status; 
     566            $params['status'] = $status; 
    564567        } 
    565568        return self::get( $params ); 
     
    577580        $params = array( 'url' => $url, 'count' => 'url'); 
    578581        if ( FALSE !== $status ) { 
    579             $params['status']= $status; 
     582            $params['status'] = $status; 
    580583        } 
    581584        return self::get( $params ); 
     
    608611        $params = array( 'post_slug' => $slug, 'count' => 'id'); 
    609612        if ( FALSE !== $status ) { 
    610             $params['status']= $status; 
     613            $params['status'] = $status; 
    611614        } 
    612615        return self::get( $params ); 
     
    624627        $params = array( 'post_id' => $id, 'count' => 'id' ); 
    625628        if ( FALSE !== $status ) { 
    626             $params['status']= $status; 
     629            $params['status'] = $status; 
    627630        } 
    628631        return self::get( $params ); 
  • trunk/htdocs/system/classes/controller.php

    r2851 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Class which handles incoming requests and drives the 
     
    510 * a view. 
    611 * 
    7  * @package Habari 
    812 */ 
    913class Controller extends Singleton { 
     
    135139        $controller->handler = new $matched_rule->handler(); 
    136140        /* Insert the regexed submatches as the named parameters */ 
    137         $controller->handler->handler_vars['entire_match']= $matched_rule->entire_match; // The entire matched string is returned at index 0 
     141        $controller->handler->handler_vars['entire_match'] = $matched_rule->entire_match; // The entire matched string is returned at index 0 
    138142        foreach ($matched_rule->named_arg_values as $named_arg_key=>$named_arg_value) { 
    139             $controller->handler->handler_vars[$named_arg_key]= $named_arg_value; 
     143            $controller->handler->handler_vars[$named_arg_key] = $named_arg_value; 
    140144        } 
    141145 
  • trunk/htdocs/system/classes/cronjob.php

    r2606 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * CronJob is a single cron task 
    59 * 
    6  * @package Habari 
    7  *  
    810 * @property string $name The name of the cron job. 
    911 * @property mixed $callback The callback function or plugin action for the cron job to execute. 
     
    2729    /** 
    2830     * The internally stored execution time of this cronjob. (unix timestamp) 
    29      *  
     31     * 
    3032     * @var int 
    3133     */ 
     
    3537    /** 
    3638     * Returns the defined database columns for a cronjob. 
    37      *  
     39     * 
    3840     * @return array Array of default columns in the crontab table 
    3941     */ 
     
    5860    /** 
    5961     * Constructor for the CronJob class. 
    60      *  
     62     * 
    6163     * @see QueryRecord::__construct() 
    6264     * @param array $paramarray an associative array or querystring of initial field values 
     
    135137     * Magic property setter to set the cronjob properties. 
    136138     * Serializes the callback if needed. 
    137      *  
     139     * 
    138140     * @see QueryRecord::__set() 
    139141     * @param string $name The name of the property to set. 
     
    164166     * Magic property getter to get the cronjob properties. 
    165167     * Unserializes the callback if called. 
    166      *  
     168     * 
    167169     * @see QueryRecord::__get() 
    168170     * @param string $name The name of the property to get. 
     
    182184    /** 
    183185     * Saves a new cron job to the crontab table. 
    184      *  
     186     * 
    185187     * @see QueryRecord::insertRecord() 
    186188     * @return CronJob The newly inserted cron job, or false if failed. 
     
    193195    /** 
    194196     * Updates an existing cron job to the crontab table. 
    195      *  
     197     * 
    196198     * @see QueryRecord::updateRecord() 
    197199     * @return CronJob The updated cron job, or false if failed. 
     
    204206    /** 
    205207     * Deletes an existing cron job. 
    206      *  
     208     * 
    207209     * @see QueryRecord::deleteRecord() 
    208210     * @return bool If the delete was successful 
  • trunk/htdocs/system/classes/crontab.php

    r2915 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Static class to build and read cron entries 
    59 * 
    6  * @package Habari 
    710 */ 
    8  
    911class CronTab extends ActionHandler 
    1012{ 
  • trunk/htdocs/system/classes/curlrequestprocessor.php

    r2592 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    3337        $merged_headers = array(); 
    3438        foreach ( $headers as $k => $v ) { 
    35             $merged_headers[]= $k . ': ' . $v; 
     39            $merged_headers[] = $k . ': ' . $v; 
    3640        } 
    3741         
  • trunk/htdocs/system/classes/databaseconnection.php

    r2807 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Habari DatabaseConnection Class 
    59 * 
    6  * @package Habari 
     10 * Actual database connection. 
    711 */ 
    8  
    9  
    1012class DatabaseConnection 
    1113{ 
    1214    private $fetch_mode = PDO::FETCH_CLASS;          // PDO Fetch mode 
    13     private $fetch_class_name = 'QueryRecord';      // The default class name for fetching classes 
    14     private $driver;                                // PDO driver name 
     15    private $fetch_class_name = 'QueryRecord';       // The default class name for fetching classes 
     16    private $driver;                                 // PDO driver name 
    1517    private $keep_profile = DEBUG;                   // keep profiling and timing information? 
    16     protected $pdo = NULL;                             // handle to the PDO interface 
     18    protected $pdo = NULL;                           // handle to the PDO interface 
    1719    private $pdo_statement = NULL;                   // handle for a PDOStatement 
    18     private $pdo_transaction = FALSE;                   // handle for transaction status 
     20    private $pdo_transaction = FALSE;                // handle for transaction status 
    1921 
    2022    /** 
     
    5759    private $sql_tables_repl = array(); 
    5860    private $errors = array();                       // an array of errors related to queries 
    59     private $profiles = array();                        // an array of query profiles 
    60  
    61     protected $prefix = '';                             // class protected storage of the database table prefix, defaults to '' 
     61    private $profiles = array();                     // an array of query profiles 
     62 
     63    protected $prefix = '';                          // class protected storage of the database table prefix, defaults to '' 
    6264    private $current_table; 
    6365 
     
    8587        if ( isset ( $GLOBALS['db_connection']['prefix'] ) ) { 
    8688            $prefix = $GLOBALS['db_connection']['prefix']; 
    87         } else if ( isset( $_POST['table_prefix'] ) ) { 
     89        } 
     90        else if ( isset( $_POST['table_prefix'] ) ) { 
    8891            $prefix = $_POST['table_prefix']; 
    89         } else { 
     92        } 
     93        else { 
    9094            $prefix = $this->prefix; 
    9195        } 
     
    9498        // build the mapping with prefixes 
    9599        foreach ( $this->tables as $t ) { 
    96             $this->sql_tables[$t]= $prefix . $t; 
    97             $this->sql_tables_repl[$t]= '{' . $t . '}'; 
     100            $this->sql_tables[$t] = $prefix . $t; 
     101            $this->sql_tables_repl[$t] = '{' . $t . '}'; 
    98102        } 
    99103    } 
     
    172176    public function register_table( $name ) 
    173177    { 
    174         $this->tables[]= $name; 
     178        $this->tables[] = $name; 
    175179        $this->load_tables(); 
    176180    } 
     
    272276            if ( $this->keep_profile ) { 
    273277                $profile->stop(); 
    274                 $this->profiles[]= $profile; 
     278                $this->profiles[] = $profile; 
    275279            } 
    276280            return true; 
     
    327331            if ( $this->keep_profile ) { 
    328332                $profile->stop(); 
    329                 $this->profiles[]= $profile; 
     333                $this->profiles[] = $profile; 
    330334            } 
    331335            return true; 
     
    389393        $backtrace = array(); 
    390394        foreach($backtrace1 as $trace) { 
    391             $backtrace[]= array_intersect_key( $trace, array('file'=>1, 'line'=>1, 'function'=>1, 'class'=>1) ); 
    392         } 
    393         $this->errors[]= array_merge($error, array('backtrace'=> $backtrace)) ; 
     395            $backtrace[] = array_intersect_key( $trace, array('file'=>1, 'line'=>1, 'function'=>1, 'class'=>1) ); 
     396        } 
     397        $this->errors[] = array_merge($error, array('backtrace'=> $backtrace)) ; 
    394398    } 
    395399 
     
    562566            $query.= $comma . $field; 
    563567            $comma = ', '; 
    564             $values[]= $value; 
     568            $values[] = $value; 
    565569        } 
    566570        $query.= ' ) VALUES ( ' . trim( str_repeat( '?,', count( $fieldvalues ) ), ',' ) . ' );'; 
     
    586590        foreach( $keyfieldvalues as $keyfield => $keyvalue ) { 
    587591            $qry.= " AND {$keyfield}= ? "; 
    588             $values[]= $keyvalue; 
     592            $values[] = $keyvalue; 
    589593        } 
    590594        $result = $this->get_row( $qry, $values ); 
     
    610614        foreach( $keyfields as $keyfield => $keyvalue ) { 
    611615            if( is_numeric( $keyfield ) ) { 
    612                 $keyfieldvalues[$keyvalue]= $fieldvalues[$keyvalue]; 
     616                $keyfieldvalues[$keyvalue] = $fieldvalues[$keyvalue]; 
    613617            } 
    614618            else { 
    615                 $keyfieldvalues[$keyfield]= $keyvalue; 
     619                $keyfieldvalues[$keyfield] = $keyvalue; 
    616620            } 
    617621        } 
     
    622626            foreach( $fieldvalues as $fieldname => $fieldvalue ) { 
    623627                $qry.= $comma . " {$fieldname}= ?"; 
    624                 $values[]= $fieldvalue; 
     628                $values[] = $fieldvalue; 
    625629                $comma = ' ,'; 
    626630            } 
     
    629633            foreach( $keyfields as $keyfield => $keyvalue ) { 
    630634                $qry.= "AND {$keyfield}= ? "; 
    631                 $values[]= $keyvalue; 
     635                $values[] = $keyvalue; 
    632636            } 
    633637            return $this->query( $qry, $values ); 
     
    653657        foreach ( $keyfields as $keyfield => $keyvalue ) { 
    654658            $qry.= "AND {$keyfield}= ? "; 
    655             $values[]= $keyvalue; 
     659            $values[] = $keyvalue; 
    656660        } 
    657661 
  • trunk/htdocs/system/classes/db.php

    r2592 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Habari DB Class 
    59 * 
    6  * @package Habari 
     10 * Singleton class for database connection and manipulation 
     11 * 
    712 */ 
    8  
    913class DB extends Singleton 
    1014{ 
     
    378382 
    379383    /** 
    380      * Automatic datbase diffing function, used for determining required database upgrades. 
     384     * Automatic database diffing function, used for determining required database upgrades. 
    381385     * 
    382386     * @param queries array of create table and insert statements which constitute a fresh install 
  • trunk/htdocs/system/classes/error.php

    r2734 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Contains error-related functions and Habari's error handler. 
    59 * 
    6  * @package Habari 
    710 **/ 
    811class Error extends Exception 
     
    168171 
    169172            if ( strpos( $a['file'], HABARI_PATH ) === 0 ) { 
    170                 $a['file']= substr( $a['file'], strlen( HABARI_PATH ) + 1 ); 
     173                $a['file'] = substr( $a['file'], strlen( HABARI_PATH ) + 1 ); 
    171174            } 
    172175 
     
    174177                $args = array(); 
    175178                foreach ( $a['args'] as $arg ) { 
    176                     $args[]= htmlentities( str_replace( 
     179                    $args[] = htmlentities( str_replace( 
    177180                        array( "\n", "\r" ), 
    178181                        array( "\n   ", '' ), 
  • trunk/htdocs/system/classes/eventlog.php

    r2935 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari EventLog class 
    49 * 
    5  * @package Habari 
    610 * @todo Apply system error handling 
    711 */ 
    8  
    912class EventLog extends ArrayObject 
    1013{ 
     
    161164        $join = ''; 
    162165        if ( isset( $paramarray['where'] ) && is_string( $paramarray['where'] ) ) { 
    163             $wheres[]= $paramarray['where']; 
     166            $wheres[] = $paramarray['where']; 
    164167        } 
    165168        else { 
     
    170173 
    171174                if ( isset( $paramset['id'] ) && is_numeric( $paramset['id'] ) ) { 
    172                     $where[]= "id= ?"; 
    173                     $params[]= $paramset['id']; 
     175                    $where[] = "id= ?"; 
     176                    $params[] = $paramset['id']; 
    174177                } 
    175178                if ( isset( $paramset['user_id'] ) ) { 
    176                     $where[]= "user_id= ?"; 
    177                     $params[]= $paramset['user_id']; 
     179                    $where[] = "user_id= ?"; 
     180                    $params[] = $paramset['user_id']; 
    178181                } 
    179182                if ( isset( $paramset['severity'] ) && ( 'any' != LogEntry::severity_name( $paramset['severity'] ) ) ) { 
    180                     $where[]= "severity_id= ?"; 
    181                     $params[]= LogEntry::severity( $paramset['severity'] ); 
     183                    $where[] = "severity_id= ?"; 
     184                    $params[] = LogEntry::severity( $paramset['severity'] ); 
    182185                } 
    183186                if ( isset( $paramset['type_id'] ) ) { 
     
    185188                        $types = array_filter( $paramset['type_id'], 'is_numeric' ); 
    186189                        if ( count( $types ) ) { 
    187                             $where[]= 'type_id IN (' . implode( ',', $types ) . ')'; 
     190                            $where[] = 'type_id IN (' . implode( ',', $types ) . ')'; 
    188191                        } 
    189192                    } 
    190193                    else { 
    191                         $where[]= 'type_id = ?'; 
    192                         $params[]= $paramset['type_id']; 
     194                        $where[] = 'type_id = ?'; 
     195                        $params[] = $paramset['type_id']; 
    193196                    } 
    194197                } 
    195198                if ( isset( $paramset['ip'] ) ) { 
    196                     $where[]= 'ip = ?'; 
    197                     $params[]= $paramset['ip']; 
     199                    $where[] = 'ip = ?'; 
     200                    $params[] = $paramset['ip']; 
    198201                } 
    199202 
     
    202205                    preg_match_all( '/(?<=")(\\w[^"]*)(?=")|(\\w+)/', $paramset['criteria'], $matches ); 
    203206                    foreach ( $matches[0] as $word ) { 
    204                         $where[].= "(message LIKE CONCAT('%',?,'%'))"; 
    205                         $params[]= $word; 
     207                        $where[] .= "(message LIKE CONCAT('%',?,'%'))"; 
     208                        $params[] = $word; 
    206209                    } 
    207210                } 
     
    217220                 */ 
    218221                if ( isset( $paramset['day'] ) ) { 
    219                     $where[]= 'timestamp BETWEEN ? AND ?'; 
     222                    $where[] = 'timestamp BETWEEN ? AND ?'; 
    220223                    $startDate = sprintf( '%d-%02d-%02d', $paramset['year'], $paramset['month'], $paramset['day'] ); 
    221224                    $startDate = HabariDateTime::date_create( $startDate ); 
    222                     $params[]= $startDate->sql; 
    223                     $params[]= $startDate->modify( '+1 day' )->sql; 
    224                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
    225                     //$params[]= date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
     225                    $params[] = $startDate->sql; 
     226                    $params[] = $startDate->modify( '+1 day' )->sql; 
     227                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
     228                    //$params[] = date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'], $paramset['day'], $paramset['year'] ) ); 
    226229                } 
    227230                elseif ( isset( $paramset['month'] ) ) { 
    228                     $where[]= 'timestamp BETWEEN ? AND ?'; 
     231                    $where[] = 'timestamp BETWEEN ? AND ?'; 
    229232                    $startDate = sprintf( '%d-%02d-%02d', $paramset['year'], $paramset['month'], 1 ); 
    230233                    $startDate = HabariDateTime::date_create( $startDate ); 
    231                     $params[]= $startDate->sql; 
    232                     $params[]= $startDate->modify( '+1 month' )->sql; 
    233                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], 1, $paramset['year'] ) ); 
    234                     //$params[]= date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'] + 1, 0, $paramset['year'] ) ); 
     234                    $params[] = $startDate->sql; 
     235                    $params[] = $startDate->modify( '+1 month' )->sql; 
     236                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $paramset['month'], 1, $paramset['year'] ) ); 
     237                    //$params[] = date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $paramset['month'] + 1, 0, $paramset['year'] ) ); 
    235238                } 
    236239                elseif ( isset( $paramset['year'] ) ) { 
    237                     $where[]= 'timestamp BETWEEN ? AND ?'; 
     240                    $where[] = 'timestamp BETWEEN ? AND ?'; 
    238241                    $startDate = sprintf( '%d-%02d-%02d', $paramset['year'], 1, 1 ); 
    239242                    $startDate = HabariDateTime::date_create( $startDate ); 
    240                     $params[]= $startDate->sql; 
    241                     $params[]= $startDate->modify( '+1 year' )->sql; 
    242                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, 0, 1, 1, $paramset['year'] ) ); 
    243                     //$params[]= date( 'Y-m-d H:i:s', mktime( 0, 0, -1, 1, 1, $paramset['year'] + 1 ) ); 
    244                 } 
    245  
    246                 $wheres[]= ' (' . implode( ' AND ', $where ) . ') '; 
     243                    $params[] = $startDate->sql; 
     244                    $params[] = $startDate->modify( '+1 year' )->sql; 
     245                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, 1, 1, $paramset['year'] ) ); 
     246                    //$params[] = date( 'Y-m-d H:i:s', mktime( 0, 0, -1, 1, 1, $paramset['year'] + 1 ) ); 
     247                } 
     248 
     249                $wheres[] = ' (' . implode( ' AND ', $where ) . ') '; 
    247250            } 
    248251        } 
  • trunk/htdocs/system/classes/feedbackhandler.php

    r2957 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari FeedbackHandler Class 
    49 * Deals with feedback mechnisms: Commenting, Pingbacking, and the like. 
    510 * 
    6  * @package Habari 
    711 */ 
    8  
    912class FeedbackHandler extends ActionHandler 
    1013{ 
  • trunk/htdocs/system/classes/filecache.php

    r2592 r2973  
    11<?php 
    2  
    32/** 
    43 * @package Habari 
    54 * 
     5 */ 
     6 
     7/** 
    68 * Contains the FileCache class 
    7  */ 
    8  
    9 /** 
     9 * 
    1010 * Stores cache data in local files 
    1111 */ 
     
    9797            } 
    9898            else { 
    99                 $this->cache_data[$group]= array(); 
     99                $this->cache_data[$group] = array(); 
    100100            } 
    101101        } 
     
    119119        if ( !isset( $this->cache_data[$group][$name] ) ) { 
    120120            if ( isset( $this->cache_files[$ghash][$hash] ) && $this->cache_files[$ghash][$hash]['expires'] > time() && file_exists( $this->cache_files[$ghash][$hash]['file'] ) ) { 
    121                 $this->cache_data[$group][$name]= unserialize( file_get_contents( $this->cache_files[$ghash][$hash]['file'] ) ); 
     121                $this->cache_data[$group][$name] = unserialize( file_get_contents( $this->cache_files[$ghash][$hash]['file'] ) ); 
    122122            } 
    123123            else { 
    124                 $this->cache_data[$group][$name]= null; 
     124                $this->cache_data[$group][$name] = null; 
    125125            } 
    126126        } 
     
    136136        $ghash = $this->get_group_hash( $group ); 
    137137 
    138         $this->cache_data[$group][$name]= $value; 
     138        $this->cache_data[$group][$name] = $value; 
    139139 
    140140        file_put_contents( $this->cache_location . $ghash . $hash, serialize( $value ) ); 
    141         $this->cache_files[$ghash][$hash]= array( 'file' => $this->cache_location . $ghash . $hash, 'expires' => time() + $expiry, 'name' => $name ); 
     141        $this->cache_files[$ghash][$hash] = array( 'file' => $this->cache_location . $ghash . $hash, 'expires' => time() + $expiry, 'name' => $name ); 
    142142        $this->clear_expired(); 
    143143        file_put_contents( $this->index_file, serialize( $this->cache_files ) ); 
     
    226226    { 
    227227        foreach ( $this->cache_files as $ghash => $records ) { 
    228             $this->cache_files[$ghash]= array_filter( $records, array( $this, 'record_fresh' ) ); 
     228            $this->cache_files[$ghash] = array_filter( $records, array( $this, 'record_fresh' ) ); 
    229229        } 
    230230    } 
  • trunk/htdocs/system/classes/format.php

    r2937 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari Format Class 
    49 * 
    510 * Provides formatting functions for use in themes.  Extendable. 
    6  * @package Habari 
     11 * 
    712 */ 
    8  
    913class Format 
    1014{ 
     
    317321            elseif( $word[0] == '<' ) { 
    318322                // If the tag begins, push it on the stack 
    319                 $stack[]= $word; 
    320                 $output.= $word; 
     323                $stack[] = $word; 
     324                $output .= $word; 
    321325            } 
    322326            else { 
  • trunk/htdocs/system/classes/formui.php

    r2907 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * FormUI Library - Create interfaces for plugins 
     
    914 * FormControl*     Every control needs a FormControl* class, FormUI literally looks for example, FormControlCheckbox. 
    1015 * 
    11  * @version $Id$ 
    12  * @package Habari 
    13  */ 
    14  
     16 */ 
    1517class FormContainer 
    1618{ 
     
    5860        if($control) { 
    5961            $control->container = $this; 
    60             $this->controls[$name]= $control; 
     62            $this->controls[$name] = $control; 
    6163        } 
    6264        return $control; 
     
    120122            } 
    121123            else { 
    122                 $values[$control->name]= $control->value; 
     124                $values[$control->name] = $control->value; 
    123125            } 
    124126        } 
     
    139141            } 
    140142            else { 
    141                 $controls[$control->name]= $control; 
     143                $controls[$control->name] = $control; 
    142144            } 
    143145        } 
     
    197199                $validate = $control->validate(); 
    198200                if(count($validate) != 0) { 
    199                     $class[]= 'invalid'; 
     201                    $class[] = 'invalid'; 
    200202                    $message = implode('<br>', (array) $validate); 
    201203                } 
     
    361363        foreach($this->controls as $control) { 
    362364            if ($result = $control->validate()) { 
    363                 $results[]= $result; 
     365                $results[] = $result; 
    364366            } 
    365367        } 
     
    10591061            $index = $validator; 
    10601062        } 
    1061         $this->validators[$index]= $args; 
     1063        $this->validators[$index] = $args; 
    10621064        return $this; 
    10631065    } 
  • trunk/htdocs/system/classes/habaridatetime.php

    r2769 r2973  
    11<?php 
    22/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
     7/** 
    38 * HabariDateTime class to wrap dates in. 
    4  * 
    5  * @package Habari 
    69 * 
    710 * @property-read HabariDateTime $clone Returns a clonned object. 
  • trunk/htdocs/system/classes/habarilocale.php

    r2969 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    610 * Provides translation services. 
    711 * 
    8  * @package Habari 
    912 */ 
    1013class HabariLocale 
     
    184187                $transinfo = unpack( $lo, substr( $data, $header['transblock'] + $msgindex * 8, 8 ) ); 
    185188                $transids = explode( "\0", substr( $data, $transinfo['offset'], $transinfo['length'] ) ); 
    186                 self::$messages[$domain][$msgids[0]]= array( 
     189                self::$messages[$domain][$msgids[0]] = array( 
    187190                    $msgids, 
    188191                    $transids, 
  • trunk/htdocs/system/classes/hiengine.php

    r2917 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * 
    59 * Habari HiEngine class 
    6  * @package Habari 
    710 * 
    811 * The HiEngine is a subclass of the RawPHPEngine class 
  • trunk/htdocs/system/classes/htmltokenizer.php

    r2592 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    8892    private function node( $type, $name, $value, $attrs ) 
    8993    { 
    90         $this->nodes[]= array( 
     94        $this->nodes[] = array( 
    9195            'type' => $type, 
    9296            'name' => $name, 
     
    197201                $this->dec(); 
    198202            } 
    199             $attr[$name]= $value; 
     203            $attr[$name] = $value; 
    200204            $this->skip_whitespace(); 
    201205        } 
  • trunk/htdocs/system/classes/htmltokenset.php

    r2894 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
  • trunk/htdocs/system/classes/importer.php

    r590 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    59 * from other blogging tools. 
    610 * 
    7  * @package Habari 
    8  * @version $Id$ 
    911 */ 
    1012interface importer 
  • trunk/htdocs/system/classes/infoobject.php

    r2592 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
     7/** 
     8 * Object metadata 
     9 * 
     10 */ 
    311class InfoObject extends InfoRecords { 
    412 
    5     function __construct ( $params )  
     13    function __construct ( $params ) 
    614    { 
    715        // Don't call the parent constructor if this is read-only 
     
    917            $this->$key = $value; 
    1018        } 
    11     }        
     19    } 
    1220} 
    1321?> 
  • trunk/htdocs/system/classes/inforecords.php

    r2592 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    59 * 
    610 * Base class for managing metadata about various Habari objects 
    7  *  
    8  * @package Habari 
     11 * 
    912 */ 
    1013abstract class InfoRecords implements URLProperties 
    11 {    
     14{ 
    1215    // the info array 
    1316    protected $__inforecord_array = array(); 
     
    3235     * @param string $table_name name of the table to insert info (use the DB::o()->table_name syntax) 
    3336     * @param string $key_name name of the primary key (for example "post_id") 
    34      * @param mixed $key_value (optional) the master record key value (for example, info for post_id = 1 managed by setting this param to 1). Use  
     37     * @param mixed $key_value (optional) the master record key value (for example, info for post_id = 1 managed by setting this param to 1). Use 
    3538     *      set_key method if not set here. 
    3639     **/ 
    37     public function __construct( $table_name, $key_name, $key_value = NULL )  
    38     {    
     40    public function __construct( $table_name, $key_name, $key_value = NULL ) 
     41    { 
    3942        $this->_table_name = $table_name; 
    4043        $this->_key_name = $key_name; 
     
    4851     * @return boolean TRUE if master record value has been set already, FALSE otherwise 
    4952     **/ 
    50     public function is_key_set()  
     53    public function is_key_set() 
    5154    { 
    5255        return isset( $this->_key_value ); 
     
    8386            return; 
    8487        } 
    85           
     88         
    8689        $result = DB::get_results( ' 
    8790            SELECT name, value, type 
     
    9295         
    9396        foreach ( $result as $result_element ) { 
    94             // XXX is this logic right?  
     97            // XXX is this logic right? 
    9598            if ( $result_element->type == 1 ) { 
    96                 $this->__inforecord_array[$result_element->name]= array('value'=>unserialize($result_element->value)); 
     99                $this->__inforecord_array[$result_element->name] = array('value'=>unserialize($result_element->value)); 
    97100            } 
    98             else {                       
    99                 $this->__inforecord_array[$result_element->name]= array('value'=>$result_element->value); 
     101            else { 
     102                $this->__inforecord_array[$result_element->name] = array('value'=>$result_element->value); 
    100103            } 
    101104        } 
     
    109112     * @return mixed Stored value for specified key 
    110113     **/ 
    111     public function __get ( $name )  
     114    public function __get ( $name ) 
    112115    { 
    113116        $this->_load(); 
     
    116119        } 
    117120        return $this->__inforecord_array[$name]['value']; 
    118     }    
    119  
    120     /** 
    121      * Update the info record.   
     121    } 
     122 
     123    /** 
     124     * Update the info record. 
    122125     * The value will not be stored in the database until calling $this->commit(); 
    123      *  
     126     * 
    124127     * @param string $name Name of the key to set 
    125128     * @param mixed $value Value to set 
    126      **/          
    127     public function __set( $name, $value )  
    128     { 
    129         $this->_load(); 
    130         $this->__inforecord_array[$name]= array('changed'=>true, 'value'=>$value);       
     129     **/ 
     130    public function __set( $name, $value ) 
     131    { 
     132        $this->_load(); 
     133        $this->__inforecord_array[$name] = array('changed'=>true, 'value'=>$value); 
    131134    } 
    132135 
    133136    /** 
    134137     * Test for the existence of specified info value 
    135      *  
     138     * 
    136139     * @param string $name Name of the option to set 
    137140     * @return boolean TRUE if the info option exists, FALSE in all other cases 
    138      **/     
     141     **/ 
    139142    public function __isset ( $name ) 
    140143    { 
     
    145148    /** 
    146149     * Remove an info option; immediately unsets from the storage AND removes from database. Use with caution. 
    147      *  
     150     * 
    148151     * @param string $name Name of the option to unset 
    149152     * @return boolean TRUE if the option is successfully unset, FALSE otherwise 
    150      **/     
     153     **/ 
    151154        public function __unset( $name ) 
    152155    { 
    153156        $this->_load(); 
    154         if ( isset( $this->__inforecord_array[$name] ) ) {           
     157        if ( isset( $this->__inforecord_array[$name] ) ) { 
    155158            DB::delete( $this->_table_name, array ( $this->_key_name => $this->_key_value, "name"=> $name ) ); 
    156159            unset( $this->__inforecord_array[$name] ); 
    157160            return true; 
    158161        } 
    159         return false;         
    160     }    
     162        return false; 
     163    } 
    161164 
    162165    /** 
     
    174177     
    175178    /** 
    176      * Remove all info options. Primarily used when deleting the parent object.  
     179     * Remove all info options. Primarily used when deleting the parent object. 
    177180     * I.E. when deleting a user, the delete method would call this. 
    178      *  
     181     * 
    179182     * @return boolean TRUE if the options were successfully unset, FALSE otherwise 
    180      **/     
     183     **/ 
    181184    public function delete_all() 
    182185    { 
     
    193196            $result->out(); 
    194197            return false; 
    195         }  
     198        } 
    196199        $this->__inforecord_array = array(); 
    197200        return true; 
     
    201204     * Commit all of the changed info options to the database. 
    202205     * If this function is not called, then the options will not be written. 
    203      *  
     206     * 
    204207     * @param mixed $metadata_key (optional) Key to use when writing info data. 
    205208     */ 
     
    209212            $this->_key_value = $metadata_key; 
    210213        } 
    211         // If the info is not already loaded, and the key value is empty,  
     214        // If the info is not already loaded, and the key value is empty, 
    212215        // then we don't have enough info to do the commit 
    213216        if ( !$this->_loaded && empty($this->_key_value) ) { 
     
    219222                $value = $record['value']; 
    220223                if ( is_array( $value ) || is_object( $value ) ) { 
    221                     $result = DB::update(  
    222                         $this->_table_name,  
     224                    $result = DB::update( 
     225                        $this->_table_name, 
    223226                        array( 
    224                             $this->_key_name=>$this->_key_value,  
    225                             'name'=>$name,  
     227                            $this->_key_name=>$this->_key_value, 
     228                            'name'=>$name, 
    226229                            'value'=>serialize($value), 
    227230                            'type'=>1 
    228                         ),  
     231                        ), 
    229232                        array('name'=>$name, $this->_key_name=>$this->_key_value) 
    230                     );  
    231                 }            
     233                    ); 
     234                } 
    232235                else { 
    233                     $result = DB::update(  
    234                         $this->_table_name,  
     236                    $result = DB::update( 
     237                        $this->_table_name, 
    235238                        array( 
    236                             $this->_key_name=>$this->_key_value,  
    237                             'name'=>$name,  
    238                             'value'=>$value,  
     239                            $this->_key_name=>$this->_key_value, 
     240                            'name'=>$name, 
     241                            'value'=>$value, 
    239242                            'type'=>0 
    240                         ),  
    241                         array('name'=>$name, $this->_key_name=> $this->_key_value)    
    242                     );  
     243                        ), 
     244                        array('name'=>$name, $this->_key_name=> $this->_key_value) 
     245                    ); 
    243246                } 
    244247                 
     
    246249                    $result->out(); 
    247250                } 
    248                 $this->__inforecord_array[$name] = array('value'=>$value);   
     251                $this->__inforecord_array[$name] = array('value'=>$value); 
    249252            } 
    250253        } 
  • trunk/htdocs/system/classes/inputfilter.php

    r2934 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Input filtering functions. 
    59 * 
    6  * @package Habari 
    710 */ 
    811class InputFilter 
     
    315318        $matches = $matches[0]; 
    316319        if ( ! isset( $matches['full_address'] ) ) 
    317             $matches['full_address']= ''; 
    318  
    319         $r['is_error']= FALSE; 
    320         $r['is_relative']= empty( $matches['full_address'] ); 
    321         $r['is_pseudo']= ! array_key_exists( 'host', $matches ); 
    322         $r['pseudo_args']= $r['is_pseudo'] ? $matches['full_address'] : ''; 
     320            $matches['full_address'] = ''; 
     321 
     322        $r['is_error'] = FALSE; 
     323        $r['is_relative'] = empty( $matches['full_address'] ); 
     324        $r['is_pseudo'] = ! array_key_exists( 'host', $matches ); 
     325        $r['pseudo_args'] = $r['is_pseudo'] ? $matches['full_address'] : ''; 
    323326 
    324327        foreach ( array( 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment' ) as $k ) { 
    325328            if ( array_key_exists( $k, $matches ) ) { 
    326                 $r[$k]= $matches[$k]; 
     329                $r[$k] = $matches[$k]; 
    327330            } 
    328331        } 
     
    446449                    else { 
    447450                        // XXX use blog charset setting 
    448                         $node['value']= html_entity_decode( $node['value'], ENT_QUOTES, 'utf-8' ); 
     451                        $node['value'] = html_entity_decode( $node['value'], ENT_QUOTES, 'utf-8' ); 
    449452                    } 
    450453                    break; 
     
    493496 
    494497            if ( $node != NULL ) { 
    495                 $filtered[]= $node; 
     498                $filtered[] = $node; 
    496499            } 
    497500        } 
  • trunk/htdocs/system/classes/installhandler.php

    r2971 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27define('MIN_PHP_VERSION', '5.2.0'); 
    38 
     
    3641        */ 
    3742        if ( ! $this->check_htaccess() ) { 
    38             $this->handler_vars['file_contents']= implode( "\n", $this->htaccess() ); 
     43            $this->handler_vars['file_contents'] = implode( "\n", $this->htaccess() ); 
    3944            $this->display('htaccess'); 
    4045        } 
     
    8792                    // SQLite uses less info. 
    8893                    // we stick the path in db_host 
    89                     $this->handler_vars['db_file']= $remainder; 
     94                    $this->handler_vars['db_file'] = $remainder; 
    9095                    break; 
    9196                case 'mysql': 
    9297                    list($host,$name)= explode(';', $remainder); 
    93                     list($discard, $this->handler_vars['db_host'])= explode('=', $host); 
    94                     list($discard, $this->handler_vars['db_schema'])= explode('=', $name); 
     98                    list($discard, $this->handler_vars['db_host']) = explode('=', $host); 
     99                    list($discard, $this->handler_vars['db_schema']) = explode('=', $name); 
    95100                    break; 
    96101                case 'pgsql': 
    97102                    list($host,$name)= explode(' ', $remainder); 
    98                     list($discard, $this->handler_vars['db_host'])= explode('=', $host); 
    99                     list($discard, $this->handler_vars['db_schema'])= explode('=', $name); 
     103                    list($discard, $this->handler_vars['db_host']) = explode('=', $host); 
     104                    list($discard, $this->handler_vars['db_schema']) = explode('=', $name); 
    100105                    break; 
    101106                } 
    102                 $this->handler_vars['db_user']= $db_connection['username']; 
    103                 $this->handler_vars['db_pass']= $db_connection['password']; 
    104                 $this->handler_vars['table_prefix']= $db_connection['prefix']; 
     107                $this->handler_vars['db_user'] = $db_connection['username']; 
     108                $this->handler_vars['db_pass'] = $db_connection['password']; 
     109                $this->handler_vars['table_prefix'] = $db_connection['prefix']; 
    105110            } 
    106111            // if a $blog_data array exists in config.php, use it 
     
    109114            if ( isset( $blog_data ) ) { 
    110115                foreach ( $blog_data as $blog_datum => $value ) { 
    111                     $this->handler_vars[$blog_datum]= $value; 
     116                    $this->handler_vars[$blog_datum] = $value; 
    112117                } 
    113118            } 
     
    130135        $db_type = $this->handler_vars['db_type']; 
    131136        if ( $db_type == 'mysql' || $db_type == 'pgsql' ) { 
    132             $this->handler_vars['db_host']= $_POST["{$db_type}_db_host"]; 
    133             $this->handler_vars['db_user']= $_POST["{$db_type}_db_user"]; 
    134             $this->handler_vars['db_pass']= $_POST["{$db_type}_db_pass"]; 
    135             $this->handler_vars['db_schema']= $_POST["{$db_type}_db_schema"]; 
     137            $this->handler_vars['db_host'] = $_POST["{$db_type}_db_host"]; 
     138            $this->handler_vars['db_user'] = $_POST["{$db_type}_db_user"]; 
     139            $this->handler_vars['db_pass'] = $_POST["{$db_type}_db_pass"]; 
     140            $this->handler_vars['db_schema'] = $_POST["{$db_type}_db_schema"]; 
    136141        } 
    137142 
     
    192197            $plugin = array(); 
    193198            $plugin_id = Plugins::id_from_file( $file ); 
    194             $plugin['plugin_id']= $plugin_id; 
    195             $plugin['file']= $file; 
     199            $plugin['plugin_id'] = $plugin_id; 
     200            $plugin['file'] = $file; 
    196201 
    197202            $error = ''; 
    198203            if ( Utils::php_check_file_syntax( $file, $error ) ) { 
    199                 $plugin['debug']= false; 
     204                $plugin['debug'] = false; 
    200205                // instantiate this plugin 
    201206                // in order to get its info() 
     
    203208                Plugins::get_plugin_classes(); 
    204209                $pluginobj = Plugins::load( $file, false ); 
    205                 $plugin['active']= false; 
    206                 $plugin['verb']= _t( 'Activate' ); 
    207                 $plugin['actions']= array(); 
    208                 $plugin['info']= $pluginobj->info; 
     210                $plugin['active'] = false; 
     211                $plugin['verb'] = _t( 'Activate' ); 
     212                $plugin['actions'] = array(); 
     213                $plugin['info'] = $pluginobj->info; 
    209214                $plugin['recommended'] = in_array( basename($file), $recommended_list ); 
    210215            } 
    211216            else { 
    212                 $plugin['debug']= true; 
    213                 $plugin['error']= $error; 
    214                 $plugin['active']= false; 
    215             } 
    216  
    217             $plugins[$plugin_id]= $plugin; 
     217                $plugin['debug'] = true; 
     218                $plugin['error'] = $error; 
     219                $plugin['active'] = false; 
     220            } 
     221 
     222            $plugins[$plugin_id] = $plugin; 
    218223        } 
    219224 
     
    297302        foreach ($required_extensions as $ext_name => $ext_url) { 
    298303            if (!extension_loaded($ext_name)) { 
    299                 $missing_extensions[$ext_name]= $ext_url; 
     304                $missing_extensions[$ext_name] = $ext_url; 
    300305                $requirements_met = false; 
    301306            } 
     
    683688        switch ($db_type) { 
    684689            case 'mysql': 
    685                 $queries[]= 'CREATE DATABASE ' . $db_schema . ';'; 
    686                 $queries[]= 'GRANT ALL ON ' . $db_schema . '.* TO \'' . $db_user . '\'@\'' . $db_host . '\' ' . 
     690                $queries[] = 'CREATE DATABASE ' . $db_schema . ';'; 
     691                $queries[] = 'GRANT ALL ON ' . $db_schema . '.* TO \'' . $db_user . '\'@\'' . $db_host . '\' ' . 
    687692                'IDENTIFIED BY \'' . $db_pass . '\';'; 
    688693                break; 
    689694            case 'pgsql': 
    690                 $queries[]= 'CREATE DATABASE ' . $db_schema . ';'; 
    691                 $queries[]= 'GRANT ALL ON DATABASE ' . $db_schema . ' TO ' . $db_user . ';'; 
     695                $queries[] = 'CREATE DATABASE ' . $db_schema . ';'; 
     696                $queries[] = 'GRANT ALL ON DATABASE ' . $db_schema . ' TO ' . $db_user . ';'; 
    692697                break; 
    693698            default: 
     
    783788                } 
    784789            } 
    785             $this->handler_vars['config_file']= Site::get_dir('config_file'); 
    786             $this->handler_vars['file_contents']= htmlspecialchars($file_contents); 
     790            $this->handler_vars['config_file'] = Site::get_dir('config_file'); 
     791            $this->handler_vars['file_contents'] = htmlspecialchars($file_contents); 
    787792            $this->display('config'); 
    788793            return false; 
     
    840845        $rewrite_base = trim( dirname( $_SERVER['SCRIPT_NAME'] ), '/\\' ); 
    841846        if ( $rewrite_base != '' ) { 
    842             $htaccess['rewrite_base']= 'RewriteBase /' . $rewrite_base; 
     847            $htaccess['rewrite_base'] = 'RewriteBase /' . $rewrite_base; 
    843848        } 
    844849 
     
    907912        if($rewritebase) { 
    908913            $rewrite_base = trim( dirname( $_SERVER['SCRIPT_NAME'] ), '/\\' ); 
    909             $htaccess['rewrite_base']= 'RewriteBase /' . $rewrite_base; 
     914            $htaccess['rewrite_base'] = 'RewriteBase /' . $rewrite_base; 
    910915        } 
    911916        $file_contents = "\n" . implode( "\n", $htaccess ) . "\n"; 
     
    11121117                // skip the first tag text so we end up with something, presumably the first tag entered (it had the lowest ID in the db) 
    11131118                if ( !isset( $fix_tags[ $tag_row->tag_slug ] ) ) { 
    1114                     $slug_to_id[ $tag_row->tag_slug ]= $tag_row->id;        // collect the slug => id so we can rename with an absolute id later 
    1115                     $fix_tags[ $tag_row->tag_slug ]= array(); 
     1119                    $slug_to_id[ $tag_row->tag_slug ] = $tag_row->id;       // collect the slug => id so we can rename with an absolute id later 
     1120                    $fix_tags[ $tag_row->tag_slug ] = array(); 
    11161121                } 
    11171122                else { 
    1118                     $fix_tags[ $tag_row->tag_slug ][ $tag_row->id ]= $tag_row->tag_text; 
     1123                    $fix_tags[ $tag_row->tag_slug ][ $tag_row->id ] = $tag_row->tag_text; 
    11191124                } 
    11201125 
     
    12041209                $index = array_search( $plugin, $activated ); 
    12051210                $plugin = str_replace( $base_path, '', $plugin ); 
    1206                 $activated[$index]= $plugin; 
     1211                $activated[$index] = $plugin; 
    12071212            } 
    12081213            Options::set( 'active_plugins', $activated ); 
  • trunk/htdocs/system/classes/iscontent.php

    r1615 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    812 * @copyright 2008 
    913 */ 
    10  
    1114interface IsContent 
    1215{ 
    13  
    1416 
    1517    /** 
  • trunk/htdocs/system/classes/logentry.php

    r2935 r2973  
    11<?php 
    22/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
     7/** 
    38 * Habari LogEntry class 
    4     * Represents a log entry 
    59 * 
    6  * @package Habari 
     10 * Represents a log entry 
     11 * 
    712 * @todo Apply system error handling 
    813 */ 
    9  
    1014class LogEntry extends QueryRecord 
    1115{ 
     
    6064        parent::__construct( $paramarray ); 
    6165        if ( !isset( $this->fields['module'] ) ) { 
    62             $this->fields['module']= 'habari'; 
     66            $this->fields['module'] = 'habari'; 
    6367        } 
    6468        if ( !isset( $this->fields['type'] ) ) { 
    65             $this->fields['type']= 'default'; 
     69            $this->fields['type'] = 'default'; 
    6670        } 
    6771        if ( !isset( $this->fields['severity'] ) ) { 
    68             $this->fields['severity']= 'info'; 
     72            $this->fields['severity'] = 'info'; 
    6973        } 
    7074        if ( isset( $this->fields['timestamp'] ) ) { 
     
    8690            $res = DB::get_results( 'SELECT id, module, type FROM {log_types}' ); 
    8791            foreach ( $res as $x ) { 
    88                 self::$types[ $x->module ][ $x->type ]= $x->id; 
     92                self::$types[ $x->module ][ $x->type ] = $x->id; 
    8993            } 
    9094        } 
     
    102106                continue; 
    103107            } 
    104             $results[$id]= $name; 
     108            $results[$id] = $name; 
    105109        } 
    106110        return $results; 
     
    116120        $types = self::list_logentry_types( $refresh ); 
    117121        foreach ( $types as $module => $types ) { 
    118             $modules[]= $module; 
     122            $modules[] = $module; 
    119123        } 
    120124    } 
     
    218222        $user = User::identify(); 
    219223        if ( $user->loggedin ) { 
    220             $defaults['where'][]= array( 
     224            $defaults['where'][] = array( 
    221225                'user_id' => $user->id, 
    222226            ); 
    223227        } 
    224228        foreach ( $defaults['where'] as $index => $where ) { 
    225             $defaults['where'][$index]= array_merge( $where, Utils::get_params( $paramarray ) ); 
     229            $defaults['where'][$index] = array_merge( $where, Utils::get_params( $paramarray ) ); 
    226230        } 
    227231        // Make sure we fetch only a single event. (LIMIT 1) 
    228         $defaults['limit']= 1; 
     232        $defaults['limit'] = 1; 
    229233 
    230234        return EventLog::get( $defaults ); 
  • trunk/htdocs/system/classes/media.php

    r2137 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    610 * @version $Id$ 
    711 * @copyright 2008 
    8  * @package Habari 
     12 * 
    913 * @todo Handle all error conditions using exceptions 
    1014 */ 
    11  
    1215class Media 
    1316{ 
     
    3235                { 
    3336                    $dirs[] = new MediaAsset($siloname, true, array(), $info['icon']); 
    34                 } else { 
     37                } 
     38                else { 
    3539                    $dirs[] = new MediaAsset($siloname, true, array(), NULL); 
    3640                } 
  • trunk/htdocs/system/classes/mediaasset.php

    r2137 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    59 * 
    610 */ 
    7  
    811class MediaAsset 
    912{ 
  • trunk/htdocs/system/classes/mediasilo.php

    r1281 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    711 * @copyright 2007 
    812 */ 
    9  
    1013interface MediaSilo 
    1114{ 
  • trunk/htdocs/system/classes/modules.php

    r2630 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari Modules Class 
    49 * 
    510 * Provides an interface for the code to access modules and module options 
    6  * @package Habari 
    711 */ 
    8  
    912class Modules 
    1013{ 
     
    1316    private static $status_data; 
    1417 
    15    /** 
    16     * static initializer to setup base vars. 
    17     */ 
     18    /** 
     19    * static initializer to setup base vars. 
     20    */ 
    1821    public static function __static() 
    1922    { 
  • trunk/htdocs/system/classes/multibyte.php

    r2450 r2973  
    11<?php 
     2/* 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/* 
     
    812 * manipulations are done in UTF-8. Currently 
    913 * this class is a wrapper around mbstring functions. 
    10  *  
    11  * @package Habari 
     14 * 
    1215 */ 
    1316class MultiByte 
     
    3841    * function hab_encoding 
    3942    * 
    40     * Sets and returns the internal encoding.  
     43    * Sets and returns the internal encoding. 
    4144    * 
    4245    * @param $use_enc string. The encoding to be used 
    43     ^ 
     46    * 
    4447    * @return string. If $enc is null, returns the current 
    4548    * encoding. If $enc is not null, returns the old encoding 
     
    5053            return self::$hab_enc; 
    5154        } 
    52         else{ 
     55        else { 
    5356            $old_enc = self::$hab_enc; 
    5457            self::$hab_enc = $use_enc; 
     
    6265    * Sets and returns the multibyte library being used internally 
    6366    * 
    64     * @param $int The new library to use.  
     67    * @param $int The new library to use. 
    6568    * 
    6669    * @return mixed  If $new_library is null, returns the current library 
     
    8992    * Converts a string's encoding to a new encoding 
    9093    * 
    91     * @param $str string. The string who's encoding is being changed.  
     94    * @param $str string. The string who's encoding is being changed. 
    9295    * @param $use_enc string. The encoding to convert to. If not set, 
    9396    * the internal encoding will be used. 
    94     * @param $from_enc string. encoding before conversion. If not set,  
     97    * @param $from_enc string. encoding before conversion. If not set, 
    9598    * encoding is detected automatically. 
    9699    * 
     
    123126    * Detects the encoding being used for a string 
    124127    * 
    125     * @param $str string. The string who's encoding is being detected  
     128    * @param $str string. The string who's encoding is being detected 
    126129    * 
    127130    * @return mixed The  source string's detected encoding, or boolean false. 
     
    158161    * not set, the section of the string from $begin to the end of the string is 
    159162    * returned. 
    160     * @param $use_enc string. The encoding to be used. If not set,  
     163    * @param $use_enc string. The encoding to be used. If not set, 
    161164    * the internal encoding will be used. 
    162165    * 
    163166    * @return mixed The  section of the source string requested in the encoding requested or false. 
    164167    * If $len is not set, returns substring from $begin to end of string. 
    165     *   
     168    * 
    166169    */ 
    167170    public static function substr( $str, $begin, $len = null, $use_enc = null ) 
     
    190193    * Gets the length of a string in characters 
    191194    * 
    192     * @param $str string. The string who's length is being returned.  
    193     * @param $use_enc string. The encoding to be used. If not set,  
    194     * the internal encoding will be used. 
    195     * 
    196     * @return integer. The length in characters of the string, or the length in bytes if a valid  
     195    * @param $str string. The string who's length is being returned. 
     196    * @param $use_enc string. The encoding to be used. If not set, 
     197    * the internal encoding will be used. 
     198    * 
     199    * @return integer. The length in characters of the string, or the length in bytes if a valid 
    197200    * multibyte library isn't loaded. 
    198201    */ 
     
    225228     * 
    226229     * @param $str string. The string to lowercase 
    227     * @param $use_enc string. The encoding to be used. If not set,  
     230    * @param $use_enc string. The encoding to be used. If not set, 
    228231    * the internal encoding will be used. 
    229232     * 
     
    254257    * 
    255258    * @param $str string. The string to uppercase 
    256     * @param $use_enc string. The encoding to be used. If not set,  
     259    * @param $use_enc string. The encoding to be used. If not set, 
    257260    * the internal encoding will be used. 
    258261    * 
  • trunk/htdocs/system/classes/options.php

    r2759 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Habari Options Class 
    59 * 
    6  * @package Habari 
    710 */ 
    811class Options extends Singleton 
     
    130133        foreach($results as $result) { 
    131134            if ( $result->type == 1 ) { 
    132                 $this->options[$result->name]= unserialize( $result->value ); 
     135                $this->options[$result->name] = unserialize( $result->value ); 
    133136            } 
    134137            else { 
    135                 $this->options[$result->name]= $result->value; 
     138                $this->options[$result->name] = $result->value; 
    136139            } 
    137140        } 
     
    149152        } 
    150153        $value = Plugins::filter( 'option_set_value', $value, $name, isset($this->options[$name]) ? $this->options[$name] : null ); 
    151         $this->options[$name]= $value; 
     154        $this->options[$name] = $value; 
    152155 
    153156        if ( is_array( $value ) || is_object( $value ) ) { 
  • trunk/htdocs/system/classes/pluggable.php

    r2968 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
     
    812 * @copyright 2008 
    913 */ 
    10  
    1114abstract class Pluggable 
    1215{ 
  • trunk/htdocs/system/classes/plugin.php

    r1297 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari Plugin Class 
     
    712 * plugin actions are registered against the appropriate dispatcher 
    813 * 
    9  * @package Habari 
    1014 */ 
    11  
    1215abstract class Plugin extends Pluggable 
    1316{ 
  • trunk/htdocs/system/classes/plugins.php

    r2903 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
     6 
    27/** 
    38 * Habari Plugins Class 
    49 * 
    510 * Provides an interface for the code to access plugins 
    6  * @package Habari 
    711 */ 
    8  
    912class Plugins 
    1013{ 
     
    227230        if ( Site::CONFIG_LOCAL != Site::$config_type ) { 
    228231            // include site-specific plugins 
    229             $plugindirs[]= Site::get_dir( 'config' ) . '/plugins/'; 
     232            $plugindirs[] = Site::get_dir( 'config' ) . '/plugins/'; 
    230233        } 
    231234        $dirs = array(); 
     
    288291            // really can't find it 
    289292            return false; 
    290         } else { 
     293        } 
     294        else { 
    291295            return self::class_from_filename( $file, true ); 
    292296        } 
     
    311315        $plugin = new $class; 
    312316        if($activate) { 
    313             self::$plugins[$plugin->plugin_id]= $plugin; 
     317            self::$plugins[$plugin->plugin_id] = $plugin; 
    314318            $plugin->load(); 
    315319        } 
     
    470474            if ( !Utils::php_check_file_syntax( $file, $error ) ) { 
    471475                Session::error(sprintf( _t( 'Attempted to load the plugin file "%s", but it failed with syntax errors. <div class="reveal">%s</div>' ), basename( $file ), $error )); 
    472                 $failed_plugins[]= $file; 
     476                $failed_plugins[] = $file; 
    473477            } 
    474478        } 
  • trunk/htdocs/system/classes/post.php

    r2963 r2973  
    11<?php 
    2  
    32/** 
    43 * @package Habari 
     4 * 
     5 */ 
     6 
     7/** 
    58 * 
    69 * Includes an instance of the PostInfo class; for holding inforecords about a Post 
     
    4144            return self::$post_type_list_active; 
    4245        } 
    43         self::$post_type_list_active['any']= 0; 
     46        self::$post_type_list_active['any'] = 0; 
    4447        $sql = 'SELECT * FROM ' . DB::table( 'posttype' ) . ' WHERE active = 1 ORDER BY id ASC'; 
    4548        $results = DB::get_results( $sql ); 
    4649        foreach ( $results as $result ) { 
    47             self::$post_type_list_active[$result->name]= $result->id; 
     50            self::$post_type_list_active[$result->name] = $result->id; 
    4851        } 
    4952        return self::$post_type_list_active; 
     
    6063            return self::$post_type_list_all; 
    6164        } 
    62         self::$post_type_list_all['any']= 0; 
     65        self::$post_type_list_all['any'] = 0; 
    6366        $sql = 'SELECT * FROM ' . DB::table( 'posttype' ) . ' ORDER BY id ASC'; 
    6467        $results = DB::get_results( $sql ); 
    6568        foreach ( $results as $result ) { 
    66             self::$post_type_list_all[$result->name]= array( 
     69            self::$post_type_list_all[$result->name] = array( 
    6770                'id' => $result->id, 
    6871                'active' => $result->active 
     
    112115    { 
    113116        $statuses = array(); 
    114         $statuses['any']= 0; 
     117        $statuses['any'] = 0; 
    115118        if ( $refresh || empty( self::$post_status_list ) ) { 
    116119            $sql = 'SELECT * FROM ' . DB::table( 'poststatus' ) . ' ORDER BY id ASC'; 
     
    121124            if ( $all instanceof Post ) { 
    122125                if( ! $status->internal || $status->id == $all->status ) { 
    123                     $statuses[$status->name]= $status->id; 
     126                    $statuses[$status->name] = $status->id; 
    124127                } 
    125128            } 
    126129            elseif ( $all ) { 
    127                 $statuses[$status->name]= $status->id; 
     130                $statuses[$status->name] = $status->id; 
    128131            } 
    129132            elseif ( ! $status->internal ) { 
    130                 $statuses[$status->name]= $status->id; 
     133                $statuses[$status->name] = $status->id; 
    131134            } 
    132135        } 
     
    318321        $user = User::identify(); 
    319322        if ( $user->loggedin ) { 
    320             $defaults['where'][]= array( 
     323            $defaults['where'][] = array( 
    321324                'user_id' => $user->id, 
    322325            ); 
    323326        } 
    324327        foreach ( $defaults['where'] as $index => $where ) { 
    325             $defaults['where'][$index]= array_merge( $where, Utils::get_params( $paramarray ) ); 
     328            $defaults['where'][$index] = array_merge( $where, Utils::get_params( $paramarray ) ); 
    326329        } 
    327330        // make sure we get at most one result 
    328         $defaults['limit']= 1; 
     331        $defaults['limit'] = 1; 
    329332 
    330333        return Posts::get( $defaults ); 
     
    388391        } while ( $slugcount->ct != 0 ); 
    389392 
    390         return $this->newfields['slug']= $slug . $postfix; 
     393        return $this->newfields['slug'] = $slug . $postfix; 
    391394    } 
    392395 
     
    401404        ) { 
    402405            $result = 'tag:' . Site::get_url( 'hostname' ) . ',' . date( 'Y' ) . ':' . $this->setslug() . '/' . time(); 
    403             $this->newfields['guid']= $result; 
     406            $this->newfields['guid'] = $result; 
    404407        } 
    405408        return $this->newfields['guid']; 
     
    416419        $statuses = Post::list_post_statuses(); 
    417420        if ( is_numeric( $value ) && in_array( $value, $statuses ) ) { 
    418             return $this->newfields['status']= $value; 
     421            return $this->newfields['status'] = $value; 
    419422        } 
    420423        elseif ( array_key_exists( $value, $statuses ) ) { 
    421             return $this->newfields['status']= Post::status( 'publish' ); 
     424            return $this->newfields['status'] = Post::status( 'publish' ); 
    422425        } 
    423426 
     
    464467            if ( ! in_array( $tag, array_keys( $clean_tags ) ) ) 
    465468                if ( ! in_array( $slug = Utils::slugify( $tag ), array_values( $clean_tags ) ) ) 
    466                     $clean_tags[$tag]= $slug; 
     469                    $clean_tags[$tag] = $slug; 
    467470 
    468471        if ( count( $this->tags ) == 0) { 
     
    487490                     * Add the ID to the list of Tag IDs to add to the tag2post table 
    488491                     */ 
    489                     $tag_ids_to_post[]= $existing_tag->id; 
     492                    $tag_ids_to_post[] = $existing_tag->id; 
    490493                    /* 
    491494                     * We remove it from the clean_tags collection as we only 
     
    495498                } 
    496499                if ( in_array( $existing_tag->tag_slug, array_values( $clean_tags ) ) ) { 
    497                     $tag_ids_to_post[]= $existing_tag->id; 
     500                    $tag_ids_to_post[] = $existing_tag->id; 
    498501                    foreach ( $clean_tags as $text=>$slug ) { 
    499502                        if ( $slug == $existing_tag->tag_slug ) { 
     
    520523 
    521524            if (FALSE !== ($insert = DB::query( $sql_tag_new, array( $new_tag_text, $new_tag_slug ) ) ) ) 
    522                 $tag_ids_to_post[]= DB::last_insert_id(); 
     525                $tag_ids_to_post[] = DB::last_insert_id(); 
    523526            $result&= $insert; 
    524527        } 
     
    573576    public function insert() 
    574577    { 
    575         $this->newfields['updated']= HabariDateTime::date_create(); 
     578        $this->newfields['updated'] = HabariDateTime::date_create(); 
    576579        $this->newfields['modified'] = $this->newfields['updated']; 
    577580        $this->setguid(); 
     
    592595 
    593596        $result = parent::insertRecord( DB::table( 'posts' ) ); 
    594         $this->newfields['id']= DB::last_insert_id(); // Make sure the id is set in the post object to match the row id 
     597        $this->newfields['id'] = DB::last_insert_id(); // Make sure the id is set in the post object to match the row id 
    595598        $this->fields = array_merge( $this->fields, $this->newfields ); 
    596599        $this->newfields = array(); 
     
    887890            if ( $result ) { 
    888891                foreach ( $result as $t ) { 
    889                     $this->tags[$t->tag_slug]= $t->tag_text; 
     892                    $this->tags[$t->tag_slug] = $t->tag_text; 
    890893                } 
    891894            } 
  • trunk/htdocs/system/classes/postinfo.php

    r1283 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
     7/** 
     8 * Post metadata 
     9 */ 
    310class PostInfo extends InfoRecords { 
    411 
    5     function __construct ( $post_id )  
     12    function __construct ( $post_id ) 
    613    { 
    714        parent::__construct ( DB::table('postinfo'), "post_id", $post_id ); // call parent with appropriate  parameters 
    8     }        
     15    } 
    916} 
    1017?> 
  • trunk/htdocs/system/classes/posts.php

    r2862 r2973  
    11<?php 
     2/** 
     3 * @package Habari 
     4 * 
     5 */ 
    26 
    37/** 
    48 * Habari Posts Class 
    59 * 
    6  * @package Habari 
    7  */ 
    8  
    9 /** 
    1010 * class Posts 
    1111 * This class provides two key features. 
     
    8787        // If the request as a textual WHERE clause, skip the processing of the $wheresets since it's empty 
    8888        if ( isset( $paramarray['where'] ) && is_string( $paramarray['where'] ) ) { 
    89             $wheres[]= $paramarray['where']; 
     89            $wheres[] = $paramarray['where']; 
    9090        } 
    9191        else { 
     
    9999                    if ( is_array( $paramset['id'] ) ) { 
    100100                        array_walk( $paramset['id'], create_function( '&$a,$b', '$a = intval($a);' ) ); 
    101                         $where[]= "id IN (" . implode( ',', array_fill( 0, count( $paramset['id'] ), '?' ) ) . ")"; 
     101                        $where[] = "id IN (" . implode( ',', array_fill( 0, count( $paramset['id'] ), '?' ) ) . ")"; 
    102102                        $params = array_merge( $params, $paramset['id'] ); 
    103103                    } 
    104104                    else { 
    105                         $where[]= "id= ?"; 
    106                         $params[]= (int) $paramset['id']; 
     105                        $where[] = "id= ?"; 
     106                        $params[] = (int) $paramset['id']; 
    107107                    } 
    108108                } 
     
    112112                        $paramset['status'] = array_diff( $paramset['status'], array( 'any' ) ); 
    113113                        array_walk( $paramset['status'], create_function( '&$a,$b', '$a = Post::status($a);' ) ); 
    114                         $where[]= "status IN (" . implode( ',', array_fill( 0, count( $paramset['status'] ), '?' ) ) . ")"; 
     114                        $where[] = "status IN (" . implode( ',', array_fill( 0, count( $paramset['status'] ), '?' ) ) . ")"; 
    115115                        $params = array_merge( $params, $paramset['status'] ); 
    116116                    } 
    117117                    else { 
    118                         $where[]= "status= ?"; 
    119                         $params[]= (int) Post::status( $paramset['status'] ); 
     118                        $where[] = "status= ?"; 
     119                        $params[] = (int) Post::status( $paramset['status'] ); 
    120120                    } 
    121121                } 
     
    125125                        $paramset['content_type'] = array_diff( $paramset['content_type'], array( 'any' ) ); 
    126126                        array_walk( $paramset['content_type'], create_function( '&$a,$b', '$a = Post::type($a);' ) ); 
    127                         $where[]= "content_type IN (" . implode( ',', array_fill( 0, count( $paramset['content_type'] ), '?' ) ) . ")"; 
     127                        $where[] = "content_type IN (" . implode( ',', array_fill( 0, count( $paramset['content_type'] ), '?' ) ) . ")"; 
    128128                        $params = array_merge( $params, $paramset['content_type'] ); 
    129129                    } 
    130130                    else { 
    131                         $where[]= "content_type= ?"; 
    132                         $params[]= (int) Post::type( $paramset['content_type'] ); 
     131                        $where[] = "content_type= ?"; 
     132                        $params[] = (int) Post::type( $paramset['content_type'] ); 
    133133                    } 
    134134                } 
    135135                if ( isset( $paramset['slug'] ) ) { 
    136136                    if ( is_array( $paramset['slug'] ) ) { 
    137                         $where[]= "slug IN (" . implode( ',', array_fill( 0, count( $paramset['slug'] ), '?' ) ) . ")"; 
     137                        $where[] = "slug IN (" . implode( ',', array_fill( 0, count( $paramset['slug'] ), '?' ) ) . ")"; 
    138138                        $params = array_merge( $params, $paramset['slug'] ); 
    139139                    } 
    140140                    else { 
    141                         $where[]= "slug= ?"; 
    142                         $params[]= (string) $paramset['slug']; 
     141                        $where[] = "slug= ?"; 
     142                        $params[] = (string) $paramset['slug']; 
    143143                    } 
    144144                } 
     
    146146                    if ( is_array( $paramset['user_