Changeset 295

Show
Ignore:
Timestamp:
03/14/07 13:27:59 (2 years ago)
Author:
Atsutane
Message:

Update 0.7.2 with 0.7.3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bbpress-latest-discussion-for-wp/tags/0.7/BBpress.php

    r293 r295  
    55Description: Put bbpress Latest Discussions on your wp page. 
    66Author: Atsutane Shirane 
    7 Version: 0.7.2 
     7Version: 0.7.3 
    88Author URI: http://www.atsutane.net/ 
    99*/ 
    1010 
    1111### BBpress Latest Discussions Version Number 
    12 $BbLD_version = '0.7.2'; 
     12$BbLD_version = '0.7.3'; 
    1313 
    1414if (!defined('ABSPATH')) die("Aren't you supposed to come here via WP-Admin?"); 
     
    140140} 
    141141 
     142### Function: BBpress Latest Discussions Page Display 
    142143function wp_bb_get_discuss() { 
    143144        global $table_prefix,$wpdb; 
     
    194195} 
    195196 
     197### Function: BBpress Latest Discussions Sidebar Display 
    196198function wp_bb_get_discuss_sidebar() { 
    197199        global $table_prefix,$wpdb; 
     
    206208        if ($bbtopic) { 
    207209                echo ' 
    208                         <h2>' . __("Last $forum_slimit Discussions") . '</h2> 
     210                        <h2>' . __("Forum Last $forum_slimit Discussions") . '</h2> 
    209211                        <ul> 
    210212                '; 
     
    243245} 
    244246 
     247### Function: BBpress Latest Discussions Sidebar Widget 
     248function bbld_widget($args) { 
     249        global $table_prefix,$wpdb; 
     250        $forum_slimit = get_option('wpbb_limit'); 
     251        if (get_option('wpbb_exdb')) { 
     252                $exbbdb = new wpdb(get_option('wpbb_dbuser'), get_option('wpbb_dbpass'), get_option('wpbb_dbname'), get_option('wpbb_dbhost')); 
     253                $bbtopic = $exbbdb->get_results("SELECT * FROM ".get_option('wpbb_bbprefix')."topics WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
     254        } 
     255        else { 
     256                $bbtopic = $wpdb->get_results("SELECT * FROM ".get_option('wpbb_bbprefix')."topics WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
     257        } 
     258        if ($bbtopic) { 
     259                extract($args); 
     260                echo $before_widget; 
     261                echo $before_title . __("Forum Last $forum_slimit Discussions") . $after_title; 
     262                echo '<ul>'; 
     263                foreach ( $bbtopic as $bbtopic ) { 
     264                        if (get_option('wpbb_exdb')) { 
     265                                $bbforum = $exbbdb->get_row("SELECT * FROM ".get_option('wpbb_bbprefix')."forums WHERE forum_id = '$bbtopic->forum_id'"); 
     266                        } 
     267                        else { 
     268                                $bbforum = $wpdb->get_row("SELECT * FROM ".get_option('wpbb_bbprefix')."forums WHERE forum_id = '$bbtopic->forum_id'"); 
     269                        } 
     270                        if (get_option('wpbb_permalink')) { 
     271                                echo '<li><a href="' . get_option('wpbb_path') . '/topic/' . $bbtopic->topic_id . '">' . __("$bbtopic->topic_title") . '</a><br />'; 
     272                                $forum_url = get_option('wpbb_path') . '/forum/' . $bbtopic->forum_id; 
     273                        } 
     274                        else { 
     275                                echo '<li><a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '">' . __("$bbtopic->topic_title") . '</a><br />'; 
     276                                $forum_url = get_option('wpbb_path') . '/forum.php?id=/' . $bbtopic->forum_id; 
     277                        } 
     278                        if (get_option('wpbb_intergrated')) { 
     279                                $wpuid = $wpdb->get_row("SELECT * FROM ".$table_prefix."users WHERE user_login = '$bbtopic->topic_last_poster_name'"); 
     280                                if ($wpuid) { 
     281                                        $user_forum_data = "$bbtopic->topic_last_poster_name"; 
     282                                        $user_forum_data = get_userdata($wpuid->ID); 
     283                                        echo '<small>' . __('Last Post By: ') . $user_forum_data->display_name . '<br />' . __('Inside: ') . '<a href="'.$forum_url.'">' . __("$bbforum->forum_name") . '</a></small></li>'; 
     284                                } 
     285                                else { 
     286                                        echo '<small>' . __('Last Post By: ') . $bbtopic->topic_last_poster_name . '<br />' . __('Inside: ') . '<a href="'.$forum_url.'">' . __("$bbforum->forum_name") . '</a></small></li>'; 
     287                                } 
     288                        } 
     289                        else {   
     290                                echo '<small>' . __('Last Post By: ') . $bbtopic->topic_last_poster_name . '<br />' . __('Inside: ') . '<a href="'.$forum_url.'">' . __("$bbforum->forum_name") . '</a></small></li>'; 
     291                        } 
     292                } 
     293                echo "</ul>"; 
     294                echo $after_widget; 
     295        } 
     296} 
     297 
     298### Function: Register BbLD Widget 
     299function bbld_add_widget() { 
     300        if (function_exists('register_sidebar_widget')) { 
     301                register_sidebar_widget('BbLD Widget','bbld_widget'); 
     302        } 
     303} 
     304 
     305### Function: Add BbLD Widget 
     306add_action('init', 'bbld_add_widget'); 
     307 
    245308?> 
  • bbpress-latest-discussion-for-wp/tags/0.7/readme.txt

    r293 r295  
    77 
    88This plugin will generates Latest Discussion list from your bbpress forum into your wordpress page. 
    9  
    10 Discuss about option to exclude or include forum at http://www.atsutane.net/bbpress/topic/4 
    119 
    1210== Description == 
     
    3432 
    3533== Version History == 
     34 
     35Version 0.7.3 (2007-03-14): 
     36 
     37* Add Widget Support :). 
    3638 
    3739Version 0.7.2 (2007-03-12):