Plugin Directory

Changeset 140449


Ignore:
Timestamp:
07/29/2009 11:56:22 AM (17 years ago)
Author:
mstegink
Message:

Solved table prefix issue

Location:
charted-archives/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • charted-archives/trunk/ChartedArchives.php

    r140182 r140449  
    44Plugin URI: http://www.bos89.nl/wordpress-charted-archives-plugin/
    55Description: Show your archives by month in a bar chart, after an idea from John Nunemaker.
    6 Version: 1.2
     6Version: 1.3
    77Author: M. Stegink
    88Author URI: http://www.bos89.nl/
     
    1515function Charted_Archives($rows) {
    1616    global $wpdb;
     17    $table = $wpdb->prefix . 'posts';
    1718    if ($rows == '' || $rows == 0) { $rows = 7; }
    18     $sql = 'select count(*) as n, monthname(post_date) as monthname, month(post_date) as month, year(post_date) as year from wp_posts where post_type = "post" group by year, month order by year desc, month desc limit ' . $rows;
     19    $sql = 'select count(*) as n, monthname(post_date) as monthname, month(post_date) as month, year(post_date) as year from ' . $table . ' where post_type = "post" group by year, month order by year desc, month desc limit ' . $rows;
    1920    $months = $wpdb->get_results($sql);
    2021    $months = array_reverse($months);
  • charted-archives/trunk/readme.txt

    r140186 r140449  
    5050
    5151* Added a shortcode on user request
     52
     53= 1.3 =
     54
     55* Solved issue with non-standard database table prefix
Note: See TracChangeset for help on using the changeset viewer.