================================================================== Snippet-title: archive_summary v1.4 Creator: Graham Keellings E-mail: pivot@keellings.com Website: http://www.keellings.com/software/pivot.php Creation date: 18 April 2005, Prague, Czeck Republic ================================================================== Content of zipped file: ----------------------- snippet_archive_summary.php readme_archive_summary.txt (this file) also snippet_show_archived_summary.php readme_show_archived_summary.php snippet_get_posts_for_month.php readme_get_posts_for_month.php snippet_get_posts_for_year.php readme_get_posts_for_year.php note that these are only required if you want to use some more of my snippets for your output (visit my blog to see how they look). If you are happy to use built-in Pivot functionality to display your archives, then you do not need these. Usage: ------ 1) unpack this package in your extensions/snippets/ folder. 2) place a [[archive_summary]] tag, with the appropriate parameters, in any of your template files, whereever you want the output to appear (usually on the frontpage). 2a) read the instructions below. Those wishing to use Graham's other snippets need to add a few more tags (to their frontpage template), while those who are happy to use standard Pivot functionality to show archives need do no more. 3) rebuild the FrontPage(s). Description: ------------ * Replaces the standard [[achive_list]], and outputs a list of months along * with the number of posts in each month as links ... * * Unless you pass the parameter 'linkType' = 1, in which case it is a little * more complicated, but, in my opinion, gives better output. If interested, * read on, otherwise, if you only want to add the counter, you have already * read enough. * * Visit http://www.keellings.com/blog/_demos/archive_summary.php to see * a demo with 'linkType' = 0 (default behaviour). * * With parameter 'linkType' = 1, the snippet requires my snippet [[archived_month_summary]]. * This one generates the list of months and if one is clicked, then that one * will process further by listing the posts for that month as URLs/permalinks. * * As I use it, I also use my snipptes [[conditional_begin]] and [[conditional_end]] * to replace the standard front page contents of [[subweblog:standard]] with the * list of posts for the clicked month, nut you don't have to do that. * * Visit my blog at http://www.keellings.com/blog.php to see it in * action with 'linkType' = 1. Parameters: ----------- * @parameter int linkType - if zer0 (default), links will be standard Pivot * archive links; if 1, links will be links to my * [[archived_month_summary]], which must, of course, * be installed. If used, then my [[conditional_begin]] * and [[conditional_end]] snippets are highly * recommended - see the readme for * [[archived_month_summary]] for full details. * * @access public * @return string HTML code as described above, one month per line. * History: * * * v 1.4 2006/06/16 Changi/Geylang, Singapore * - Only consider published entries, not timed posts or held entries * - left/right align month/year and numbero posts, respectively * * v 1.3 2006/06/16 Changi/Geylang, Singapore * - assumed that entries with higher 'code'] are newer. This is wrong. * In some circumstances the month names could be output in the wrong order. * * v 1.2 2006/01/22 Sentosa Island, Singapore * - local variable $db clashed with global variable * - change all output '
' to '
' for W3C validator compliance * - added 'version control' * * v 1.1 2006/01/16 Sentosa Island, Singapore * syntax for HTML table was wrong. * '&' in generated URL should be encoded as '&' for W3C validation * * v 1.0 2005/12/13 Sentosa Island, Sing