================================================================== Snippet-title: recent_years v1.4 Creator: Graham Keellings E-mail: pivot@keellings.com Website: http://www.keellings.com/software/pivot.php Creation date: 25 May 2005, Vienna, Austria ================================================================== Content of zipped file: ----------------------- snippet_recent_years.php readme_recent_years.txt (this file) snippet_get_posts_for_month.php Usage: ------ 1) unpack this package in your extensions/snippets/ folder. 2) place a [[recent_years]] tag, with the appropriate parameters, in any of your template files, whereever you want the output to appear. 3) rebuild the FrontPage(s). Description: ------------ * Outputs HTML with links to the requested number of years. * Each of the links causes a list of post titles for that year to be output, * groupd by month, as URLs, leading to the individual posts (permalinks)). * * Output might look something like this: * * 2005 2004 2003 <--- click to change year * * when clicked, you might see * * 2005 2004 2003 <--- click to change year (current year, large font) * * December 200x * My first post <--- these are the titles of the * Sun zoom spark <--- posts as URLS, linked to each * * November 200x * Web core, web core <--- individual post. * My head is my only house unless it rains * Yet another boring post * etc. optionally, each post title can be prefixed by a date. * ----------------------------------------------------------------- * * Visit http://www.keellings.com/blog/_demos/recent_years.php * to see it in action Parameters: ----------- * @param string weblog - pass '.'for the current blog, '*' for * all blogs, or a blog title like 'my_blog'. * @param int numYears - show links for this number of past years; * 0 (default) means all * @param string introText - for instance "

Previous years: " * this will be printed first * @param string outroText - for instance "
" - will be printed last * @param string formatString - each line will be preceded by the entry * date formatted by this string (passed to * the PHPdate() function. e.g. y-m-d * Leave blank for none. * @access public * @return HTML as descibed above * History: * * v 1.4 2007/01/27 Singapore * - the fucntion matching_entry() in this snippet was clashing with * an identically named fucntion in snippet_get_posts_for_year * * v 1.3 2006/03/18 Singapore * - added the $weekly parameter, for Ted * - added author and category parameters * - sniipet assumed that entries were stored in date order, which is not * not always so. In some rare cases, a linl to the same year may have * appeared twice (although no-one reported it). * * v 1.2 2006/01/16 Sentosa Island, Singapore * - local variable $db clashed with global variable * - change all output '
' to '
' for W3C validator compliance * * v 1.1 2005/10/21 London, UK * fixed a problem pointed out by Matthias D in another snippet, which was * based on this one. If parameter $weblog is '*', we need to use a real * weblog when calling some Pivot functions or accessing some Pivot data. * * v 1.0 2005/25/05, Vienna, Austria * initial version *