Plugin Directory

Changeset 500396


Ignore:
Timestamp:
02/04/2012 10:38:24 PM (14 years ago)
Author:
MakerBlock
Message:
 
Location:
simple-series
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • simple-series/trunk/readme.txt

    r500389 r500396  
    55Requires at least: 3.3
    66Tested up to: 3.3.1
    7 Stable tag: 1.4.3
     7Stable tag: 1.4.4
    88
    99An easy to use shortcode for automatically creating and organizing a series list for multiple posts on the same topic with appropriate SEO attributes.
     
    3939No problem!  The "Simple Post Series with SEO!" plugin will always update the series lists in each of your posts whenever you publish a new post.  The newest post will always be added to the series in chronological order, by publication date.  You can see an example of what it looks like here in my own DrawBot series.
    4040
     41= What if I add one post to multiple series? =
     42
     43No problem!  Just include a comma between the series titles in the shortcode.  It will add your post to each series named and it will display each associatd series list.
     44<ul>
     45<li> Example of just a post in only one series `[simple_series title="This Is My Series Title"]`</li>
     46<li> Example of just a post in only one series `[simple_series title="This Is My Series Title,This Is A Totally Different Series Title!"]`</li>
     47</ul>
     48
    4149= It's a piece of crap!  It doesn't work! =
    4250
     
    4654
    4755Sure!  There are three components to the series list: the DIV wrapper, the title of the series inside SPAN tags, and the list items.  This is the exact formatting I use in my blog.  If you need something different, just fiddle with the CSS to suit and add them to your stylesheet.
    48 <br> `div#mbk_simple_series_wrapper { display:block; }`
    49 <br> `span#mbk_simple_series_title { font-weight:bold; }`
    50 <br> `div#mbk_simple_series_wrapper ol li.mbk_simple_series_list_item { font-size:smaller; line-height: 0.8em;}`
     56<br> `div.mbk_simple_series_wrapper { display:block; }`
     57<br> `span.mbk_simple_series_title { font-weight:bold; }`
     58<br> `div.mbk_simple_series_wrapper ol li.mbk_simple_series_list_item { font-size:smaller; line-height: 0.8em;}`
    5159
    5260= Wait!  I have more questions! =
     
    6169
    6270== Changelog ==
     71
     72= 1.4.4 =
     73* 2/4/2012: Now the plugin supports adding a post to multiple series!  Thanks to Dale for the suggestion!
    6374
    6475= 1.4.3 =
  • simple-series/trunk/simpleseries.php

    r500058 r500396  
    44Plugin URI: http://www.MakerBlock.com
    55Description: Super simple post series organization
    6 Version: 1.4.3
    7 Date: 02-03-2012
     6Version: 1.4.4
     7Date: 02-04-2012
    88Author: MakerBlock
    99Author URI: http://www.makerblock.com
     
    2727    //  2. We need to assign a post-meta for this post
    2828        update_post_meta($postID, 'mbk_simple_series', $title);
    29     //  3. Find ALL posts with that same post-meta tag, sorted by the publish date
    30         $querystr = "
    31             SELECT $wpdb->posts.*
    32             FROM $wpdb->posts, $wpdb->postmeta
    33             WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
    34             AND $wpdb->postmeta.meta_key = 'mbk_simple_series'
    35             AND $wpdb->postmeta.meta_value = '$title'
    36             AND $wpdb->posts.post_status = 'publish'
    37             AND $wpdb->posts.post_type = 'post'
    38             AND $wpdb->posts.post_date < NOW()
    39             ORDER BY $wpdb->posts.post_date ASC";
    40         $pageposts = $wpdb->get_results($querystr, OBJECT);
    41     //  4. Create the title for the series
    42         $text = "<div id='mbk_simple_series_wrapper'><span id='mbk_simple_series_title'>$title</span><ol>";
    43     //  4. Create an OL list for the posts - appended to the end of the post
    44         for ($i=0; $i<count($pageposts);$i++)
    45             { $text .= "<li class='mbk_simple_series_list_item'><a href='". get_permalink($pageposts[$i]->ID) ."' title='". $pageposts[$i]->post_title ."'>". $pageposts[$i]->post_title ."</a></li>"; }
    46         $text .= "</ol></div>";
     29    //  3. Let's split up the title, if there were multiple titles
     30        $title = explode(",",$title);
     31    //  4. Let's create a loop that will run - once for each title.  This is NOT the most elegant way to run this query!
     32        for ($h=0;$h<count($title);$h++)
     33            {
     34            $titleh = $title[$h];
     35        //  4.a. Find ALL posts with that same post-meta tag, sorted by the publish date
     36            $querystr = "
     37                SELECT $wpdb->posts.*
     38                FROM $wpdb->posts, $wpdb->postmeta
     39                WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
     40                AND $wpdb->postmeta.meta_key = 'mbk_simple_series'
     41                AND $wpdb->postmeta.meta_value = '$titleh'
     42                AND $wpdb->posts.post_status = 'publish'
     43                AND $wpdb->posts.post_type = 'post'
     44                AND $wpdb->posts.post_date < NOW()
     45                ORDER BY $wpdb->posts.post_date ASC";
     46            $pageposts = $wpdb->get_results($querystr, OBJECT);
     47        //  4.b. Create the title for the series
     48            $text .= "<div class='mbk_simple_series_wrapper'><span class='mbk_simple_series_title'>$titleh</span><ol>";
     49        //  4.c. Create an OL list for the posts - appended to the end of the post
     50            for ($i=0; $i<count($pageposts);$i++)
     51                { $text .= "<li class='mbk_simple_series_list_item'><a href='". get_permalink($pageposts[$i]->ID) ."' title='". $pageposts[$i]->post_title ."'>". $pageposts[$i]->post_title ."</a></li>"; }
     52            $text .= "</ol></div>";
     53            }
    4754    //  5. Does the user want to delete the post from the series?
    4855        if ($delete == "true")
Note: See TracChangeset for help on using the changeset viewer.