Changeset 204575
- Timestamp:
- 02/12/2010 02:52:41 PM (16 years ago)
- Location:
- blog-topics/branches/3.0
- Files:
-
- 6 edited
-
cets_blog_topics/miscactions.php (modified) (2 diffs)
-
cets_bt_featured_topic_with_posts_widget.php (modified) (5 diffs)
-
cets_bt_related_posts_widget.php (modified) (5 diffs)
-
cets_bt_topicname_widget.php (modified) (6 diffs)
-
cets_bt_topics_with_posts_widget.php (modified) (6 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blog-topics/branches/3.0/cets_blog_topics/miscactions.php
r204190 r204575 26 26 27 27 ?> 28 <h3>Blog Topic Options</h3> 28 <tr> 29 <td colspan="2"> 30 <h4>Blog Topic Options</h4> 29 31 <table class="form-table"> 30 32 <tr> … … 34 36 <th>Privacy</th> 35 37 <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') ?> 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') ?> 37 39 <br /> 38 <input type='radio' name='cets_topicexclude' value='1'<?php if( $excluded == 1 ) echo " checked"?> > <?php _e('Exclude this blog from topics aggregation') ?> 40 <input type='radio' name='cets_topicexclude' value='1'<?php if( $excluded == 1 ) echo " checked"?> /> <?php _e('Exclude this blog from topics aggregation') ?> 39 41 </td> 40 42 </tr> 41 43 </table> 44 </td> 45 </tr> 46 <tr><td colspan="2"><hr/></td></tr> 47 42 48 <?php 43 49 } -
blog-topics/branches/3.0/cets_bt_featured_topic_with_posts_widget.php
r204310 r204575 44 44 $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']); 45 45 $defaults = array( 46 'title' => 'Latest Posts', 'postrows' => 5 46 'title' => 'Latest Posts', 'postrows' => 5, 'include_portal' => 0 47 47 ); 48 48 49 49 50 50 $args = wp_parse_args( $options, $defaults ); 51 if ($args['include_portal'] != 1) $args['include_portal = 0']; 51 52 52 53 … … 57 58 58 59 // 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); 61 62 62 63 echo $before_widget; … … 64 65 65 66 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 67 74 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)); 69 76 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 73 83 echo ("</div>"); 74 84 … … 107 117 'title' => $topic, 'postrows' => 5 108 118 ); 109 119 120 $instance = wp_parse_args( $instance, $defaults ); 110 121 $title = esc_attr($instance['title']); 111 122 $postrows = esc_attr($instance['postrows'] ); … … 125 136 <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> 126 137 <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> 128 139 <?php 129 140 } -
blog-topics/branches/3.0/cets_bt_related_posts_widget.php
r204310 r204575 44 44 $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']); 45 45 $defaults = array( 46 'title' => 'Related Posts', 'postrows' => 10 46 'title' => 'Related Posts', 'postrows' => 10, 'include_portal' => 0 47 47 ); 48 48 … … 57 57 } 58 58 59 if ($args['include_portal'] != 1) $args['include_portal = 0']; 60 59 61 // get the topic id from the blogid 60 62 $topic_id = cets_get_topic_id_from_blog_id($blog_id); 61 // get the topic info 62 $topic = cets_get_topic($topic_id); 63 63 64 64 65 … … 68 69 cets_get_recent_posts_from_topic_id_html($topic_id, $postrows, $blog_id); 69 70 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 } 73 79 echo $after_widget; 74 80 … … 82 88 $instance['title'] = strip_tags(stripslashes($new_instance['title'])); 83 89 $instance['postrows'] = strip_tags(stripslashes($new_instance['postrows'])); 90 $instance['include_portal'] = $new_instance['include_portal']; 84 91 85 92 return $new_instance; … … 93 100 // Set defaults 94 101 $defaults = array( 95 'title' => $topic, 'postrows' => 10 102 'title' => $topic, 'postrows' => 10, 'include_portal' => 0 96 103 ); 97 104 $instance = wp_parse_args( $instance, $defaults ); 98 105 $title = esc_attr($instance['title']); 99 106 $postrows = esc_attr($instance['postrows']); 107 $include_portal = $instance['include_portal']; 100 108 101 109 102 103 104 110 ?> 105 111 <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> 106 112 <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> 108 114 <?php 109 115 -
blog-topics/branches/3.0/cets_bt_topicname_widget.php
r204310 r204575 45 45 $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']); 46 46 $defaults = array( 47 'title' => 'Related Blogs', 'description' => 0 47 'title' => 'Related Blogs', 'description' => 0, 'include_portal' => 0 48 48 ); 49 49 … … 51 51 $args = wp_parse_args( $options, $defaults ); 52 52 53 if ($args['include_portal'] != 1) $args['include_portal'] = 0; 53 54 54 55 // get the topic id from the blogid … … 59 60 60 61 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 63 70 if ($options['description'] == TRUE) { 64 71 echo ("<div>" . $topic->description . "</div>"); … … 76 83 $instance['title'] = strip_tags(stripslashes($new_instance['title'])); 77 84 $instance['description'] = strip_tags(stripslashes($new_instance['description'])); 78 85 $instance['include_portal'] = $new_instance['include_portal']; 79 86 return $new_instance; 80 87 } … … 87 94 // Set defaults 88 95 $defaults = array( 89 'title' => $topic, 'description' => 096 'title' => 'Topic Name', 'description' => 0 90 97 ); 91 98 $instance = wp_parse_args( $instance, $defaults ); 92 99 $title = esc_attr($instance['title']); 93 100 … … 99 106 <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> 100 107 <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> 102 109 <?php 103 110 -
blog-topics/branches/3.0/cets_bt_topics_with_posts_widget.php
r204310 r204575 45 45 $title = empty($options['title']) ? __('Topics') : apply_filters('widget_title', $options['title']); 46 46 $defaults = array( 47 'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array() 47 'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array(), 'include_portal' => 0 48 48 ); 49 49 … … 51 51 $args = wp_parse_args( $options, $defaults ); 52 52 53 53 54 54 if (!is_numeric($args['postrows'])){ 55 55 $args['postrows'] = $defaults['postrows']; 56 56 } 57 if ($args['include_portal'] != 1) $args['include_portal'] = 0; 57 58 58 59 … … 65 66 foreach($topics as $topic) { 66 67 if (!in_array($topic->id, $args['exclude'])){ //is not in the array of excluded ones 68 67 69 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 69 77 echo ("<ul>"); 70 78 echo (cets_get_recent_posts_from_topic_id_html($topic->id, $args['postrows'], 0)); 71 79 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>"); 77 87 }// end if 78 88 } … … 95 105 96 106 $instance['exclude'] = strip_tags($new_instance['exclude']); 97 107 $instance['include_portal'] = $new_instance['include_portal']; 98 108 99 109 … … 110 120 // Set defaults 111 121 $defaults = array( 112 'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array() 122 'title' => 'Latest Posts', 'postrows' => 5, 'exclude' => array(), 'include_portal' => 0 113 123 ); 114 124 $instance = wp_parse_args( $instance, $defaults ); 115 125 $title = esc_attr($instance['title']); 116 126 $postrows = esc_attr($instance['postrows'] ); 127 $include_portal = $instance['include_portal']; 117 128 $exclude = $instance['exclude'] ; 118 129 if (!is_numeric($postrows)) $postrows = $defaults['postrows']; … … 130 141 <?php foreach ($topics as $topic){ ?> 131 142 <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 134 143 <?php } ?> 135 144 </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> 136 146 137 147 -
blog-topics/branches/3.0/readme.txt
r204190 r204575 3 3 Author URI: http://deannaschneider.wordpress.com 4 4 Tags: WPMU site-wide topics, WMPU site-wide categories, WordPress MU, Wordpress Multiuser 5 Requires at least: 2. 6.36 Tested up to: 2. 6.35 Requires at least: 2.9 6 Tested up to: 2.9.1.1 7 7 Stable tag: trunk 8 8 … … 12 12 13 13 == Description == 14 Included files:15 14 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. 15 This 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. 20 16 21 This plugin does the following: 17 Site 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. 22 18 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). 19 This plugin comes with 5 optional widgets. 28 20 29 Also provided, but not required is a blog topics widget. The blog topics widget is 3 widgets in 1. 21 1. BT - Topic Name - displays the name of the topic of the current blog. 22 2. BT - Related Blogs - displays a linked list of other blogs in the same topic. 23 3. BT - Related Posts - displays the title of the N most recent posts in the same topic as the current blog. 24 4. BT - Featured Topic w/Posts - displays the N most recent posts from the "featured" topic. 25 5. BT - Topics w/Posts - displays the N most recent posts from each topic, with the option of excluding selected topics. 30 26 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. 27 Some 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. 36 28 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.41 29 42 30 == Installation == 43 31 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 32 1. Place the cets_blogtopics.php file and the cets_blog_topics folder in the wp-content/mu-plugins folder. 33 2. 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. 34 4. 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. 48 35 5. Blog admins can go to Settings -> Blog Topic to edit their assigned topic. 49 36 50 37 If 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 39 1. 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 54 42 55 43 == 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.44 1. Can I upgrade from version 0.3.2 to 3.0? 45 The 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. 58 46 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.php63 47 64 == Upgrade for 2.6.3 ==65 1. Replace cets_blogtopics.php with .3.1 version.66 48 67 == Version History == 49 == CHANGELOG == 50 51 3.0 52 53 * major overhaul of portal aspects 54 * addition of several columns to database tables 55 * incorporation of "featured" topic 56 57 68 58 .3.2 69 59 * Fixed bug that prevented initially signing up users from setting blog topic. … … 84 74 * fixed bug to not include Donncha's site wide tags blog 85 75 76 == Screenshots == 77 78 1. Back end view of the BT - Topics with Posts widget 79 2. Front end view of the BT - Topics with Posts widget, including portal links (highlighted in red) 80 3. Back end view of the BT - Featured Topic with Posts widget 81 4. Front end view of the BT - Featured Topic with Posts widget, including portal links (highlighted in red) 82 5. Back end view of the BT - Topic Name widget 83 6. Front end view of the BT - Topic Name widget 84 7. Back end view of the BT - Related Blogs widget 85 8. Front end view of the BT - Related Blogs widget 86 9. Back end view of the BT - Related Posts widget 87 10. Front end view of the BT - Related Posts widget 88 11. Back end view of blog admins settings screen. 89 12. Back end view of the add/edit interface for site admins. 90 13. Back end view of site admins featured topic and uninstall interface. 91 14. Back end view of site admins blog edit features. 86 92 87 93 94
Note: See TracChangeset
for help on using the changeset viewer.