Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/28/2004 09:56:41 PM (18 years ago)
Author:
matt
Message:

Added RSS support, used gmdate everywhere. Fixes #3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/functions.php

    r18 r21  
    1919}
    2020
    21 function get_thread( $topic, $page = 0 ) {
    22     global $bbdb, $bb;
     21function get_thread( $topic, $page = 0, $reverse = 0 ) {
     22    global $bbdb;
    2323
    2424    $limit = bb_get_option('page_topics');
    2525    if ( $page )
    2626        $limit = ($limit * $page) . ", $limit";
    27     return $bbdb->get_results("SELECT * FROM $bbdb->posts WHERE topic_id = $topic ORDER BY post_time ASC LIMIT $limit");
     27    $order = ($reverse) ? 'DESC' : 'ASC';
     28
     29    return $bbdb->get_results("SELECT * FROM $bbdb->posts WHERE topic_id = $topic ORDER BY post_time $order LIMIT $limit");
    2830}
    2931
     
    4244        $limit = ($limit * $page) . ", $limit";
    4345    return $bbdb->get_results("SELECT * FROM $bbdb->topics $where ORDER BY topic_time DESC LIMIT $limit");
     46}
     47
     48function get_latest_posts( $num ) {
     49    global $bbdb;
     50    $num = (int) $num;
     51    return $bbdb->get_results("SELECT * FROM $bbdb->posts ORDER BY post_time DESC LIMIT $num");
    4452}
    4553
Note: See TracChangeset for help on using the changeset viewer.