| | 191 | |
| | 192 | |
| | 193 | /** |
| | 194 | * Récupération des informations sur des topics |
| | 195 | * |
| | 196 | * @author Guillaume Kulakowski <guillaume_AT_llaumgui_DOT_com> |
| | 197 | * @since 1.0 |
| | 198 | * |
| | 199 | * @return array |
| | 200 | */ |
| | 201 | public function getTopics( $params ) |
| | 202 | { |
| | 203 | $db = eZFluxBBDB::instance(); |
| | 204 | |
| | 205 | |
| | 206 | $topics = $db->arrayQuery( 'SELECT t.id topic_id, t.poster, t.subject, t.num_replies, p.id post_id, p.message ' . |
| | 207 | 'FROM '.$this->fluxBBConfig['db_prefix'].'topics t ' . |
| | 208 | /* TODO : Rendre la jointure paramÚtrable */ |
| | 209 | 'LEFT JOIN '.$this->fluxBBConfig['db_prefix'].'posts p ON (p.topic_id=t.id AND t.posted = p.posted) ' . |
| | 210 | 'WHERE forum_id ' . $params['forum_id'] . ' ' . |
| | 211 | 'ORDER BY ' . $params['sort_by'] .' ' . |
| | 212 | 'LIMIT ' . $params['offset'] . ', ' . $params['limit']); |
| | 213 | |
| | 214 | return $topics; |
| | 215 | } |
| | 216 | |
| | 217 | |
| | 218 | |