Show
Ignore:
Timestamp:
09/04/07 21:32:41 (16 months ago)
Author:
llaumgui
Message:

Mise en place du fetch topic

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ez_publish/ezipb/trunk/autoloads/ezipb_operators.php

    r18 r20  
    195195                return $this->ipsclass->vars[$index]; 
    196196        } 
    197          
    198          
    199          
    200         /** 
    201          * Fonction retournant les information sur les derniers topics 
    202          *  
    203          * Dilemme dilemme... 
    204          * Utiliser le layer d'eZ ou celui d'IPB... 
    205          * J'ai pesé le pour et le contre et voici pourquoi j'utilise celui d'IPB : 
    206          *              - gestion automatique des préfixes des tables IPB. 
    207          *              - en cas de base de données eZ et IPB différentes eZDB et $ipsclass->DB  
    208          * peuvent pointer sur une base voir un serveur différent... 
    209          * Bref, je pense avoir fait le bon choix ! 
    210          * 
    211          * Basé sur la fonction return_topic_list_data() 
    212          * sources / api / api_topic_view.php 
    213          *  
    214          * @param array $options Options de la requêtes. 
    215          * @return array Infos sur les postes 
    216          */ 
    217         /*function ezipb_fetch_topic ( $options ) { 
    218  
    219                 / * Valeurs par défauts * / 
    220                 if ( !array_key_exists( 'sort_by', $options ) || !is_array( $options['sort_by']) ) 
    221                         $options['sort_by']             = array( 'last_post', false ); 
    222                 if ( !array_key_exists( 'offset', $options ) ) 
    223                         $options['offset']              =  0; 
    224                 if ( !array_key_exists( 'limit', $options ) ) 
    225                         $options['limit']               =  0;                                                                                                                                                                                            
    226                  
    227                 /* true() or false() - ascending or descending * / 
    228                 if ( $options['sort_by'][1] ) 
    229                          $options['sort_by'][1] = 'ASC'; 
    230                 else 
    231                         $options['sort_by'][1]  = 'DESC'; 
    232                                                                                  
    233                 $this->ipsclass->DB->build_query( array( 'select'   => 't.*', 
    234                                                                                                  'from'     => array( 'topics' => 't' ), 
    235                                                                                                  'where'    => 't.approved=1 ', //AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')', 
    236                                                                                              'order'    => $options['sort_by'][0].' '.$options['sort_by'][1], 
    237                                                                                                  'limit'    => array( $options['offset'], $options['limit'] ), 
    238                                                                                                  'add_join' => array(  
    239                                                                                                                                           0 => array( 'select' => 'p.*', 
    240                                                                                                                                                                   'from'   => array( 'posts' => 'p' ), 
    241                                                                                                                                                                   'where'  => 't.topic_firstpost=p.pid', 
    242                                                                                                                                                                   'type'   => 'left' ), 
    243                                                                                                                                           1 => array( 'select' => 'm.id as member_id, m.members_display_name as member_name, m.mgroup, m.email', 
    244                                                                                                                                                                   'from'   => array( 'members' => 'm' ), 
    245                                                                                                                                                                   'where'  => "m.id=p.author_id", 
    246                                                                                                                                                                   'type'   => 'left' ), 
    247                                                                                                                                           2 => array( 'select' => 'f.id as forum_id, f.name as forum_name, f.use_html', 
    248                                                                                                                                                                   'from'   => array( 'forums' => 'f' ), 
    249                                                                                                                                                                   'where'  => "t.forum_id=f.id", 
    250                                                                                                                                                                   'type'   => 'left' ) ) 
    251                                                                                 )      ); 
    252                 $this->ipsclass->DB->exec_query(); 
    253                  
    254                 $ezipb_fetch_topic = array(); 
    255                 while( $row = $this->ipsclass->DB->fetch_row() ) { 
    256                         $ezipb_fetch_topic[]    = $row; 
    257                 } 
    258                 return $ezipb_fetch_topic; 
    259         }*/ 
    260197 
    261198} // EOC