Plugin Directory

Changeset 204575


Ignore:
Timestamp:
02/12/2010 02:52:41 PM (16 years ago)
Author:
DeannaS
Message:

Widgets updated to new API, readme updated to reflect new info.

Location:
blog-topics/branches/3.0
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • blog-topics/branches/3.0/cets_blog_topics/miscactions.php

    r204190 r204575  
    2626   
    2727    ?>
    28 <h3>Blog Topic Options</h3>
     28<tr>
     29<td colspan="2">       
     30<h4>Blog Topic Options</h4>
    2931<table class="form-table">
    3032<tr>
     
    3436<th>Privacy</th>
    3537<td>
    36 <input type='radio' name='cets_topicexclude' value='0'<?php if( $excluded == '0' || strlen($excluded) == 0 ) echo " checked"?>> <?php _e('Include this blog in topics aggregation') ?>&nbsp;&nbsp;
     38<input type='radio' name='cets_topicexclude' value='0'<?php if( $excluded == '0' || strlen($excluded) == 0 ) echo " checked"?> /> <?php _e('Include this blog in topics aggregation') ?>&nbsp;&nbsp;
    3739<br />
    38 <input type='radio' name='cets_topicexclude' value='1'<?php if( $excluded == 1 ) echo " checked"?>> <?php _e('Exclude this blog from topics aggregation') ?>&nbsp;&nbsp;   
     40<input type='radio' name='cets_topicexclude' value='1'<?php if( $excluded == 1 ) echo " checked"?> /> <?php _e('Exclude this blog from topics aggregation') ?>&nbsp;&nbsp; 
    3941</td>
    4042</tr>
    4143</table>
     44</td>
     45</tr>
     46<tr><td colspan="2"><hr/></td></tr>
     47
    4248    <?php
    4349}
  • blog-topics/branches/3.0/cets_bt_featured_topic_with_posts_widget.php

    r204310 r204575  
    4444        $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']);
    4545        $defaults = array(
    46             'title' => 'Latest Posts', 'postrows' => 5
     46            'title' => 'Latest Posts', 'postrows' => 5, 'include_portal' => 0
    4747        );
    4848       
    4949       
    5050        $args = wp_parse_args( $options, $defaults );
     51        if ($args['include_portal'] != 1) $args['include_portal = 0'];
    5152       
    5253       
     
    5758       
    5859        // get the featured topic
    59         $topic = cets_get_featured_topic();
    60        
     60        $topic_id = cets_get_featured_topic();
     61        $topic = cets_get_topic($topic_id);
    6162           
    6263        echo $before_widget;
     
    6465       
    6566        echo("<div class='topicListing " . $topic->slug . "'>");
    66         echo ("<h3><a href='topic/" . strtolower($topic->slug) . "'>" . $topic->topic_name . "</a></h3>");
     67        if ($args['include_portal'] == 1){
     68            echo ("<h3><a href='topic/" . strtolower($topic->slug) . "'>" . $topic->topic_name . "</a></h3>");
     69        }
     70        else {
     71            echo ("<h3>" . $topic->topic_name . "</h3>");
     72        }
     73       
    6774        echo ("<ul>");
    68         echo (cets_get_recent_posts_from_topic_id_html($topic, $args['postrows'], 0));
     75        echo (cets_get_recent_posts_from_topic_id_html($topic_id, $args['postrows'], 0));
    6976        echo ("</ul>");
    70         echo ("<div class='topicMore'>");
    71         echo ("<a href='/topic/" . strtolower($topic->slug) . "'>(More " . $topic->slug . " Posts</a> | <a href='/sites/" . strtolower($topic->slug) . "'>All " . $topic->slug . " Sites)</a>");
    72         echo ("</div>");
     77        if ($args['include_portal'] == 1){
     78            echo ("<div class='topicMore'>");
     79            echo ("<a href='/topic/" . strtolower($topic->slug) . "'>(More " . $topic->slug . " Posts</a> | <a href='/sites/" . strtolower($topic->slug) . "'>All " . $topic->slug . " Sites)</a>");
     80            echo ("</div>");
     81        }
     82       
    7383        echo ("</div>");
    7484               
     
    107117            'title' => $topic, 'postrows' => 5
    108118            );
    109            
     119       
     120        $instance = wp_parse_args( $instance, $defaults ); 
    110121        $title = esc_attr($instance['title']);
    111122        $postrows = esc_attr($instance['postrows'] );
     
    125136        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
    126137        <p><label for="<?php echo $this->get_field_id('postrows'); ?>"><?php _e('# of Posts to Include:'); ?> <input size="5" id="<?php echo $this->get_field_id('postrows'); ?>" name="<?php echo $this->get_field_name('postrows'); ?>" type="text" value="<?php echo $postrows; ?>" /></label></p>
    127                    
     138            <p><label for="<?php echo $this->get_field_id('include_portal'); ?>"><?php _e('Include Portal Links'); ?> <input  id="<?php echo $this->get_field_id('include_portal'); ?>" name="<?php echo $this->get_field_name('include_portal'); ?>" type="checkbox" value="1" <?php if ($instance['include_portal'] == 1) {echo 'checked="checked"';}?>/></label></p>     
    128139    <?php
    129140        }
  • blog-topics/branches/3.0/cets_bt_related_posts_widget.php

    r204310 r204575  
    4444        $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']);
    4545        $defaults = array(
    46             'title' => 'Related Posts', 'postrows' => 10
     46            'title' => 'Related Posts', 'postrows' => 10, 'include_portal' => 0
    4747        );
    4848       
     
    5757        }
    5858       
     59        if ($args['include_portal'] != 1) $args['include_portal = 0'];
     60       
    5961        // get the topic id from the blogid
    6062        $topic_id = cets_get_topic_id_from_blog_id($blog_id);
    61         // get the topic info
    62         $topic = cets_get_topic($topic_id);
     63       
    6364       
    6465           
     
    6869            cets_get_recent_posts_from_topic_id_html($topic_id, $postrows, $blog_id);
    6970            echo ("</ul>");
    70             echo ("<div class='topicMore'>");
    71             echo ("<a href='/topic/" . strtolower($topic->slug) . "'>(More " . $topic->slug . " Posts</a> | <a href='/sites/" . strtolower($topic->slug) . "'>All " . $topic->slug . " Sites)</a>");
    72             echo ("</div>");   
     71           
     72            if ($args['include_portal'] == 1){
     73                // get the topic info
     74                $topic = cets_get_topic($topic_id);
     75                echo ("<div class='topicMore'>");
     76                echo ("<a href='/topic/" . strtolower($topic->slug) . "'>(More " . $topic->slug . " Posts</a> | <a href='/sites/" . strtolower($topic->slug) . "'>All " . $topic->slug . " Sites)</a>");
     77                echo ("</div>");
     78            }   
    7379        echo $after_widget;
    7480       
     
    8288        $instance['title'] = strip_tags(stripslashes($new_instance['title']));
    8389        $instance['postrows'] = strip_tags(stripslashes($new_instance['postrows']));
     90        $instance['include_portal'] = $new_instance['include_portal'];
    8491               
    8592        return $new_instance;
     
    93100        // Set defaults
    94101        $defaults = array(
    95             'title' => $topic, 'postrows' => 10
     102            'title' => $topic, 'postrows' => 10, 'include_portal' => 0
    96103            );
    97            
     104        $instance = wp_parse_args( $instance, $defaults ); 
    98105        $title = esc_attr($instance['title']);
    99106        $postrows = esc_attr($instance['postrows']);
     107        $include_portal = $instance['include_portal'];
    100108       
    101109       
    102        
    103    
    104110        ?>
    105111        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
    106112        <p><label for="<?php echo $this->get_field_id('postrows'); ?>"><?php _e('# of Posts to Include:'); ?> <input size="5" id="<?php echo $this->get_field_id('postrows'); ?>" name="<?php echo $this->get_field_name('postrows'); ?>" type="text" value="<?php echo $postrows; ?>" /></label></p>
    107                    
     113        <p><label for="<?php echo $this->get_field_id('include_portal'); ?>"><?php _e('Include Portal Links'); ?> <input  id="<?php echo $this->get_field_id('include_portal'); ?>" name="<?php echo $this->get_field_name('include_portal'); ?>" type="checkbox" value="1" <?php if ($instance['include_portal'] == 1) {echo 'checked="checked"';}?>/></label></p>         
    108114    <?php
    109115       
  • blog-topics/branches/3.0/cets_bt_topicname_widget.php

    r204310 r204575  
    4545        $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']);
    4646        $defaults = array(
    47             'title' => 'Related Blogs', 'description' => 0
     47            'title' => 'Related Blogs', 'description' => 0, 'include_portal' => 0
    4848        );
    4949       
     
    5151        $args = wp_parse_args( $options, $defaults );
    5252       
     53        if ($args['include_portal'] != 1) $args['include_portal'] = 0;
    5354       
    5455        // get the topic id from the blogid
     
    5960           
    6061        echo $before_widget;
    61         echo $before_title . $args['title'] . $after_title;     
    62         echo  ("<a href='/topic/" . strtolower($topic->slug) . "'>" . $topic->topic_name . "</a>");
     62        echo $before_title . $args['title'] . $after_title;
     63        if ($args['include_portal'] == 1){
     64            echo  ("<a href='/topic/" . strtolower($topic->slug) . "'>" . $topic->topic_name . "</a>");
     65        }   
     66        else {
     67            echo  ( $topic->topic_name );
     68        }
     69       
    6370            if ($options['description'] == TRUE) {
    6471                echo  ("<div>" . $topic->description . "</div>");
     
    7683        $instance['title'] = strip_tags(stripslashes($new_instance['title']));
    7784        $instance['description'] = strip_tags(stripslashes($new_instance['description']));
    78                
     85        $instance['include_portal'] = $new_instance['include_portal'];     
    7986        return $new_instance;
    8087    }
     
    8794        // Set defaults
    8895        $defaults = array(
    89             'title' => $topic, 'description' => 0
     96            'title' => 'Topic Name', 'description' => 0
    9097            );
    91            
     98        $instance = wp_parse_args( $instance, $defaults ); 
    9299        $title = esc_attr($instance['title']);
    93100       
     
    99106        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
    100107        <p><label for="<?php echo $this->get_field_id('description'); ?>"><?php _e('Include Description'); ?> <input  id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>" type="checkbox" value="1" <?php if ($instance['description'] == 1) {echo 'checked="checked"';}?>/></label></p>
    101                    
     108        <p><label for="<?php echo $this->get_field_id('include_portal'); ?>"><?php _e('Include Portal Links'); ?> <input  id="<?php echo $this->get_field_id('include_portal'); ?>" name="<?php echo $this->get_field_name('include_portal'); ?>" type="checkbox" value="1" <?php if ($instance['include_portal'] == 1) {echo 'checked="checked"';}?>/></label></p>         
    102109    <?php
    103110       
  • blog-topics/branches/3.0/cets_bt_topics_with_posts_widget.php

    r204310 r204575  
    4545        $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']);
    4646        $defaults = array(
    47             'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array()
     47            'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array(), 'include_portal' => 0
    4848        );
    4949       
     
    5151        $args = wp_parse_args( $options, $defaults );
    5252       
    53        
     53           
    5454        if (!is_numeric($args['postrows'])){
    5555            $args['postrows'] = $defaults['postrows'];
    5656            }
     57        if ($args['include_portal'] != 1) $args['include_portal'] = 0;
    5758       
    5859       
     
    6566        foreach($topics as $topic) {
    6667                    if (!in_array($topic->id, $args['exclude'])){ //is not in the array of excluded ones
     68                       
    6769                        echo("<div class='topicListing " . $topic->slug . "'>");
    68                         echo ("<h3><a href='topic/" . strtolower($topic->slug) . "'>" . $topic->topic_name . "</a></h3>");
     70                        if ($args['include_portal']){
     71                            echo ("<h3><a href='topic/" . strtolower($topic->slug) . "'>" . $topic->topic_name . "</a></h3>");
     72                        }
     73                        else {
     74                            echo ("<h3>" . $topic->topic_name . "</h3>");
     75                        }
     76                       
    6977                        echo ("<ul>");
    7078                        echo (cets_get_recent_posts_from_topic_id_html($topic->id, $args['postrows'], 0));
    7179                        echo ("</ul>");
    72                         echo ("<div class='topicMore'>");
    73                         echo ("<a href='/topic/" . strtolower($topic->slug) . "'>(More " . $topic->slug . " Posts</a> | <a href='/sites/" . strtolower($topic->slug) . "'>All " . $topic->slug . " Sites)</a>");
    74                         echo ("</div>");
    75                         echo ("</div>");
    76                
     80                        if ($args['include_portal']){
     81                            echo ("<div class='topicMore'>");
     82                            echo ("<a href='/topic/" . strtolower($topic->slug) . "'>(More " . $topic->slug . " Posts</a> | <a href='/sites/" . strtolower($topic->slug) . "'>All " . $topic->slug . " Sites)</a>");
     83                            echo ("</div>");
     84                           
     85                        }
     86                    echo ("</div>");
    7787                    }// end if
    7888                }
     
    95105       
    96106        $instance['exclude'] = strip_tags($new_instance['exclude']);
    97 
     107        $instance['include_portal'] = $new_instance['include_portal'];
    98108       
    99109                   
     
    110120        // Set defaults
    111121        $defaults = array(
    112             'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array()
     122            'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array(), 'include_portal' => 0
    113123            );
    114            
     124        $instance = wp_parse_args( $instance, $defaults ); 
    115125        $title = esc_attr($instance['title']);
    116126        $postrows = esc_attr($instance['postrows'] );
     127        $include_portal = $instance['include_portal'];
    117128        $exclude = $instance['exclude'] ;
    118129        if (!is_numeric($postrows)) $postrows = $defaults['postrows'];
     
    130141    <?php foreach ($topics as $topic){ ?>
    131142    <input type="checkbox" name="<?php echo ( 'widget-' . $this->id_base . '[' . $this->number . '][exclude][]'); ?>" id="<?php echo $this->get_field_id('exclude'. '_$topic->id') ; ?>" value="<?php echo $topic->id; ?>" <?php if (in_array($topic->id, $exclude)) { echo 'checked="checked"';}?> > <?php echo $topic->topic_name; ?> <br/>
    132    
    133    
    134143    <?php } ?>
    135144    </label>
     145    <p><label for="<?php echo $this->get_field_id('include_portal'); ?>"><?php _e('Include Portal Links'); ?> <input  id="<?php echo $this->get_field_id('include_portal'); ?>" name="<?php echo $this->get_field_name('include_portal'); ?>" type="checkbox" value="1" <?php if ($instance['include_portal'] == 1) {echo 'checked="checked"';}?>/></label></p>
    136146           
    137147       
  • blog-topics/branches/3.0/readme.txt

    r204190 r204575  
    33Author URI: http://deannaschneider.wordpress.com
    44Tags: WPMU site-wide topics, WMPU site-wide categories, WordPress MU, Wordpress Multiuser
    5 Requires at least: 2.6.3
    6 Tested up to: 2.6.3
     5Requires at least: 2.9
     6Tested up to: 2.9.1.1
    77Stable tag: trunk
    88
     
    1212
    1313== Description ==
    14 Included files:
    1514
    16 * cets_blogtopics.php (The main plugin file.)
    17 * cets_blogtopics-widget.php (The optional widget file.)
    18 * cets_blog_topics_page.php (An optional "portal" page.)
    19 * cets_blog_topics_list.php (An optional page to show all blogs by topic id - required if you use cets_blog_topics_page.php or the widget.
     15This plugin creates site-wide topics. Each blog can be identified as belonging to a single topic. Blog owners can select a topic for their blog at creation time, and through a menu under settings. Blog owners can also choose whether or not to include their content in any site-wide aggregated content via the Blog Topics Settings menu.
    2016
    21 This plugin does the following:
     17Site Admins can set up the site-wide topics, select a "featured topic," and manage blog's topic settings through the Site Admin -> Blogs -> Edit menu.
    2218
    23 1. Adds 2 tables to the database - one to store sitewide topics and another to track blog/topic relationships.
    24 2. Defaults all blogs to topic id 1 (defaulted to "uncategorized")
    25 3. Adds a topic chooser to the blog registration form.
    26 4. Adds a sub-menu to the site admin screen to allow adding/editing/deleting of sitewide topics.
    27 5. Adds a sub-menu to the blog settings admin screen to allow blog administrators to change the topic (but not add or edit site-wide topics).
     19This plugin comes with 5 optional widgets.
    2820
    29 Also provided, but not required is a blog topics widget. The blog topics widget is 3 widgets in 1.
     211. BT - Topic Name - displays the name of the topic of the current blog.
     222. BT - Related Blogs - displays a linked list of other blogs in the same topic.
     233. BT - Related Posts - displays the title of the N most recent posts in the same topic as the current blog.
     244. BT - Featured Topic w/Posts - displays the N most recent posts from the "featured" topic.
     255. BT - Topics w/Posts - displays the N most recent posts from each topic, with the option of excluding selected topics.
    3026
    31 1. Display Blog Topics Name
    32 2. Display related blogs.
    33     The section will display linked titles of the most recently updated blogs (date descending order) that belong to the same topic as the calling blog. Users can specify the max number to display.
    34 3. Display related posts.
    35     This section will display linked titles to the most recently updated pasts (date descending order) that belong to blogs of the same topic as the calling blog. Users can select the max number to display. If no max is specified, list will show 10 posts.
     27Some of the widgets rely on theme code for topic listing pages and site listing pages, referred to as "portal links." All portal links can be turned on and off in the widgets. This plugin comes with a sample theme to help you learn how to modify your own theme to incorporate the portal elements.
    3628
    37 The two other optional files provide "portal-like" capabilities. Both of these pages use the Default Wordpress MU template.
    38 
    39 1. front-page.php displays a linked list of all the used topics in the site.
    40 2. blog_topics.php displays all the blogs by topic id.
    4129
    4230== Installation ==
    4331
    44 1. Place the cets_blogtopics.php file in the wp-content/mu-plugins folder.
    45 2. If desired, place the cets_blogtopics-widget.php file in the wp-content/mu-plugins folder.
    46 3. If you use the widget, you MUST also place the cets_blog_topics_list.php file in the root of your site. (Widget references to the topic link to this file.)
    47 4. Go to Site Admin -> Blog Topics Management to add/edit topics
     321. Place the cets_blogtopics.php file and the cets_blog_topics folder in the wp-content/mu-plugins folder.
     332. If desired, place the widget files in the wp-content/mu-plugins or the plugins folder. It's recommended that you use the plugins folder and only enable these widgets on blogs that need them. They may be confusing for some users.
     344. Go to Site Admin -> Blog Topics Management to add/edit topics. You should enter a name and slug for each topic you wish to use. Description is optional. It is used in the BT Topic Name widget and in the example theme code.
    48355. Blog admins can go to Settings -> Blog Topic to edit their assigned topic.
    4936
    5037If Use of the Portal Aspects are desired
    51 1. Put cets_blog_topics_page.php in your theme directory. Note that it is currently set up for the Default WPMU theme. You may need to customize the wrapping code to fit with whichever theme you are using.
    52 2. Put cets_blog_topics_list.php in the root of the site. Note that it is currently set up for the Default WPMU theme. You may need to customize the wrapping code to fit with whichever theme you are using.
    53 3. On the mother blog, create a page that uses the "Blog Topics" template. Select Settings -> Reading and select that page as the "static" page to use for your main page.
     38
     391. By default, none of the widgets use the portal links. If you want to use the portal links, examine the sample theme. The most relevant bits of code are in rewrites.php, topics.php, and sites.php. The portal code rewrites links such as ?topic_id=1 to /topic/slug.
     40
     41
    5442
    5543== Frequently Asked Questions ==
    56 1. Can I upgrade from the certi_blog_categories plugin?
    57 The certi_blog_categories plugin holds category information for each blog in each blog's options table. You could do some sql magic and migrate the data. But, it's not supported.
     441. Can I upgrade from version 0.3.2 to 3.0?
     45The plugin will attempt to upgrade your database tables from the previous version of this plugin. There are elements from the previous version that are no longer supported, particularly the portal elements. If you had previously used cets_blog_topics_page.php or cets_blog_topics_list.php you will want to carefully examine the sample theme to determine how to integrate the new portal elements into your blog's theme code.
    5846
    59 == Upgrade from .1 to .2 ==
    60 1. Replace existing files with new ones.
    61 2. Delete old front-page.php from your theme directory. Replace it with cets_blog_topics_page.php.
    62 3. Delete old blog_topics.php file from your main directory. Replace it with cets_blog_topics_list.php
    6347
    64 == Upgrade for 2.6.3 ==
    65 1. Replace cets_blogtopics.php with .3.1 version.
    6648
    67 == Version History ==
     49== CHANGELOG ==
     50
     513.0
     52
     53* major overhaul of portal aspects
     54* addition of several columns to database tables
     55* incorporation of "featured" topic
     56
     57
    6858.3.2
    6959* Fixed bug that prevented initially signing up users from setting blog topic.
     
    8474* fixed bug to not include Donncha's site wide tags blog
    8575
     76== Screenshots ==
     77
     781. Back end view of the BT - Topics with Posts widget
     792. Front end view of the BT - Topics with Posts widget, including portal links (highlighted in red)
     803. Back end view of the BT - Featured Topic with Posts widget
     814. Front end view of the BT - Featured Topic with Posts widget, including portal links (highlighted in red)
     825. Back end view of the BT - Topic Name widget
     836. Front end view of the BT - Topic Name widget
     847. Back end view of the BT - Related Blogs widget
     858. Front end view of the BT - Related Blogs widget
     869. Back end view of the BT - Related Posts widget
     8710. Front end view of the BT - Related Posts widget
     8811. Back end view of blog admins settings screen.
     8912. Back end view of the add/edit interface for site admins.
     9013. Back end view of site admins featured topic and uninstall interface.
     9114. Back end view of site admins blog edit features.
    8692
    8793
     94
Note: See TracChangeset for help on using the changeset viewer.