Skip to:
Content

Changeset 1700


Ignore:
Timestamp:
09/11/08 16:31:13 (6 years ago)
Author:
sambauers
Message:

Allow bb_get_tag_link() accept an object in the first parameter. Deprecate last instances of bb_get_tag_by_name(). Fixes #957

Location:
trunk
Files:
4 edited

Legend:

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

    r1619 r1700  
    369369function get_tag_by_name( $tag ) { 
    370370    bb_log_deprecated('function', __FUNCTION__, 'bb_get_tag_by_name'); 
    371     return bb_get_tag_by_name( $tag ); 
     371    return bb_get_tag( $tag ); 
    372372} 
    373373endif; 
  • trunk/bb-includes/functions.php

    r1699 r1700  
    25612561                global $tag, $tag_name; 
    25622562                $tag_name = $id; 
    2563                 $tag = bb_get_tag_by_name( $tag_name ); 
     2563                $tag = bb_get_tag( $tag_name ); 
    25642564                $permalink = bb_get_tag_link( 0, $page ); // 0 => grabs $tag from global. 
    25652565            } 
     
    31833183 
    31843184    global $bbdb, $tag; 
    3185     if ( is_numeric($_tag) ) 
     3185    if ( false === $_tag ) 
     3186        $_tag = $tag; 
     3187    else 
    31863188        $_tag = bb_get_tag( $_tag ); 
    3187     elseif ( is_string($_tag) ) 
    3188         $_tag = bb_get_tag_by_name( $_tag ); 
    3189     elseif ( false === $_tag ) 
    3190         $_tag = $tag; 
    31913189 
    31923190    if ( !$_tag ) 
  • trunk/bb-includes/template-functions.php

    r1699 r1700  
    12211221    if ( $forum && $forum = get_forum( $forum ) ) 
    12221222        $url = get_forum_link( $forum->forum_id ) . '#postform'; 
    1223     elseif ( $tag && ( ( is_numeric($tag) && $tag = bb_get_tag( $tag ) ) || $tag = bb_get_tag_by_name( $tag ) ) ) 
     1223    elseif ( $tag && $tag = bb_get_tag( $tag ) ) 
    12241224        $url = bb_get_tag_link( $tag->tag ) . '#postform'; 
    12251225    elseif ( is_forum() || is_bb_tag() ) 
     
    21592159    global $tag; 
    21602160    if ( $tag_name ) 
    2161         $_tag = bb_get_tag_by_name( $tag_name ); 
     2161        if ( is_object($tag_name) ) 
     2162            $_tag = $tag_name; 
     2163        else 
     2164            $_tag = bb_get_tag( $tag_name ); 
    21622165    else 
    21632166        $_tag =& $tag; 
     
    22052208    $tag_id = (int) $tag_id; 
    22062209    if ( $tag_id ) 
    2207         $_tag = bb_get_tag( $tag_id ); 
     2210        if ( is_object($tag_id) ) 
     2211            $_tag = $tag_id; 
     2212        else 
     2213            $_tag = bb_get_tag( $tag_id ); 
    22082214    else 
    22092215        $_tag =& $tag; 
     
    24032409    foreach ( (array) $tags as $tag ) { 
    24042410        $counts{$tag->raw_tag} = $tag->tag_count; 
    2405         $taglinks{$tag->raw_tag} = bb_get_tag_link( $tag->tag ); 
     2411        $taglinks{$tag->raw_tag} = bb_get_tag_link( $tag ); 
    24062412    } 
    24072413 
  • trunk/rss.php

    r1682 r1700  
    102102         
    103103        case 'tag': 
    104             if ( !$tag = bb_get_tag_by_name( $feed_id ) ) 
     104            if ( !$tag = bb_get_tag( $feed_id ) ) 
    105105                die(); 
    106106            if ( !$posts = get_tagged_topic_posts( $tag->tag_id, 0 ) ) 
Note: See TracChangeset for help on using the changeset viewer.