Changeset 293

Show
Ignore:
Timestamp:
03/13/07 17:46:16 (2 years ago)
Author:
Atsutane
Message:

Tag 0.7.2 Inside 0.7

Files:

Legend:

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

    r284 r293  
    22/* 
    33Plugin Name: BBpress Latest Discussions 
    4 Plugin URI: http://www.atsutane.net/ 
     4Plugin URI: http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/ 
    55Description: Put bbpress Latest Discussions on your wp page. 
    66Author: Atsutane Shirane 
    7 Version: 0.7 
     7Version: 0.7.2 
    88Author URI: http://www.atsutane.net/ 
    99*/ 
     10 
     11### BBpress Latest Discussions Version Number 
     12$BbLD_version = '0.7.2'; 
    1013 
    1114if (!defined('ABSPATH')) die("Aren't you supposed to come here via WP-Admin?"); 
     
    1922### Function: BBpress Latest Discussions Option 
    2023function wp_bb_option() { 
    21         global $wpdb
     24        global $wpdb,$BbLD_version
    2225        $ori_url = $_SERVER['REQUEST_URI']; 
    2326        if ($_POST['wpbb_save']){ 
     
    3639        } 
    3740        elseif (get_option('wpbb_path') == FALSE) { 
    38                 $bbpath   = '/bbpress'; // Adjust the path to suit your bbpress location. Example: '/forums' 
     41                $bbpath = '/bbpress'; // Adjust the path to suit your bbpress location. Example: '/forums' 
    3942                $wpbburl = get_settings('home') . $bbpath; 
    4043                update_option('wpbb_path', $wpbburl); 
     
    7174?> 
    7275<div class="wrap"> 
    73         <h2>BBpress Latest Discussions</h2> 
    74         <?php if ($update_msg) { echo $update_msg; } ?> 
    75         <p><strong>Plugin Name:</strong> BBpress Latest Discussions<br /> 
    76         <strong>Plugin URI:</strong> <a href="http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/">http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/</a><br /> 
    77         <strong>Author:</strong> <a href="http://www.atsutane.net/">Atsutane Shirane</a><br /> 
    78         <strong>Version:</strong> 0.7</p> 
    79         <p><strong>ToDo List:</strong></p> 
     76        <h2><?php _e('BBpress Latest Discussions'); ?></h2> 
     77        <?php if ($update_msg) { _e("$update_msg"); } ?> 
     78        <p><strong><?php _e('Plugin Name:'); ?></strong> <?php _e('BBpress Latest Discussions'); ?><br /> 
     79        <strong><?php _e('Plugin URI:'); ?></strong> <a href="http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/">http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/</a><br /> 
     80        <strong><?php _e('Author:'); ?></strong> <a href="http://www.atsutane.net/">Atsutane Shirane</a><br /> 
     81        <strong><?php _e('Version:'); ?></strong> <?php echo $BbLD_version; ?></p> 
     82        <p><strong><?php _e('ToDo List:'); ?></strong></p> 
    8083        <ul> 
    81                 <li>Add option to exclude some forum.</li> 
     84                <li><?php _e('Add option to exclude some forum.'); ?> <a href="http://www.atsutane.net/bbpress/topic/4"><?php _e('Discuss here.'); ?></a></li> 
    8285        </ul> 
    83         <p>If you have any suggestion or feedback. Feel free to post it <a href="http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/">here</a>.</p> 
    84         <h2>BBpress Option</h2> 
     86        <p><?php _e('If you have any suggestion or feedback. Feel free to post it'); ?> <a href="http://www.atsutane.net/2006/11/bbpress-latest-discussion-for-wordpress/"><?php _e('here'); ?></a>.</p> 
     87        <h2><?php _e('BBpress Option'); ?></h2> 
    8588        <form method="post" action="<?php echo $ori_url; ?>"> 
    8689                <p class="submit"> 
    87                         <input type="submit" name="wpbb_save" id="wpbb_save" value="Update Option &raquo;"> 
     90                        <input type="submit" name="wpbb_save" id="wpbb_save" value="<?php _e('Update Option &raquo;'); ?>"> 
    8891                </p> 
    8992                <table class="optiontable">  
    9093                        <tr valign="top">  
    91                                 <th scope="row">Bbpress URL:</th>  
     94                                <th scope="row"><?php _e('Bbpress URL:'); ?></th>  
    9295                                <td><input name="bburl" type="text" id="bburl" value="<?php echo get_option('wpbb_path'); ?>" size="40" /></td>  
    9396                        </tr>  
    9497                        <tr valign="top">  
    95                                 <th scope="row">Post Limit:</th>  
    96                                 <td><input name="bblimit" type="text" id="bblimit" value="<?php echo get_option('wpbb_limit'); ?>" size="3" /> posts</td> 
    97                         </tr> 
    98                         <tr valign="top">  
    99                                 <th scope="row">Bbpress DB Prefix:</th>  
    100                                 <td><input name="bbprefix" type="text" id="bbprefix" value="<?php echo get_option('wpbb_bbprefix'); ?>" size="3" /> Bbpress table prefix<br />Enter the table prefix for your bbPress installation above. The table prefix is found in your bbPress installation's config.php file.</td> 
     98                                <th scope="row"><?php _e('Post Limit:'); ?></th>  
     99                                <td><input name="bblimit" type="text" id="bblimit" value="<?php echo get_option('wpbb_limit'); ?>" size="3" /> <?php _e('posts'); ?></td> 
     100                        </tr> 
     101                        <tr valign="top">  
     102                                <th scope="row"><?php _e('Bbpress DB Prefix:'); ?></th>  
     103                                <td><input name="bbprefix" type="text" id="bbprefix" value="<?php echo get_option('wpbb_bbprefix'); ?>" size="3" /> <?php _e('Bbpress table prefix'); ?><br /><?php _e("Enter the table prefix for your bbPress installation above. The table prefix is found in your bbPress installation's config.php file."); ?></td> 
    101104                        </tr> 
    102105                        <tr valign="top"> 
    103                                 <th scope="row">Bbpress Permalink:</th> 
    104                                 <td><label for="wpbb_permalink"><input name="wpbb_permalink" type="checkbox" id="wpbb_permalink" value="wpbb_permalink" <?php if (get_option('wpbb_permalink')) { echo('checked="checked"'); } ?> /> Use Bbpress Permalink</label><br />Only use this if you already enable permalink inside Bbpress config.php</td> 
     106                                <th scope="row"><?php _e('Bbpress Permalink:'); ?></th> 
     107                                <td><label for="wpbb_permalink"><input name="wpbb_permalink" type="checkbox" id="wpbb_permalink" value="wpbb_permalink" <?php if (get_option('wpbb_permalink')) { echo('checked="checked"'); } ?> /> <?php _e('Use Bbpress Permalink'); ?></label><br /><?php _e('Only use this if you already enable permalink inside Bbpress config.php'); ?></td> 
    105108                        </tr> 
    106109                        <tr valign="top"> 
    107                                 <th scope="row">Wordpress/Bbpress Integration:</th> 
    108                                 <td><label for="wpbb_intergrated"><input name="wpbb_intergrated" type="checkbox" id="wpbb_intergrated" value="wpbb_intergrated" <?php if (get_option('wpbb_intergrated')) { echo('checked="checked"'); } ?> /> Intergrated with Wordpress</label><br />Check this option if you intergrated your wordpress installation with bbpress installation.</td> 
     110                                <th scope="row"><?php _e('Wordpress/Bbpress Integration:'); ?></th> 
     111                                <td><label for="wpbb_intergrated"><input name="wpbb_intergrated" type="checkbox" id="wpbb_intergrated" value="wpbb_intergrated" <?php if (get_option('wpbb_intergrated')) { echo('checked="checked"'); } ?> /> <?php _e('Intergrated with Wordpress'); ?></label><br /><?php _e('Check this option if you intergrated your wordpress installation with bbpress installation.'); ?></td> 
    109112                        </tr> 
    110113                        <tr valign="top"> 
    111                                 <th scope="row">External DB:</th> 
    112                                 <td><label for="use_outdb"><input name="use_outdb" type="checkbox" id="use_outdb" value="use_outdb" <?php if (get_option('wpbb_exdb')) { echo('checked="checked"'); } ?> /> Use Different DB</label><br />Only enable this option if your Bbpress database is not the same as Wordpress database.</td> 
    113                         </tr> 
    114                         <tr valign="top">  
    115                                 <th scope="row">Bbpress DB User:</th>  
     114                                <th scope="row"><?php _e('External DB:'); ?></th> 
     115                                <td><label for="use_outdb"><input name="use_outdb" type="checkbox" id="use_outdb" value="use_outdb" <?php if (get_option('wpbb_exdb')) { echo('checked="checked"'); } ?> /> <?php _e('Use Different DB'); ?></label><br /><?php _e('Only enable this option if your Bbpress database is not the same as Wordpress database.'); ?></td> 
     116                        </tr> 
     117                        <tr valign="top">  
     118                                <th scope="row"><?php _e('Bbpress DB User:'); ?></th>  
    116119                                <td><input name="bbuser" type="text" id="bbuser" value="<?php echo get_option('wpbb_dbuser'); ?>" size="40" /> 
    117120                        </tr> 
    118121                        <tr valign="top">  
    119                                 <th scope="row">Bbpress DB Pass:</th>  
     122                                <th scope="row"><?php _e('Bbpress DB Pass:'); ?></th>  
    120123                                <td><input name="bbpass" type="text" id="bbpass" value="<?php echo get_option('wpbb_dbpass'); ?>" size="40" /> 
    121124                        </tr> 
    122125                        <tr valign="top">  
    123                                 <th scope="row">Bbpress DB Name:</th>  
     126                                <th scope="row"><?php _e('Bbpress DB Name:'); ?></th>  
    124127                                <td><input name="bbname" type="text" id="bbname" value="<?php echo get_option('wpbb_dbname'); ?>" size="40" /> 
    125128                        </tr> 
    126129                        <tr valign="top">  
    127                                 <th scope="row">Bbpress DB Host:</th>  
     130                                <th scope="row"><?php _e('Bbpress DB Host:'); ?></th>  
    128131                                <td><input name="bbhost" type="text" id="bbhost" value="<?php echo get_option('wpbb_dbhost'); ?>" size="40" /> 
    129132                        </tr> 
    130133                </table> 
    131134                <p class="submit"> 
    132                         <input type="submit" name="wpbb_save" id="wpbb_save" value="Update Option &raquo;"> 
     135                        <input type="submit" name="wpbb_save" id="wpbb_save" value="<?php _e('Update Option &raquo;'); ?>"> 
    133136                </p> 
    134137        </form> 
     
    140143        global $table_prefix,$wpdb; 
    141144        $forum_slimit = get_option('wpbb_limit'); 
    142         $wpbburl = get_option('wpbb_path'); 
    143         $bbpress_table = get_option('wpbb_bbprefix') . "topics"; 
    144         $wordpress_table = $table_prefix . "users"; 
    145145        if (get_option('wpbb_exdb')) { 
    146146                $exbbdb = new wpdb(get_option('wpbb_dbuser'), get_option('wpbb_dbpass'), get_option('wpbb_dbname'), get_option('wpbb_dbhost')); 
    147                 $bbtopic = $exbbdb->get_results("SELECT * FROM $bbpress_table WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
     147                $bbtopic = $exbbdb->get_results("SELECT * FROM ".get_option('wpbb_bbprefix')."topics WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
    148148        } 
    149149        else { 
    150                 $bbtopic = $wpdb->get_results("SELECT * FROM $bbpress_table WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
     150                $bbtopic = $wpdb->get_results("SELECT * FROM ".get_option('wpbb_bbprefix')."topics WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
    151151        } 
    152152        if ($bbtopic) { 
    153                 echo " 
    154                         <div id=\"discussions\"> 
    155                         <h2>Discussion Forum</h2> 
    156                         <table id=\"latest\"> 
     153                echo ' 
     154                        <div id="discussions"> 
     155                        <h2>' . __("Discussion Forum") . '</h2> 
     156                        <table id="latest"> 
    157157                                <tr> 
    158                                         <th>Topic</th> 
    159                                         <th>Posts</th> 
    160                                         <th>Last Poster</th> 
     158                                        <th>' . __("Topic") . '</th> 
     159                                        <th>' . __("Posts") . '</th> 
     160                                        <th>' . __("Last Poster") . '</th> 
    161161                                </tr> 
    162                 "
     162                '
    163163                foreach ( $bbtopic as $bbtopic ) { 
    164164                        echo " 
     
    166166                        "; 
    167167                        if (get_option('wpbb_permalink')) { 
    168                                 echo "<td><a href=\"$wpbburl/topic/$bbtopic->topic_id\">$bbtopic->topic_title</a></td>"; 
    169                         } 
    170                         else { 
    171                                 echo "<td><a href=\"$wpbburl/topic.php?id=$bbtopic->topic_id\">$bbtopic->topic_title</a></td>"; 
    172                         } 
    173                         echo " 
    174                                         <td class=\"num\">$bbtopic->topic_posts</td> 
    175                         "; 
     168                                echo '<td><a href="' . get_option('wpbb_path') . '/topic/' . $bbtopic->topic_id . '">' . __("$bbtopic->topic_title") . '</a></td>'; 
     169                        } 
     170                        else { 
     171                                echo '<td><a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '">' . __("$bbtopic->topic_title") . '</a></td>'; 
     172                        } 
     173                        echo '<td class="num">' . __("$bbtopic->topic_posts") . '</td>'; 
    176174                        if (get_option('wpbb_intergrated')) { 
    177                                 $wpuid = $wpdb->get_row("SELECT * FROM $wordpress_table WHERE user_login = '$bbtopic->topic_last_poster_name'"); 
     175                                $wpuid = $wpdb->get_row("SELECT * FROM ".$table_prefix."users WHERE user_login = '$bbtopic->topic_last_poster_name'"); 
    178176                                if ($wpuid) { 
    179177                                        $user_forum_data = "$bbtopic->topic_last_poster_name"; 
    180178                                        $user_forum_data = get_userdata($wpuid->ID); 
    181                                         echo "<td class=\"num\">$user_forum_data->display_name</td>"
     179                                        echo '<td class="num">' . __("$user_forum_data->display_name") . '</td>'
    182180                                } 
    183181                                else { 
    184                                         echo "<td class=\"num\">$bbtopic->topic_last_poster_name</td>"
    185                                 } 
    186                         } 
    187                         else { 
    188                                 echo "<td class=\"num\">$bbtopic->topic_last_poster_name</td>"
     182                                        echo '<td class="num">' . __("$bbtopic->topic_last_poster_name") . '</td>'
     183                                } 
     184                        } 
     185                        else { 
     186                                echo '<td class="num">' . __("$bbtopic->topic_last_poster_name") . '</td>'
    189187                        } 
    190188                        echo " 
     
    198196function wp_bb_get_discuss_sidebar() { 
    199197        global $table_prefix,$wpdb; 
    200         $bbpress_table = get_option('wpbb_bbprefix') . "topics"; 
    201         $wordpress_table = $table_prefix . "users"; 
    202198        $forum_slimit = get_option('wpbb_limit'); 
    203         $wpbburl = get_option('wpbb_path'); 
    204199        if (get_option('wpbb_exdb')) { 
    205200                $exbbdb = new wpdb(get_option('wpbb_dbuser'), get_option('wpbb_dbpass'), get_option('wpbb_dbname'), get_option('wpbb_dbhost')); 
    206                 $bbtopic = $exbbdb->get_results("SELECT * FROM $bbpress_table WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
     201                $bbtopic = $exbbdb->get_results("SELECT * FROM ".get_option('wpbb_bbprefix')."topics WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
    207202        } 
    208203        else { 
    209                 $bbtopic = $wpdb->get_results("SELECT * FROM $bbpress_table WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
     204                $bbtopic = $wpdb->get_results("SELECT * FROM ".get_option('wpbb_bbprefix')."topics WHERE topic_status = 0 ORDER BY topic_time DESC LIMIT $forum_slimit"); 
    210205        } 
    211206        if ($bbtopic) { 
    212                 echo " 
    213                         <h2>Last $forum_slimit Discussions</h2> 
     207                echo ' 
     208                        <h2>' . __("Last $forum_slimit Discussions") . '</h2> 
    214209                        <ul> 
    215                 "
     210                '
    216211                foreach ( $bbtopic as $bbtopic ) { 
     212                        if (get_option('wpbb_exdb')) { 
     213                                $bbforum = $exbbdb->get_row("SELECT * FROM ".get_option('wpbb_bbprefix')."forums WHERE forum_id = '$bbtopic->forum_id'"); 
     214                        } 
     215                        else { 
     216                                $bbforum = $wpdb->get_row("SELECT * FROM ".get_option('wpbb_bbprefix')."forums WHERE forum_id = '$bbtopic->forum_id'"); 
     217                        } 
    217218                        if (get_option('wpbb_permalink')) { 
    218                                 echo "<li><a href=\"$wpbburl/topic/$bbtopic->topic_id\">$bbtopic->topic_title</a><br />"; 
    219                         } 
    220                         else { 
    221                                 echo "<li><a href=\"$wpbburl/topic.php?id=$bbtopic->topic_id\">$bbtopic->topic_title</a><br />"; 
     219                                echo '<li><a href="' . get_option('wpbb_path') . '/topic/' . $bbtopic->topic_id . '">' . __("$bbtopic->topic_title") . '</a><br />'; 
     220                                $forum_url = get_option('wpbb_path') . '/forum/' . $bbtopic->forum_id; 
     221                        } 
     222                        else { 
     223                                echo '<li><a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '">' . __("$bbtopic->topic_title") . '</a><br />'; 
     224                                $forum_url = get_option('wpbb_path') . '/forum.php?id=/' . $bbtopic->forum_id; 
    222225                        } 
    223226                        if (get_option('wpbb_intergrated')) { 
    224                                 $wpuid = $wpdb->get_row("SELECT * FROM $wordpress_table WHERE user_login = '$bbtopic->topic_last_poster_name'"); 
     227                                $wpuid = $wpdb->get_row("SELECT * FROM ".$table_prefix."users WHERE user_login = '$bbtopic->topic_last_poster_name'"); 
    225228                                if ($wpuid) { 
    226229                                        $user_forum_data = "$bbtopic->topic_last_poster_name"; 
    227230                                        $user_forum_data = get_userdata($wpuid->ID); 
    228                                         echo "<small>Last Post By: $user_forum_data->display_name</small></li>"
     231                                        echo '<small>' . __('Last Post By: ') . $user_forum_data->display_name . '<br />' . __('Inside: ') . '<a href="'.$forum_url.'">' . __("$bbforum->forum_name") . '</a></small></li>'
    229232                                } 
    230233                                else { 
    231                                         echo "<small>Last Post By: $bbtopic->topic_last_poster_name</small></li>"
     234                                        echo '<small>' . __('Last Post By: ') . $bbtopic->topic_last_poster_name . '<br />' . __('Inside: ') . '<a href="'.$forum_url.'">' . __("$bbforum->forum_name") . '</a></small></li>'
    232235                                } 
    233236                        } 
    234237                        else {   
    235                                 echo "<small>Last Post By: $bbtopic->topic_last_poster_name</small></li>"
     238                                echo '<small>' . __('Last Post By: ') . $bbtopic->topic_last_poster_name . '<br />' . __('Inside: ') . '<a href="'.$forum_url.'">' . __("$bbforum->forum_name") . '</a></small></li>'
    236239                        } 
    237240                } 
  • bbpress-latest-discussion-for-wp/tags/0.7/readme.txt

    r284 r293  
    11=== Bbpress Latest Discussion === 
    22Tags: bbpress, wordpress, latest, discussion 
    3 Contributors: Atsutane Shirane 
     3Contributors: Atsutane 
    44Requires at least: 0.8 
    55Tested up to: 0.8 
    6 Stable Tag: 0.8 
     6Stable Tag: 0.7 
    77 
    88This plugin will generates Latest Discussion list from your bbpress forum into your wordpress page. 
     9 
     10Discuss about option to exclude or include forum at http://www.atsutane.net/bbpress/topic/4 
    911 
    1012== Description == 
     
    3234 
    3335== Version History == 
     36 
     37Version 0.7.2 (2007-03-12): 
     38 
     39* Add Category link in sidebar list. 
     40* Optimize the code a little. 
     41 
     42Version 0.7.1 (2007-03-11): 
     43 
     44* Add Multi Lang Support. 
    3445 
    3546Version 0.7 (2007-03-09):