Skip to:
Content

bbPress.org

Changeset 136


Ignore:
Timestamp:
06/09/2005 10:41:09 PM (21 years ago)
Author:
mdawaffe
Message:

Do not grab stickies with get_latest_topics when is_forum() (by default - can pass argument to configure). Fixes #50.

File:
1 edited

Legend:

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

    r130 r136  
    4747}
    4848
    49 function get_latest_topics( $forum = 0, $page = 0, $exclude = '' ) {
     49function get_latest_topics( $forum = 0, $page = 0, $exclude = '', $with_stick = '' ) {
     50    // with_stick defaults:  get stickies on everything but forum page.  with_stick accepts: boolean
    5051    global $bbdb, $bb;
    5152    $where = $limit = '';
     
    5455    if ( !empty( $exclude ) )
    5556        $where .= " AND forum_id NOT IN ('$exclude') ";
     57    if ( false === $with_stick || ( is_forum() && $with_stick !== true ) )
     58        $where .= " AND topic_sticky <> '1' ";
    5659    $limit = bb_get_option('page_topics');
    5760    if ( $page )
     
    6063}
    6164
    62 function get_sticky_topics( $forum = 0, $page = 0, $exclude = '' ) {
     65function get_sticky_topics( $forum = 0, $page = 0 ) {
    6366    global $bbdb, $bb;
    6467    $where = '';
Note: See TracChangeset for help on using the changeset viewer.