b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.9) [ class tree: plugins ] [ index: plugins ] [ all elements ]

Source for file _calendar.plugin.php

Documentation is available at _calendar.plugin.php

  1. <?php
  2. /**
  3.  * This file implements the Calendar plugin.
  4.  *
  5.  * This file is part of the b2evolution project - {@link http://b2evolution.net/}
  6.  *
  7.  * @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
  8.  *  Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  9.  *
  10.  *  {@internal License choice
  11.  *  - If you have received this file as part of a package, please find the license.txt file in
  12.  *    the same folder or the closest folder above for complete license terms.
  13.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14.  *    then you must choose one of the following licenses before using the file:
  15.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17.  *  }}}
  18.  *
  19.  *  {@internal Open Source relicensing agreement:
  20.  *  Daniel HAHLER grants Francois PLANQUE the right to license
  21.  *  Daniel HAHLER's contributions to this file and the b2evolution project
  22.  *  under any OSI approved OSS license (http://www.opensource.org/licenses/).
  23.  *  }}}
  24.  *
  25.  * @package plugins
  26.  *
  27.  *  {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  28.  * @author blueyed: Daniel HAHLER.
  29.  * @author fplanque: Francois PLANQUE - {@link http://fplanque.net/}
  30.  * @author hansreinders: Hans REINDERS
  31.  * @author cafelog (team)
  32.  *
  33.  * @version $Id: _calendar.plugin.php,v 1.26.2.7 2007/03/29 10:34:48 fplanque Exp $
  34.  */
  35. if!defined('EVO_MAIN_INIT') ) die'Please, do not access this page directly.' );
  36.  
  37.  
  38. /**
  39.  * Calendar Plugin
  40.  *
  41.  * This plugin displays
  42.  */
  43. class calendar_plugin extends Plugin
  44. {
  45.     /**
  46.      * Variables below MUST be overriden by plugin implementations,
  47.      * either in the subclass declaration or in the subclass constructor.
  48.      */
  49.  
  50.     var $name = 'Calendar Skin Tag';
  51.     var $code = 'evo_Calr';
  52.     var $priority = 20;
  53.     var $version = '1.9-dev';
  54.     var $author = 'The b2evo Group';
  55.     var $group = 'skin-tag';
  56.  
  57.  
  58.     /**
  59.      * Init
  60.      */
  61.     function PluginInit$params )
  62.     {
  63.         $this->short_desc = T_('This skin tag displays a navigable calendar.');
  64.         $this->long_desc = T_('Days containing posts are highlighted.');
  65.  
  66.         $this->dbtable 'T_posts';
  67.         $this->dbprefix 'post_';
  68.         $this->dbIDname 'post_ID';
  69.     }
  70.  
  71.  
  72.     /**
  73.      * Event handler: SkinTag
  74.      *
  75.      * @param array Associative array of parameters. Valid keys are:
  76.      *       - 'block_start' : (Default: '<div class="bSideItem">')
  77.      *       - 'block_end' : (Default: '</div>')
  78.      *       - 'title' : (Default: '<h3>'.T_('Calendar').'</h3>')
  79.      *       - 'displaycaption'
  80.      *       - 'monthformat'
  81.      *       - 'linktomontharchive'
  82.      *       - 'tablestart'
  83.      *       - 'tableend'
  84.      *       - 'monthstart'
  85.      *       - 'monthend'
  86.      *       - 'rowstart'
  87.      *       - 'rowend'
  88.      *       - 'headerdisplay'
  89.      *       - 'headerrowstart'
  90.      *       - 'headerrowend'
  91.      *       - 'headercellstart'
  92.      *       - 'headercellend'
  93.      *       - 'cellstart'
  94.      *       - 'cellend'
  95.      *       - 'linkpostcellstart'
  96.      *       - 'linkposttodaycellstart'
  97.      *       - 'todaycellstart'
  98.      *       - 'todaycellstartpost'
  99.      *       - 'navigation' : Where do we want to have the navigation arrows? (Default: 'tfoot')
  100.      *       - 'browseyears' : boolean  Do we want arrows to move one year at a time?
  101.      *       - 'min_timestamp' : Minimum unix timestamp the user can browse too or 'query' (Default: 2000-01-01)
  102.      *       - 'max_timestamp' : Maximum unix timestamp the user can browse too or 'query' (Default: now + 1 year )
  103.      *       - 'postcount_month_cell'
  104.      *       - 'postcount_month_cell_one'
  105.      *       - 'postcount_month_atitle'
  106.      *       - 'postcount_month_atitle_one'
  107.      *       - 'postcount_year_cell'
  108.      *       - 'postcount_year_cell_one'
  109.      *       - 'postcount_year_atitle'
  110.      *       - 'postcount_year_atitle_one'
  111.      *       - 'link_type' : 'canonic'|'context' (default: canonic)
  112.      * @return boolean did we display?
  113.      */
  114.     function SkinTag$params )
  115.     {
  116.         global $Settings$month;
  117.         global $blog$cat$catsel;
  118.         global $show_statuses;
  119.         global $author$assgn$status;
  120.         global $m$w$dstart$timestamp_min$timestamp_max;
  121.         global $s$sentence$exact;
  122.  
  123.         /**
  124.          * Default params:
  125.          */
  126.         // This is what will enclose the block in the skin:
  127.         if(!isset($params['block_start'])) $params['block_start''<div class="bSideItem">';
  128.         if(!isset($params['block_end'])) $params['block_end'"</div>\n";
  129.  
  130.         // Title:
  131.         if(!isset($params['title']))
  132.             $params['title''<h3>'.T_('Calendar').'</h3>';
  133.  
  134.  
  135.         $Calendar new Calendar$m$params );
  136.  
  137.         // TODO: automate with a table inside of Calendatr object. Table should also contain descriptions and default values to display in help screen.
  138.         // Note: minbrowse and maxbrowe already work this way.
  139.         ifisset($params['displaycaption']) ) $Calendar->set'displaycaption'$params['displaycaption');
  140.         ifisset($params['monthformat']) ) $Calendar->set'monthformat'$params['monthformat');
  141.         ifisset($params['linktomontharchive']) ) $Calendar->set'linktomontharchive'$params['linktomontharchive');
  142.         ifisset($params['tablestart']) ) $Calendar->set'tablestart'$params['tablestart');
  143.         ifisset($params['tableend']) ) $Calendar->set'tableend'$params['tableend');
  144.         ifisset($params['monthstart']) ) $Calendar->set'monthstart'$params['monthstart');
  145.         ifisset($params['monthend']) ) $Calendar->set'monthend'$params['monthend');
  146.         ifisset($params['rowstart']) ) $Calendar->set'rowstart'$params['rowstart');
  147.         ifisset($params['rowend']) ) $Calendar->set'rowend'$params['rowend');
  148.         ifisset($params['headerdisplay']) ) $Calendar->set'headerdisplay'$params['headerdisplay');
  149.         ifisset($params['headerrowstart']) ) $Calendar->set'headerrowstart'$params['headerrowstart');
  150.         ifisset($params['headerrowend']) ) $Calendar->set'headerrowend'$params['headerrowend');
  151.         ifisset($params['headercellstart']) ) $Calendar->set'headercellstart'$params['headercellstart');
  152.         ifisset($params['headercellend']) ) $Calendar->set'headercellend'$params['headercellend');
  153.         ifisset($params['cellstart']) ) $Calendar->set'cellstart'$params['cellstart');
  154.         ifisset($params['cellend']) ) $Calendar->set'cellend'$params['cellend');
  155.         ifisset($params['emptycellstart']) ) $Calendar->set'emptycellstart'$params['emptycellstart');
  156.         ifisset($params['emptycellend']) ) $Calendar->set'emptycellend'$params['emptycellend');
  157.         ifisset($params['emptycellcontent']) ) $Calendar->set'emptycellcontent'$params['emptycellcontent');
  158.         ifisset($params['linkpostcellstart']) ) $Calendar->set'linkpostcellstart'$params['linkpostcellstart');
  159.         ifisset($params['linkposttodaycellstart']) ) $Calendar->set'linkposttodaycellstart'$params['linkposttodaycellstart');
  160.         ifisset($params['todaycellstart']) ) $Calendar->set'todaycellstart'$params['todaycellstart');
  161.         ifisset($params['todaycellstartpost']) ) $Calendar->set'todaycellstartpost'$params['todaycellstartpost');
  162.         ifisset($params['navigation']) ) $Calendar->set'navigation'$params['navigation');
  163.         ifisset($params['browseyears']) ) $Calendar->set'browseyears'$params['browseyears');
  164.         ifisset($params['postcount_month_cell']) ) $Calendar->set'postcount_month_cell'$params['postcount_month_cell');
  165.         ifisset($params['postcount_month_cell_one']) ) $Calendar->set'postcount_month_cell_one'$params['postcount_month_cell_one');
  166.         ifisset($params['postcount_month_atitle']) ) $Calendar->set'postcount_month_atitle'$params['postcount_month_atitle');
  167.         ifisset($params['postcount_month_atitle_one']) ) $Calendar->set'postcount_month_atitle_one'$params['postcount_month_atitle_one');
  168.         ifisset($params['postcount_year_cell']) ) $Calendar->set'postcount_year_cell'$params['postcount_year_cell');
  169.         ifisset($params['postcount_year_cell_one']) ) $Calendar->set'postcount_year_cell_one'$params['postcount_year_cell_one');
  170.         ifisset($params['postcount_year_atitle']) ) $Calendar->set'postcount_year_atitle'$params['postcount_year_atitle');
  171.         ifisset($params['postcount_year_atitle_one']) ) $Calendar->set'postcount_year_atitle_one'$params['postcount_year_atitle_one');
  172.         // Link type:
  173.         ifisset($params['link_type']) ) $Calendar->set'link_type'$params['link_type');
  174.         ifisset($params['context_isolation']) ) $Calendar->set'context_isolation'$params['context_isolation');
  175.  
  176.         echo $params['block_start'];
  177.  
  178.         echo $params['title'];
  179.  
  180.         // CONSTRUCT THE WHERE CLAUSE:
  181.  
  182.         // - - Select a specific Item:
  183.         // $this->ItemQuery->where_ID( $p, $title );
  184.  
  185.         if$Calendar->link_type == 'context' )
  186.         {    // We want to preserve the current context:
  187.             // * - - Restrict to selected blog/categories:
  188.             $Calendar->ItemQuery->where_chapter$blog$cat$catsel );
  189.  
  190.             // * Restrict to the statuses we want to show:
  191.             $Calendar->ItemQuery->where_visibility$show_statuses );
  192.  
  193.             // Restrict to selected authors:
  194.             $Calendar->ItemQuery->where_author$author );
  195.  
  196.             // Restrict to selected assignees:
  197.             $Calendar->ItemQuery->where_assignees$assgn );
  198.  
  199.             // Restrict to selected satuses:
  200.             $Calendar->ItemQuery->where_statuses$status );
  201.  
  202.             // - - - + * * if a month is specified in the querystring, load that month:
  203.             $Calendar->ItemQuery->where_datestart/* NO m */''/* NO w */''$dstart''$timestamp_min$timestamp_max );
  204.  
  205.             // Keyword search stuff:
  206.             $Calendar->ItemQuery->where_keywords$s$sentence$exact );
  207.         }
  208.         else
  209.         {    // We want to preserve only the minimal context:
  210.             // * - - Restrict to selected blog/categories:
  211.             $Calendar->ItemQuery->where_chapter$blog''array() );
  212.  
  213.             // * Restrict to the statuses we want to show:
  214.             $Calendar->ItemQuery->where_visibility$show_statuses );
  215.  
  216.             // - - - + * * if a month is specified in the querystring, load that month:
  217.             $Calendar->ItemQuery->where_datestart/* NO m */''/* NO w */''''''$timestamp_min$timestamp_max );
  218.         }
  219.  
  220.         // DISPLAY:
  221.         $Calendar->display);
  222.  
  223.         echo $params['block_end'];
  224.  
  225.         return true;
  226.     }
  227. }
  228.  
  229.  
  230. /**
  231.  * Calendar
  232.  *
  233.  * @package evocore
  234.  */
  235. class Calendar
  236. {
  237.     var $year;
  238.  
  239.     /**
  240.      * The month to display or empty in mode 'year' with no selected month.
  241.      * @var string 
  242.      */
  243.     var $month;
  244.  
  245.     /**
  246.      * 'month' or 'year'
  247.      * @var string 
  248.      */
  249.     var $mode;
  250.  
  251.     var $where;
  252.     /**
  253.      * SQL query string
  254.      * @var string 
  255.      */
  256.     var $request;
  257.     /**
  258.      * Result set
  259.      */
  260.     var $result;
  261.     /**
  262.      * Number of rows in result set
  263.      * @var integer 
  264.      */
  265.     var $result_num_rows;
  266.  
  267.     var $displaycaption;
  268.     var $monthformat;
  269.     var $monthstart;
  270.     var $monthend;
  271.     var $linktomontharchive;
  272.     /**
  273.      * Where to do the navigation
  274.      *
  275.      * 'caption' or 'tfoot';
  276.      *
  277.      * @var string 
  278.      */
  279.     var $navigation = 'tfoot';
  280.  
  281.     var $tablestart;
  282.     var $tableend;
  283.  
  284.     var $rowstart;
  285.     var $rowend;
  286.  
  287.     var $headerdisplay;
  288.     var $headerrowstart;
  289.     var $headerrowend;
  290.     var $headercellstart;
  291.     var $headercellend;
  292.  
  293.     var $cellstart;
  294.     var $cellend;
  295.  
  296.     var $emptycellstart;
  297.     var $emptycellend;
  298.  
  299.     var $emptycellcontent;
  300.  
  301.     /**
  302.      * Do we want to browse years in the caption? True by default for mode == year,
  303.      * false for mode == month (gets set in constructor).
  304.      * @var boolean 
  305.      */
  306.     var $browseyears;
  307.  
  308.     /**
  309.      * Is today in the displayed frame?
  310.      * @var boolean 
  311.      * @access protected
  312.      */
  313.     var $today_is_visible;
  314.  
  315.  
  316.     var $link_type;
  317.     var $context_isolation;
  318.  
  319.     var $params = array);
  320.  
  321.     /**
  322.      * Calendar::Calendar(-)
  323.      *
  324.      * Constructor
  325.      *
  326.      * @param string Month ('YYYYMM'), year ('YYYY'), current ('')
  327.      * @param array Associative array of parameters. Valid keys are:
  328.      *       - 'min_timestamp' : Minimum unix timestamp the user can browse too or 'query' (Default: 2000-01-01)
  329.      *       - 'max_timestamp' : Maximum unix timestamp the user can browse too or 'query' (Default: now + 1 year )
  330.      */
  331.     function Calendar$m ''$params array() )
  332.     {
  333.         global $Settings$localtimenow;
  334.  
  335.         $this->dbtable 'T_posts';
  336.         $this->dbprefix 'post_';
  337.         $this->dbIDname 'post_ID';
  338.  
  339.         // OBJECT THAT WILL BE USED TO CONSTRUCT THE WHERE CLAUSE:
  340.         $this->ItemQuery new ItemQuery$this->dbtable$this->dbprefix$this->dbIDname );    // COPY!!
  341.  
  342.         $localyearnow date'Y'$localtimenow );
  343.         $localmonthnow date'm'$localtimenow );
  344.  
  345.         // Find out which month to display:
  346.         ifempty($m) )
  347.         // Current month (monthly)
  348.             $this->year = $localyearnow;
  349.             $this->month = $localmonthnow;
  350.             $this->mode = 'month';
  351.  
  352.             $this->today_is_visible = true;
  353.         }
  354.         else
  355.         {    // We have requested a specific date
  356.             $this->year = substr($m04);
  357.             if (strlen($m6)
  358.             // no month provided
  359.                 $this->mode = 'year';
  360.  
  361.                 if$this->year == $localyearnow )
  362.                 // we display current year, month gets current
  363.                     $this->month = $localmonthnow;
  364.                 }
  365.                 else
  366.                 // highlight no month, when not current year
  367.                     $this->month = '';
  368.                 }
  369.             }
  370.             else
  371.             {
  372.                 $this->month = substr($m42);
  373.                 $this->mode = 'month';
  374.             }
  375.  
  376.             $this->today_is_visible = $this->year == $localyearnow
  377.                 && empty($this->month|| $this->month == $localmonthnow ) );
  378.         }
  379.  
  380.  
  381.         // Default styling:
  382.         $this->displaycaption = 1;    // set this to 0 if you don't want to display the month name
  383.         $this->monthformat = 'F Y';
  384.         $this->linktomontharchive = true;  // month displayed as link to month' archive
  385.  
  386.         $this->tablestart = '<table class="bCalendarTable" cellspacing="0" summary="Monthly calendar with links to each day\'s posts">'."\n";
  387.         $this->tableend = '</table>';
  388.  
  389.         $this->monthstart = '<caption class="bCalendarCaption">';
  390.         $this->monthend = "</caption>\n";
  391.  
  392.         $this->rowstart = '<tr class="bCalendarRow">' "\n";
  393.         $this->rowend = "</tr>\n";
  394.  
  395.         $this->headerdisplay = 'D';     // D => 'Fri'; e => 'F', l (lowercase l) => 'Friday'
  396.         // These codes are twisted because they're the same as for date formats.
  397.         // set this to 0 or '' if you don't want to display the "Mon Tue Wed..." header
  398.  
  399.         $this->headerrowstart = '<thead><tr class="bCalendarRow">' "\n";
  400.         $this->headerrowend = "</tr></thead>\n";
  401.         $this->headercellstart = '<th class="bCalendarHeaderCell" abbr="[abbr]" scope="col" title="[abbr]">';    // please leave [abbr] there !
  402.         $this->headercellend = "</th>\n";
  403.  
  404.         $this->cellstart = '<td class="bCalendarCell">';
  405.         $this->cellend = "</td>\n";
  406.  
  407.         $this->emptycellstart = '<td class="bCalendarEmptyCell">';
  408.         $this->emptycellend = "</td>\n";
  409.         $this->emptycellcontent = '&nbsp;';
  410.  
  411.         $this->linkpostcellstart '<td class="bCalendarLinkPost">';
  412.         $this->linkposttodaycellstart '<td class="bCalendarLinkPostToday">';
  413.         $this->todaycellstart '<td id="bCalendarToday">';
  414.         $this->todaycellstartpost '<td id="bCalendarToday" class="bCalendarLinkPost">';
  415.  
  416.         // Where do we want to have the navigation arrows?
  417.         $this->navigation = 'tfoot';
  418.         // Do we want to check if there are posts behind the navigation arrows?
  419.         // WARNING: this will slow things down...
  420.         // TODO: $this->check_navigation = false;
  421.         // Do we want arrows to move one year at a time?
  422.         $this->browseyears = true;
  423.  
  424.         /**#@+
  425.          * Display number of posts with days/months
  426.          *
  427.          * - set to '' (empty) to disable
  428.          * - %d gets replaced with the number of posts on that day/month
  429.          */
  430.         $this->postcount_month_cell '';                           // in table cell (behind day)
  431.         $this->postcount_month_cell_one '';                       //  -- " -- [for single post]
  432.         $this->postcount_month_atitle T_('%d posts');                         // in archive links title tag
  433.         $this->postcount_month_atitle_one T_('1 post');                      //  -- " -- [for single post]
  434.         $this->postcount_year_cell   '';
  435.         $this->postcount_year_cell_one   '';
  436.         $this->postcount_year_atitle T_('%d posts');                             // in archive links title tag
  437.         $this->postcount_year_atitle_one T_('1 post');                         // in archive links title tag
  438.         /**#@-*/
  439.  
  440.         // Link type:
  441.         $this->link_type = 'canonic';
  442.         $this->context_isolation = 'm,w,p,title,unit,dstart';
  443.  
  444.         // New style params:
  445.         $this->params = $params;
  446.  
  447.         // Default values:
  448.         ifempty$this->params['min_timestamp') )
  449.         {    // 2000-01-01:
  450.             $this->params['min_timestamp'mktime000112000 );
  451.         }
  452.         ifempty$this->params['max_timestamp') )
  453.         {    // Now + 1 year:
  454.             $this->params['max_timestamp'mktime235959date'm'$localtimenow  ),  date'd'$localtimenow ),  date'Y'$localtimenow )+);
  455.         }
  456.  
  457.     }
  458.  
  459.  
  460.     /*
  461.      * Calendar->set(-)
  462.      *
  463.      * set a variable
  464.      */
  465.     function set$var$value )
  466.     {
  467.         $this->$var $value;
  468.     }
  469.  
  470.  
  471.     /**
  472.      * Display the calendar.
  473.      *
  474.      * @todo If a specific day (mode == month) or month (mode == year) is selected, apply another class (default to some border)
  475.      */
  476.     function display()
  477.     {
  478.         global $DB;
  479.         global $weekday$weekday_abbrev$weekday_letter$month$month_abbrev;
  480.         global $Settings;
  481.  
  482.         if$this->mode == 'month' )
  483.         {
  484.             $end_of_week ((locale_startofweek(77);
  485.  
  486.             // fplanque>> note: I am removing the searchframe thing because 1) I don't think it's of any use
  487.             // and 2) it's brutally inefficient! If someone needs this it should be implemented with A SINGLE
  488.             // QUERY which gets the last available post (BTW, I think there is already a function for that somwhere)
  489.  
  490.             $arc_sql 'SELECT COUNT(DISTINCT '.$this->dbIDname.') AS item_count,
  491.                                                     YEAR('.$this->dbprefix.'datestart), MONTH('.$this->dbprefix.'datestart),
  492.                                                     DAYOFMONTH('.$this->dbprefix.'datestart) AS myday
  493.                                     FROM ('.$this->dbtable.' INNER JOIN T_postcats ON '.$this->dbIDname.' = postcat_post_ID)
  494.                                         INNER JOIN T_categories ON postcat_cat_ID = cat_ID
  495.                                     WHERE YEAR('.$this->dbprefix.'datestart) = "'.$this->year.'"
  496.                                         AND MONTH('.$this->dbprefix.'datestart) = "'.$this->month.'"
  497.                                         '.$this->ItemQuery->get_where' AND ' ).'
  498.                                     GROUP BY myday '.$this->ItemQuery->get_group_by', ' ).'
  499.                                     ORDER BY '.$this->dbprefix.'datestart DESC';
  500.             // echo $arc_sql;
  501.             // echo $this->ItemQuery->where;
  502.             $arc_result $DB->get_results$arc_sqlARRAY_A );
  503.  
  504.             foreach$arc_result as $arc_row )
  505.             {
  506.                 if!isset$daysinmonthwithposts$arc_row['myday'] ] ) )
  507.                 {
  508.                     $daysinmonthwithposts$arc_row['myday'] ] 0;
  509.                 }
  510.                 // The '+' situation actually only happens when we have a complex GROUP BY above
  511.                 // (multiple categories wcombined with "ALL")
  512.                 $daysinmonthwithposts$arc_row['myday'] ] += $arc_row['item_count'];
  513.             }
  514.  
  515.             $daysinmonth intval(date('t'mktime(000$this->month1$this->year)));
  516.             // echo 'days in month=', $daysinmonth;
  517.  
  518.  
  519.             // caution: offset bug inside (??)
  520.             $datestartofmonth mktime(000$this->month1$this->year );
  521.             // echo date( locale_datefmt(), $datestartofmonth );
  522.             $calendarblah get_weekstartend$datestartofmonthlocale_startofweek() );
  523.             $calendarfirst $calendarblah['start'];
  524.  
  525.  
  526.             $dateendofmonth mktime(000$this->month$daysinmonth$this->year);
  527.             // echo date( locale_datefmt(), $dateendofmonth );
  528.             $calendarblah get_weekstartend$dateendofmonthlocale_startofweek() );
  529.             $calendarlast $calendarblah['end'];
  530.  
  531.  
  532.             // here the offset bug is corrected
  533.             if( (intval(date('d'$calendarfirst)) 1&& (intval(date('m'$calendarfirst)) == intval($this->month)) )
  534.             {
  535.                 #pre_dump( 'with offset bug', date('Y-m-d', $calendarfirst) );
  536.                 $calendarfirst $calendarfirst 604800 /* 1 week */;
  537.                 #pre_dump( 'without offset bug', date('Y-m-d', $calendarfirst) );
  538.             }
  539.         }
  540.         else
  541.         // mode is 'year'
  542.             // Find months with posts
  543.             $arc_sql 'SELECT COUNT(DISTINCT '.$this->dbIDname.') AS item_count, MONTH('.$this->dbprefix.'datestart) AS mymonth
  544.                                     FROM ('.$this->dbtable.' INNER JOIN T_postcats ON '.$this->dbIDname.' = postcat_post_ID)
  545.                                         INNER JOIN T_categories ON postcat_cat_ID = cat_ID
  546.                                     WHERE YEAR('.$this->dbprefix.'datestart) = "'.$this->year.'" '
  547.                                         .$this->ItemQuery->get_where' AND ' ).'
  548.                                     GROUP BY mymonth '.$this->ItemQuery->get_group_by', ' );
  549.             $arc_result $DB->get_results$arc_sqlARRAY_A );
  550.  
  551.             if$DB->num_rows )
  552.             // OK we have a month with posts!
  553.                 foreach$arc_result as $arc_row )
  554.                 {
  555.                     $monthswithposts$arc_row['mymonth'] ] $arc_row['item_count'];
  556.                 }
  557.             }
  558.         }
  559.  
  560.  
  561.         // ** display everything **
  562.  
  563.         echo $this->tablestart;
  564.  
  565.         // CAPTION :
  566.  
  567.         if$this->displaycaption )
  568.         // caption:
  569.             echo $this->monthstart;
  570.  
  571.             if$this->navigation == 'caption' )
  572.             {
  573.                 echo implode'&nbsp;'$this->getNavLinks'prev' ) );
  574.             }
  575.  
  576.             if$this->mode == 'month' )
  577.             // MONTH CAPTION:
  578.                 if$this->linktomontharchive )
  579.                 // chosen month with link to archives
  580.                     echo '<a href="'.$this->archive_link$this->year$this->month'''' ).'" title="'.T_('go to month\'s archive').'">';
  581.                 }
  582.  
  583.                 echo date_i18n($this->monthformatmktime(000$this->month1$this->year));
  584.  
  585.                 if$this->linktomontharchive )
  586.                 // close link to month archive
  587.                     echo '</a>';
  588.                 }
  589.             }
  590.             else
  591.             // YEAR CAPTION:
  592.                 echo date_i18n('Y'mktime(00011$this->year))// display year
  593.             }
  594.  
  595.             if$this->navigation == 'caption' )
  596.             {
  597.                 echo implode'&nbsp;'$this->getNavLinks'next' ) );
  598.             }
  599.  
  600.             echo $this->monthend;
  601.         }
  602.  
  603.         // HEADER :
  604.  
  605.         if!empty($this->headerdisplay&& ($this->mode == 'month') )
  606.         // Weekdays:
  607.             echo $this->headerrowstart;
  608.  
  609.             for$i locale_startofweek()$j $i 7$i $j$i $i 1)
  610.             {
  611.                 echo str_replace('[abbr]'T_($weekday[($i 7)])$this->headercellstart);
  612.                 switch$this->headerdisplay )
  613.                 {
  614.                     case 'e':
  615.                         // e => 'F'
  616.                         echo T_($weekday_letter[($i 7)]);
  617.                         break;
  618.  
  619.                     case 'l':
  620.                         // l (lowercase l) => 'Friday'
  621.                         echo T_($weekday[($i 7)]);
  622.                         break;
  623.  
  624.                     default:    // Backward compatibility: any non emty value will display this
  625.                         // D => 'Fri'
  626.                         echo T_($weekday_abbrev[($i 7)]);
  627.                 }
  628.  
  629.                 echo $this->headercellend;
  630.             }
  631.  
  632.             echo $this->headerrowend;
  633.         }
  634.  
  635.         // FOOTER :
  636.  
  637.         if$this->navigation == 'tfoot' )
  638.         // We want to display navigation in the table footer:
  639.             echo "<tfoot>\n";
  640.             echo "<tr>\n";
  641.             echo '<td colspan="'.( ( $this->mode == 'month' + (int)$this->today_is_visible ).'" id="prev">';
  642.             echo implode'&nbsp;'$this->getNavLinks'prev' ) );
  643.             echo "</td>\n";
  644.  
  645.             if$this->today_is_visible )
  646.             {
  647.                 if$this->mode == 'month' )
  648.                 {
  649.                     echo '<td class="pad">&nbsp;</td>'."\n";
  650.                 }
  651.             }
  652.             else
  653.             {
  654.                 echo '<td colspan="'.$this->mode == 'month' '3' '2' ).'" class="center"><a href="'
  655.                             .$this->archive_linkdate('Y')$this->mode == 'month' date('m''' )'''' )
  656.                             .'">'.T_('Current')
  657.                             .'</a></td>';
  658.             }
  659.             echo '<td colspan="'.( ( $this->mode == 'month' + (int)$this->today_is_visible ).'" id="next">';
  660.             echo implode'&nbsp;'$this->getNavLinks'next' ) );
  661.             echo "</td>\n";
  662.             echo "</tr>\n";
  663.             echo "</tfoot>\n";
  664.         }
  665.  
  666.         // REAL TABLE DATA :
  667.  
  668.         echo $this->rowstart;
  669.  
  670.         if$this->mode == 'year' )
  671.         {
  672.             for ($i 1$i 13$i $i 1)
  673.             {    // For each month:
  674.                 ifisset($monthswithposts$i ]) )
  675.                 {
  676.                     if$this->month == $i )
  677.                     {
  678.                         echo $this->todaycellstartpost;
  679.                     }
  680.                     else
  681.                     {
  682.                         echo $this->linkpostcellstart;
  683.                     }
  684.                     echo '<a href="'.$this->archive_link$this->year$i'''' ).'"';
  685.                     if$monthswithposts$i && !empty($this->postcount_year_atitle) )
  686.                     // display postcount
  687.                         echo ' title="'.sprintf($this->postcount_year_atitle$monthswithposts$i ]).'"';
  688.                     }
  689.                     elseif!empty($this->postcount_year_atitle_one) )
  690.                     // display postcount for one post
  691.                         echo ' title="'.sprintf($this->postcount_year_atitle_one1).'"';
  692.                     }
  693.                     echo '>';
  694.                 }
  695.                 elseif$this->month == $i )
  696.                 // current month
  697.                     echo $this->todaycellstart;
  698.                 }
  699.                 else
  700.                 {
  701.                     echo $this->cellstart;
  702.                 }
  703.                 echo T_($month_abbrevzeroise($i2]);
  704.  
  705.                 ifisset($monthswithposts$i ]) )
  706.                 // close anchor and show how many posts we have for this month
  707.                     if$monthswithposts$i && !empty($this->postcount_year_cell) )
  708.                     // display postcount
  709.                         printf($this->postcount_year_cell$monthswithposts$i ]);
  710.                     }
  711.                     elseif!empty($this->postcount_year_cell_one) )
  712.                     // display postcount for one post
  713.                         printf($this->postcount_year_cell_one1);
  714.                     }
  715.                     echo '</a>';
  716.                 }
  717.                 echo $this->cellend;
  718.                 if$i == || $i == )
  719.                 // new row
  720.                     echo $this->rowend.$this->rowstart;
  721.                 }
  722.             }
  723.         }
  724.         else // mode == 'month'
  725.         {    // Display current month:
  726.             $dow 0;
  727.             $last_day = -1;
  728.             $dom_displayed 0// days of month displayed
  729.  
  730.             for$i $calendarfirst$i <= $calendarlast$i $i 86400 )
  731.             // loop day by day (86400 seconds = 24 hours; but not on days where daylight saving changes!)
  732.                 if$dow == )
  733.                 // We need to start a new row:
  734.                     if$dom_displayed >= $daysinmonth )
  735.                     // Last day already displayed!
  736.                         break;
  737.                     }
  738.                     echo $this->rowend;
  739.                     echo $this->rowstart;
  740.                     $dow 0;
  741.                 }
  742.                 $dow++;
  743.  
  744.                 // correct daylight saving ("last day"+86400 would lead to "last day at 23:00")
  745.                 // fp> TODO: use mkdate()
  746.                 whiledate('j'$i== $last_day )
  747.                 {
  748.                     $i += 3600;
  749.                 }
  750.                 $last_day date('j'$i);
  751.  
  752.  
  753.                 if (date('m'$i!= $this->month)
  754.                 // empty cell
  755.                     echo $this->emptycellstart;
  756.                     echo $this->emptycellcontent;
  757.                     echo $this->emptycellend;
  758.                 }
  759.                 else
  760.                 // This day is in this month
  761.                     $dom_displayed++;
  762.                     $calendartoday (date('Ymd',$i== date('Ymd'(time($Settings->get('time_difference'))));
  763.  
  764.                     ifisset($daysinmonthwithpostsdate('j'$i]) )
  765.                     {
  766.                         if$calendartoday )
  767.                         {
  768.                             echo $this->todaycellstartpost;
  769.                         }
  770.                         else
  771.                         {
  772.                             echo $this->linkpostcellstart;
  773.                         }
  774.                         echo '<a href="'.$this->archive_link$this->year$this->monthdate('d',$i)'' ).'"';
  775.                         if$daysinmonthwithpostsdate('j'$i&& !empty($this->postcount_month_atitle) )
  776.                         // display postcount
  777.                             echo ' title="'.sprintf($this->postcount_month_atitle$daysinmonthwithpostsdate('j'$i]).'"';
  778.                         }
  779.                         elseif!empty($this->postcount_month_atitle_one) )
  780.                         // display postcount for one post
  781.                             echo ' title="'.sprintf($this->postcount_month_atitle_one1).'"';
  782.                         }
  783.                         echo '>';
  784.                     }
  785.                     elseif ($calendartoday)
  786.                     {
  787.                         echo $this->todaycellstart;
  788.                     }
  789.                     else
  790.                     {
  791.                         echo $this->cellstart;
  792.                     }
  793.                     echo date('j',$i);
  794.                     ifisset($daysinmonthwithpostsdate('j'$i]) )
  795.                     {
  796.                         if$daysinmonthwithpostsdate('j'$i&& !empty($this->postcount_month_cell) )
  797.                         // display postcount
  798.                             printf($this->postcount_month_cell$daysinmonthwithpostsdate('j'$i]);
  799.                         }
  800.                         elseif!empty($this->postcount_month_cell_one) )
  801.                         // display postcount for one post
  802.                             printf($this->postcount_month_cell_one1);
  803.                         }
  804.                         echo '</a>';
  805.                     }
  806.                     echo $this->cellend;
  807.                 }
  808.             // loop day by day
  809.         // mode == 'month'
  810.  
  811.         echo $this->rowend;
  812.  
  813.         echo $this->tableend;
  814.     }  // display(-)
  815.  
  816.  
  817.     /**
  818.      * Create a link to archive, using either URL params or extra path info.
  819.      *
  820.      * Can make contextual links.
  821.      *
  822.      * @param string year
  823.      * @param string month
  824.      * @param string day
  825.      * @param string week
  826.      */
  827.     function archive_link$year$month$day ''$week '' )
  828.     {
  829.         if$this->link_type == 'context' )
  830.         {    // We want to preserve context:
  831.             $url_params 'm='.$year;
  832.             if!empty$month ) )
  833.             {
  834.                 $url_params .= zeroise($month,2);
  835.                 if!empty$day ) )
  836.                 {
  837.                     $url_params .= zeroise($day,2);
  838.                 }
  839.             }
  840.             elseif$week !== '' )  // Note: week # can be 0 !
  841.             {
  842.                 $url_params .= '&amp;w='.$week;
  843.             }
  844.             return regenerate_url$this->context_isolation$url_params );
  845.         }
  846.         else
  847.         {    // We want a canonic link:
  848.             return archive_link$year$month$day$weekfalse );
  849.         }
  850.     }
  851.  
  852.  
  853.     /**
  854.      * Get links to navigate between month / year.
  855.      *
  856.      * Unless min/max_timestamp='query' has been specified, this will not do any (time consuming!) queries to check where the posts are.
  857.      *
  858.      * @param string 'prev' / 'next'
  859.      * @return array 
  860.      */
  861.     function getNavLinks$direction )
  862.     {
  863.         global $DB$localtimenow;
  864.  
  865.         //pre_dump( 'get_nav_links', $direction );
  866.  
  867.         $r array();
  868.  
  869.         // WE NEED SPECIAL QUERY PARAMS WHEN MOVING THOUGH MONTHS ( NO dstart especially! )
  870.         $nav_ItemQuery new ItemQuery$this->dbtable$this->dbprefix$this->dbIDname );    // TEMP object
  871.         // Restrict to selected blog/categories:
  872.         $nav_ItemQuery->where_chapter$this->ItemQuery->blog$this->ItemQuery->cat$this->ItemQuery->catsel );
  873.         // Restrict to the statuses we want to show:
  874.         $nav_ItemQuery->where_visibility$this->ItemQuery->show_statuses );
  875.         // Restrict to selected authors:
  876.         $nav_ItemQuery->where_author$this->ItemQuery->author );
  877.         // if a month is specified in the querystring, load that month:
  878.         $nav_ItemQuery->where_datestart/* NO m */''/* NO w */''/* NO dstart */''''$this->ItemQuery->timestamp_min$this->ItemQuery->timestamp_max );
  879.         // Keyword search stuff:
  880.         $nav_ItemQuery->where_keywords$this->ItemQuery->keywords$this->ItemQuery->phrase$this->ItemQuery->exact );
  881.  
  882.         switch$direction )
  883.         {
  884.             case 'prev':
  885.                 //pre_dump( $this->params['min_timestamp'] );
  886.                 $r['';
  887.  
  888.                 ifempty($this->month) )
  889.                 // if $this->month is empty, we're in mode "year" with no selected month
  890.                     $use_range_month 12;
  891.                     $use_range_day 31;
  892.                 }
  893.                 else
  894.                 {
  895.                     $use_range_month $this->month;
  896.                     $use_range_day 1;    // Note: cannot use current day since all months do not have same number of days
  897.                 }
  898.  
  899.                 /*
  900.                  * << (PREV YEAR)
  901.                  */
  902.                 if$this->browseyears )
  903.                 {    // We want arrows to move one year at a time
  904.                     if$this->params['min_timestamp'== 'query' )
  905.                     {    // Let's query to find the correct year:
  906.                         if$row $DB->get_row(
  907.                                 'SELECT YEAR('.$this->dbprefix.'datestart) AS year,
  908.                                                 MONTH('.$this->dbprefix.'datestart) AS month
  909.                                     FROM ('.$this->dbtable.' INNER JOIN T_postcats ON '.$this->dbIDname.' = postcat_post_ID)
  910.                                         INNER JOIN T_categories ON postcat_cat_ID = cat_ID
  911.                                     WHERE YEAR('.$this->dbprefix.'datestart) < '.$this->year.'
  912.                                     '.$nav_ItemQuery->get_where' AND ' )
  913.                                     .$nav_ItemQuery->get_group_by' GROUP BY ' ).'
  914.                                     ORDER BY YEAR('.$this->dbprefix.'datestart) DESC, ABS( '.$use_range_month.' - MONTH('.$this->dbprefix.'datestart) ) ASC
  915.                                     LIMIT 1'OBJECT0'Calendar: find prev year with posts' )
  916.                             )
  917.                         {
  918.                             $prev_year_year $row->year;
  919.                             $prev_year_month $row->month;
  920.                         }
  921.                     }
  922.                     else
  923.                     // Let's see if the previous year is in the desired navigation range:
  924.                         $prev_year_ts mktime000$use_range_month$use_range_day,  $this->year-);
  925.                         if$prev_year_ts >= $this->params['min_timestamp')
  926.                         {
  927.                             $prev_year_year date'Y'$prev_year_ts );
  928.                             $prev_year_month date'm'$prev_year_ts );
  929.                         }
  930.                     }
  931.                 }
  932.  
  933.                 if!empty($prev_year_year) )
  934.                 {    // We have a link to display:
  935.                     $r['<a href="'.$this->archive_link$prev_year_year($this->mode == 'month'$prev_year_month '''''' )
  936.                                     .'" title="'.sprintf(
  937.                                                 $this->mode == 'month'
  938.                                                         ? /* Calendar link title to a month in a previous year */ T_('Previous year (%04d-%02d)')
  939.                                                         : /* Calendar link title to a previous year */ T_('Previous year (%04d)') ),
  940.                                                 $prev_year_year$prev_year_month )
  941.                                     .'">&lt;&lt;</a>';
  942.                 }
  943.  
  944.  
  945.                 /*
  946.                  * < (PREV MONTH)
  947.                  */
  948.                 if$this->mode == 'month' )
  949.                 // We are browsing months, we'll display arrows to move one month at a time:
  950.                     if$this->params['min_timestamp'== 'query' )
  951.                     {    // Let's query to find the correct month:
  952.                         if$row $DB->get_row(
  953.                                 'SELECT MONTH('.$this->dbprefix.'datestart) AS month,
  954.                                                 YEAR('.$this->dbprefix.'datestart) AS year
  955.                                 FROM ('.$this->dbtable.' INNER JOIN T_postcats ON '.$this->dbIDname.' = postcat_post_ID)
  956.                                     INNER JOIN T_categories ON postcat_cat_ID = cat_ID
  957.                                 WHERE
  958.                                 (
  959.                                     YEAR('.$this->dbprefix.'datestart) < '.($this->year).'
  960.                                     OR ( YEAR('.$this->dbprefix.'datestart) = '.($this->year).'
  961.                                                 AND MONTH('.$this->dbprefix.'datestart) < '.($this->month).'
  962.                                             )
  963.                                 )
  964.                                 '.$nav_ItemQuery->get_where' AND ' )
  965.                                  .$nav_ItemQuery->get_group_by' GROUP BY ' ).'
  966.                                 ORDER BY YEAR('.$this->dbprefix.'datestart) DESC, MONTH('.$this->dbprefix.'datestart) DESC
  967.                                 LIMIT 1',
  968.                                 OBJECT,
  969.                                 0,
  970.                                 'Calendar: Find prev month with posts' )
  971.                             )
  972.                         {
  973.                             $prev_month_year $row->year;
  974.                             $prev_month_month $row->month;
  975.                         }
  976.                     }
  977.                     else
  978.                     // Let's see if the previous month is in the desired navigation range:
  979.                         $prev_month_ts mktime000$this->month-11$this->year )// Note: cannot use current day since all months do not have same number of days
  980.                         if$prev_month_ts >= $this->params['min_timestamp')
  981.                         {
  982.                             $prev_month_year date'Y'$prev_month_ts );
  983.                             $prev_month_month date'm'$prev_month_ts );
  984.                         }
  985.                     }
  986.                 }
  987.  
  988.                 if!empty($prev_month_year) )
  989.                 {    // We have a link to display:
  990.                     $r['<a href="'
  991.                                     .$this->archive_link$prev_month_year$prev_month_month'''' )
  992.                                     .'" title="'.sprintfT_('Previous month (%04d-%02d)')$prev_month_year$prev_month_month ).'">&lt;</a>';
  993.                 }
  994.                 break;
  995.  
  996.  
  997.             case 'next':
  998.                 //pre_dump( $this->params['max_timestamp'] );
  999.  
  1000.                 /*
  1001.                  * > (NEXT MONTH)
  1002.                  */
  1003.                 if$this->mode == 'month' )
  1004.                 // We are browsing months, we'll display arrows to move one month at a time:
  1005.                     if$this->params['max_timestamp'== 'query' )
  1006.                     {    // Let's query to find the correct month:
  1007.                         if$row $DB->get_row(
  1008.                                 'SELECT MONTH('.$this->dbprefix.'datestart) AS month,
  1009.                                                 YEAR('.$this->dbprefix.'datestart) AS year
  1010.                                 FROM ('.$this->dbtable.' INNER JOIN T_postcats ON '.$this->dbIDname.' = postcat_post_ID)
  1011.                                     INNER JOIN T_categories ON postcat_cat_ID = cat_ID
  1012.                                 WHERE
  1013.                                 (
  1014.                                     YEAR('.$this->dbprefix.'datestart) > '.($this->year).'
  1015.                                     OR ( YEAR('.$this->dbprefix.'datestart) = '.($this->year).'
  1016.                                                 AND MONTH('.$this->dbprefix.'datestart) > '.($this->month).'
  1017.                                             )
  1018.                                 )
  1019.                                 '.$nav_ItemQuery->get_where' AND ' )
  1020.                                  .$nav_ItemQuery->get_group_by' GROUP BY ' ).'
  1021.                                 ORDER BY YEAR('.$this->dbprefix.'datestart), MONTH('.$this->dbprefix.'datestart) ASC
  1022.                                 LIMIT 1',
  1023.                                 OBJECT,
  1024.                                 0,
  1025.                                 'Calendar: Find next month with posts' )
  1026.                             )
  1027.                         {
  1028.                             $next_month_year $row->year;
  1029.                             $next_month_month $row->month;
  1030.                         }
  1031.                     }
  1032.                     else
  1033.                     // Let's see if the next month is in the desired navigation range:
  1034.                         $next_month_ts mktime000$this->month+11,  $this->year )// Note: cannot use current day since all months do not have same number of days
  1035.                         if$next_month_ts <= $this->params['max_timestamp')
  1036.                         {
  1037.                             $next_month_year date'Y'$next_month_ts );
  1038.                             $next_month_month date'm'$next_month_ts );
  1039.                         }
  1040.                     }
  1041.                 }
  1042.  
  1043.                 if!empty($next_month_year) )
  1044.                 {    // We have a link to display:
  1045.                     $r['<a href="'
  1046.                                     .$this->archive_link$next_month_year$next_month_month'''' )
  1047.                                     .'" title="'.sprintfT_('Next month (%04d-%02d)')$next_month_year$next_month_month ).'">&gt;</a>';
  1048.                 }
  1049.  
  1050.  
  1051.                 ifempty($this->month) )
  1052.                 // if $this->month is empty, we're in mode "year" with no selected month
  1053.                     $use_range_month 12;
  1054.                     $use_range_day 31;
  1055.                 }
  1056.                 else
  1057.                 {
  1058.                     $use_range_month $this->month;
  1059.                     $use_range_day 1;    // Note: cannot use current day since all months do not have same number of days
  1060.                 }
  1061.  
  1062.                 /*
  1063.                  * >> (NEXT YEAR)
  1064.                  */
  1065.                 if$this->browseyears )
  1066.                 // We want arrows to move one year at a time
  1067.                     if$this->params['max_timestamp'== 'query' )
  1068.                     {    // Let's query to find the correct year:
  1069.                     if$row $DB->get_row(
  1070.                             'SELECT YEAR('.$this->dbprefix.'datestart) AS year,
  1071.                                             MONTH('.$this->dbprefix.'datestart) AS month
  1072.                                 FROM ('.$this->dbtable.' INNER JOIN T_postcats ON '.$this->dbIDname.' = postcat_post_ID)
  1073.                                     INNER JOIN T_categories ON postcat_cat_ID = cat_ID
  1074.                                 WHERE YEAR('.$this->dbprefix.'datestart) > '.$this->year.'
  1075.                                  '.$nav_ItemQuery->get_where' AND ' )
  1076.                                  .$nav_ItemQuery->get_group_by' GROUP BY ' ).'
  1077.                                 ORDER BY YEAR('.$this->dbprefix.'datestart) ASC, ABS( '.$use_range_month.' - MONTH('.$this->dbprefix.'datestart) ) ASC
  1078.                                 LIMIT 1'OBJECT0'Calendar: find next year with posts' )
  1079.                         )
  1080.                         {
  1081.                             $next_year_year $row->year;
  1082.                             $next_year_month $row->month;
  1083.                         }
  1084.                     }
  1085.                     else
  1086.                     // Let's see if the next year is in the desired navigation range:
  1087.                         $next_year_ts mktime000$use_range_month$use_range_day,  $this->year+);
  1088.                         if$next_year_ts <= $this->params['max_timestamp')
  1089.                         {
  1090.                             $next_year_year date'Y'$next_year_ts );
  1091.                             $next_year_month date'm'$next_year_ts );
  1092.                         }
  1093.                     }
  1094.  
  1095.                 if!empty($next_year_year) )
  1096.                 {    // We have a link to display:
  1097.                         $r['<a href="'.$this->archive_link$next_year_year($this->mode == 'month'$next_year_month '''''' )
  1098.                                         .'" title="'.sprintf(
  1099.                                                                     $this->mode == 'month'
  1100.                                                                             ? /* Calendar link title to a month in a following year */ T_('Next year (%04d-%02d)')
  1101.                                                                             : /* Calendar link title to a following year */ T_('Next year (%04d)') ),
  1102.                                                                     $next_year_year$next_year_month )
  1103.                                         .'">&gt;&gt;</a>';
  1104.                     }
  1105.                 }
  1106.                 break;
  1107.         }
  1108.  
  1109.         return $r;
  1110.     }
  1111.  
  1112. }
  1113.  
  1114. /*
  1115.  * $Log: _calendar.plugin.php,v $
  1116.  * Revision 1.26.2.7  2007/03/29 10:34:48  fplanque
  1117.  * fix
  1118.  *
  1119.  * Revision 1.26.2.6  2006/12/26 03:18:50  fplanque
  1120.  * assigned a few significant plugin groups
  1121.  *
  1122.  * Revision 1.26.2.5  2006/11/04 19:55:11  fplanque
  1123.  * Reinjected old Log blocks. Removing them from CVS was a bad idea -- especially since Daniel has decided branch 1.9 was his HEAD...
  1124.  *
  1125.  * Revision 1.26  2006/07/28 15:27:47  blueyed
  1126.  * marked BUG
  1127.  *
  1128.  * Revision 1.25  2006/07/22 18:21:19  blueyed
  1129.  * Fixed doc (min_timestamp/max_timestamp)
  1130.  *
  1131.  * Revision 1.24  2006/07/12 22:09:49  blueyed
  1132.  * Fixed "Notice: A non well formed numeric value encountered" notices + whitespace
  1133.  *
  1134.  * Revision 1.23  2006/07/12 15:40:50  fplanque
  1135.  * save 4 expensive queries
  1136.  *
  1137.  * Revision 1.22  2006/07/10 20:19:30  blueyed
  1138.  * Fixed PluginInit behaviour. It now gets called on both installed and non-installed Plugins, but with the "is_installed" param appropriately set.
  1139.  *
  1140.  * Revision 1.21  2006/07/07 21:26:49  blueyed
  1141.  * Bumped to 1.9-dev
  1142.  *
  1143.  * Revision 1.20  2006/07/02 21:53:31  blueyed
  1144.  * time difference as seconds instead of hours; validate user#1 on upgrade; bumped new_db_version to 9300.
  1145.  *
  1146.  * Revision 1.19  2006/06/16 21:30:57  fplanque
  1147.  * Started clean numbering of plugin versions (feel free do add dots...)
  1148.  *
  1149.  * Revision 1.18  2006/05/30 20:25:35  blueyed
  1150.  * typo
  1151.  *
  1152.  * Revision 1.17  2006/05/30 19:39:55  fplanque
  1153.  * plugin cleanup
  1154.  *
  1155.  * Revision 1.16  2006/04/19 20:14:03  fplanque
  1156.  * do not restrict to :// (does not catch subdomains, not even www.)
  1157.  *
  1158.  * Revision 1.15  2006/03/17 18:08:37  blueyed
  1159.  * removed false todo
  1160.  *
  1161.  * Revision 1.13  2006/03/12 23:09:27  fplanque
  1162.  * doc cleanup
  1163.  *
  1164.  * Revision 1.12  2006/02/03 21:58:05  fplanque
  1165.  * Too many merges, too little time. I can hardly keep up. I'll try to check/debug/fine tune next week...
  1166.  *
  1167.  * Revision 1.11  2006/01/04 20:34:51  fplanque
  1168.  * allow filtering on extra statuses
  1169.  *
  1170.  * Revision 1.10  2005/12/12 19:22:04  fplanque
  1171.  * big merge; lots of small mods; hope I didn't make to many mistakes :]
  1172.  *
  1173.  * Revision 1.9  2005/10/03 18:10:08  fplanque
  1174.  * renamed post_ID field
  1175.  *
  1176.  * Revision 1.8  2005/09/06 19:38:29  fplanque
  1177.  * bugfixes
  1178.  *
  1179.  * Revision 1.7  2005/09/06 17:14:12  fplanque
  1180.  * stop processing early if referer spam has been detected
  1181.  *
  1182.  * Revision 1.6  2005/09/01 17:11:46  fplanque
  1183.  * no message
  1184.  *
  1185.  *
  1186.  * Merged in _calendar.class.php; history below:
  1187.  *
  1188.  * Revision 1.18  2005/08/31 19:08:51  fplanque
  1189.  * Factorized Item query WHERE clause.
  1190.  * Fixed calendar contextual accuracy.
  1191.  *
  1192.  * Revision 1.17  2005/08/26 18:41:31  fplanque
  1193.  * bugfix
  1194.  *
  1195.  * Revision 1.16  2005/08/26 17:52:02  fplanque
  1196.  * abstraction
  1197.  *
  1198.  * Revision 1.15  2005/08/26 16:15:08  fplanque
  1199.  * made the whole calendar contextual (wow am I happy about this functionality! :)
  1200.  *
  1201.  * Revision 1.14  2005/08/25 11:02:11  fplanque
  1202.  * moved calendar to a skintag plugin
  1203.  *
  1204.  * Revision 1.13  2005/05/09 19:07:03  fplanque
  1205.  * bugfixes + global access permission
  1206.  *
  1207.  * Revision 1.12  2005/04/27 19:05:46  fplanque
  1208.  * normalizing, cleanup, documentaion
  1209.  *
  1210.  * Revision 1.10  2005/03/18 01:40:50  blueyed
  1211.  * link to prev month fixed
  1212.  *
  1213.  * Revision 1.9  2005/03/18 00:29:32  blueyed
  1214.  * navigation: only link to month/year with posts
  1215.  *
  1216.  * Revision 1.8  2005/03/07 17:08:20  fplanque
  1217.  * made more generic
  1218.  *
  1219.  * Revision 1.7  2005/02/28 09:06:32  blueyed
  1220.  * removed constants for DB config (allows to override it from _config_TEST.php), introduced EVO_CONFIG_LOADED
  1221.  *
  1222.  * Revision 1.6  2005/02/23 19:31:58  blueyed
  1223.  * get_weekstartend() fixed
  1224.  *
  1225.  * Revision 1.5  2005/02/23 04:26:18  blueyed
  1226.  * moved global $start_of_week into $locales properties
  1227.  *
  1228.  * Revision 1.4  2005/02/12 03:58:44  blueyed
  1229.  * default to $navigation = 'tfoot', fixed queries that find posts in month or on day, refactored navigation link generation
  1230.  *
  1231.  * Revision 1.3  2004/12/13 21:29:58  fplanque
  1232.  * refactoring
  1233.  *
  1234.  * Revision 1.2  2004/10/14 18:31:24  blueyed
  1235.  * granting copyright
  1236.  *
  1237.  * Revision 1.1  2004/10/13 22:46:32  fplanque
  1238.  * renamed [b2]evocore/*
  1239.  *
  1240.  * Revision 1.34  2004/10/11 19:02:04  fplanque
  1241.  * Edited code documentation.
  1242.  *
  1243.  * Revision 1.6  2004/1/15 20:49:14  hansreinders
  1244.  * Add more flexibility to calendar
  1245.  */
  1246. ?>

Documentation generated on Tue, 18 Dec 2007 19:12:36 +0100 by phpDocumentor 1.4.0