b2evolution PHP Cross Reference Blogging Systems

Source: /plugins/_archives.plugin.php - 641 lines - 20332 bytes - Summary - Text - Print

Description: This file implements the Archives plugin. Displays a list of post archives.

   1  <?php
   2  /**
   3   * This file implements the Archives plugin.
   4   *
   5   * Displays a list of post archives.
   6   *
   7   * This file is part of the b2evolution project - {@link http://b2evolution.net/}
   8   *
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  11   *
  12   * {@internal License choice
  13   * - If you have received this file as part of a package, please find the license.txt file in
  14   *   the same folder or the closest folder above for complete license terms.
  15   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  16   *   then you must choose one of the following licenses before using the file:
  17   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  18   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  19   * }}
  20   *
  21   * {@internal Open Source relicensing agreement:
  22   * Daniel HAHLER grants Francois PLANQUE the right to license
  23   * Daniel HAHLER's contributions to this file and the b2evolution project
  24   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  25   * }}
  26   *
  27   * @package plugins
  28   *
  29   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  30   * @author blueyed: Daniel HAHLER.
  31   * @author fplanque: Francois PLANQUE - {@link http://fplanque.net/}
  32   * @author cafelog (group)
  33   *
  34   * @version $Id: _archives.plugin.php 6136 2014-03-08 07:59:48Z manuel $
  35   */
  36  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  37  
  38  
  39  load_class( '_core/ui/results/_results.class.php', 'Results' );
  40  load_class( '/items/model/_itemlistlight.class.php', 'ItemListLight' );
  41  
  42  
  43  /**
  44   * Archives Plugin
  45   *
  46   * This plugin displays
  47   */
  48  class archives_plugin extends Plugin
  49  {
  50      /**
  51       * Variables below MUST be overriden by plugin implementations,
  52       * either in the subclass declaration or in the subclass constructor.
  53       */
  54  
  55      var $name;
  56      var $code = 'evo_Arch';
  57      var $priority = 50;
  58      var $version = '5.0.0';
  59      var $author = 'The b2evo Group';
  60      var $group = 'widget';
  61  
  62  
  63      /**
  64       * Init
  65       */
  66  	function PluginInit( & $params )
  67      {
  68          $this->name = T_( 'Archives Widget' );
  69          $this->short_desc = T_('This skin tag displays a list of post archives.');
  70          $this->long_desc = T_('Archives can be grouped monthly, daily, weekly or post by post.');
  71  
  72          $this->dbtable = 'T_items__item';
  73          $this->dbprefix = 'post_';
  74          $this->dbIDname = 'post_ID';
  75      }
  76  
  77  
  78      /**
  79       * Event handler: SkinTag
  80       *
  81       * @param array Associative array of parameters. Valid keys are:
  82       *                - 'block_start' : (Default: '<div class="bSideItem">')
  83       *                - 'block_end' : (Default: '</div>')
  84       *                - 'title' : (Default: T_('Archives'))
  85       *                - 'mode' : 'monthly'|'daily'|'weekly'|'postbypost' (Default: conf.)
  86       *                - 'sort_order' : 'date'|'title' (Default: date - used only if the mode is 'postbypost')
  87       *                - 'link_type' : 'canonic'|'context' (default: canonic)
  88       *                - 'context_isolation' : what params need override when changing date/range (Default: 'm,w,p,title,unit,dstart' )
  89       *                - 'form' : true|false (default: false)
  90       *                - 'limit' : # of archive entries to display or '' (Default: 12)
  91       *                - 'more_link' : more link text (Default: 'More...')
  92       *                - 'list_start' : (Default '<ul>')
  93       *                - 'list_end' : (Default '</ul>')
  94       *                - 'line_start' : (Default '<li>')
  95       *                - 'line_end' : (Default '</li>')
  96       *                - 'day_date_format' : (Default: conf.)
  97       * @return boolean did we display?
  98       */
  99  	function SkinTag( $params )
 100      {
 101          global $month;
 102  
 103          /**
 104           * @todo get rid of this global:
 105           */
 106          global $m;
 107  
 108          /**
 109           * @var Blog
 110           */
 111          global $Blog;
 112  
 113          if( empty($Blog) )
 114          {
 115              return false;
 116          }
 117  
 118          // Prefix of the ItemList object
 119          $itemlist_prefix = isset( $params['itemlist_prefix'] ) ? $params['itemlist_prefix'] : '';
 120  
 121          /**
 122           * Default params:
 123           */
 124          // This is what will enclose the block in the skin:
 125          if(!isset($params['block_start'])) $params['block_start'] = '<div class="bSideItem">';
 126          if(!isset($params['block_end'])) $params['block_end'] = "</div>\n";
 127  
 128          // Title:
 129          if(!isset($params['block_title_start'])) $params['block_title_start'] = '<h3>';
 130          if(!isset($params['block_title_end'])) $params['block_title_end'] = '</h3>';
 131  
 132          // Archive mode:
 133          if(!isset($params['mode']))
 134              $params['mode'] = $Blog->get_setting('archive_mode');
 135  
 136          //Sort order (used only in postbypost mode):
 137          if($params['mode'] !='postbypost')
 138          {
 139              $params['sort_order'] = 'date';
 140          }
 141          if(!isset($params['sort_order']))
 142          {
 143              $params['sort_order'] = $Blog->get_setting('archives_sort_order');
 144          }
 145  
 146          // Link type:
 147          if(!isset($params['link_type'])) $params['link_type'] = 'canonic';
 148          if(!isset($params['context_isolation'])) $params['context_isolation'] = $itemlist_prefix.'m,'.$itemlist_prefix.'w,'.$itemlist_prefix.'p,'.$itemlist_prefix.'title,'.$itemlist_prefix.'unit,'.$itemlist_prefix.'dstart';
 149  
 150          // Add form fields?:
 151          if(!isset($params['form']))
 152              $params['form'] = false;
 153  
 154          // Number of archive entries to display:
 155          if(!isset($params['limit'])) $params['limit'] = 12;
 156  
 157          // More link text:
 158          if(!isset($params['more_link'])) $params['more_link'] = T_('More...');
 159  
 160          // This is what will enclose the list:
 161          if(!isset($params['list_start'])) $params['list_start'] = '<ul>';
 162          if(!isset($params['list_end'])) $params['list_end'] = "</ul>\n";
 163  
 164          // This is what will separate the archive links:
 165          if(!isset($params['line_start'])) $params['line_start'] = '<li>';
 166          if(!isset($params['line_end'])) $params['line_end'] = "</li>\n";
 167  
 168          // Daily archive date format?
 169          if( (!isset($params['day_date_format'])) || ($params['day_date_format'] == '') )
 170          {
 171              $dateformat = locale_datefmt();
 172              $params['day_date_format'] = $dateformat;
 173          }
 174  
 175          $ArchiveList = new ArchiveList( $params['mode'], $params['limit'], $params['sort_order'], ($params['link_type'] == 'context'),
 176                                                                              $this->dbtable, $this->dbprefix, $this->dbIDname );
 177  
 178          echo $params['block_start'];
 179  
 180          if( !empty($params['title']) )
 181          {    // We want to display a title for the widget block:
 182              echo $params['block_title_start'];
 183              echo $params['title'];
 184              echo $params['block_title_end'];
 185          }
 186  
 187          echo $params['list_start'];
 188          while( $ArchiveList->get_item( $arc_year, $arc_month, $arc_dayofmonth, $arc_w, $arc_count, $post_ID, $post_title, $permalink) )
 189          {
 190              echo $params['line_start'];
 191              switch( $params['mode'] )
 192              {
 193                  case 'monthly':
 194                      // --------------------------------- MONTHLY ARCHIVES -------------------------------------
 195                      $arc_m = $arc_year.zeroise($arc_month,2);
 196  
 197                      if( $params['form'] )
 198                      { // We want a radio button:
 199                          echo '<input type="radio" name="'.$itemlist_prefix.'m" value="'.$arc_m.'" class="checkbox"';
 200                          if( $m == $arc_m ) echo ' checked="checked"' ;
 201                          echo ' /> ';
 202                      }
 203  
 204                      $text = T_($month[zeroise($arc_month,2)]).' '.$arc_year;
 205  
 206                      if( $params['link_type'] == 'context' )
 207                      {    // We want to preserve current browsing context:
 208                          echo '<a rel="nofollow" href="'.regenerate_url( $params['context_isolation'], $itemlist_prefix.'m='.$arc_m ).'">'.$text.'</a>';
 209                      }
 210                      else
 211                      {    // We want to link to the absolute canonical URL for this archive:
 212                          echo $Blog->gen_archive_link( $text, T_('View monthly archive'), $arc_year, $arc_month );
 213                      }
 214  
 215                      echo ' <span class="dimmed">('.$arc_count.')</span>';
 216                      break;
 217  
 218                  case 'daily':
 219                      // --------------------------------- DAILY ARCHIVES ---------------------------------------
 220                      $arc_m = $arc_year.zeroise($arc_month,2).zeroise($arc_dayofmonth,2);
 221  
 222                      if( $params['form'] )
 223                      { // We want a radio button:
 224                          echo '<input type="radio" name="'.$itemlist_prefix.'m" value="'. $arc_m. '" class="checkbox"';
 225                          if( $m == $arc_m ) echo ' checked="checked"' ;
 226                          echo ' /> ';
 227                      }
 228  
 229                      $text = mysql2date($params['day_date_format'], $arc_year.'-'.zeroise($arc_month,2).'-'.zeroise($arc_dayofmonth,2).' 00:00:00');
 230  
 231                      if( $params['link_type'] == 'context' )
 232                      {    // We want to preserve current browsing context:
 233                          echo '<a rel="nofollow" href="'.regenerate_url( $params['context_isolation'], $itemlist_prefix.'m='.$arc_m ).'">'.$text.'</a>';
 234                      }
 235                      else
 236                      {    // We want to link to the absolute canonical URL for this archive:
 237                          echo $Blog->gen_archive_link( $text, T_('View daily archive'), $arc_year, $arc_month, $arc_dayofmonth );
 238                      }
 239  
 240                      echo ' <span class="dimmed">('.$arc_count.')</span>';
 241                      break;
 242  
 243                  case 'weekly':
 244                      // --------------------------------- WEEKLY ARCHIVES --------------------------------------
 245  
 246                      $text = $arc_year.', '.T_('week').' '.$arc_w;
 247  
 248                      if( $params['link_type'] == 'context' )
 249                      {    // We want to preserve current browsing context:
 250                          echo '<a rel="nofollow" href="'.regenerate_url( $params['context_isolation'], $itemlist_prefix.'m='.$arc_year.'&amp;'.$itemlist_prefix.'w='.$arc_w ).'">'.$text.'</a>';
 251                      }
 252                      else
 253                      {    // We want to link to the absolute canonical URL for this archive:
 254                          echo $Blog->gen_archive_link( $text, T_('View weekly archive'), $arc_year, NULL, NULL, $arc_w );
 255                      }
 256                      echo ' <span class="dimmed">('.$arc_count.')</span>';
 257                      break;
 258  
 259                  case 'postbypost':
 260                  default:
 261                      // -------------------------------- POST BY POST ARCHIVES ---------------------------------
 262  
 263                      if( $post_title)
 264                      {
 265                          $text = strip_tags($post_title);
 266                      }
 267                      else
 268                      {
 269                          $text = $post_ID;
 270                      }
 271  
 272                      if( $params['link_type'] == 'context' )
 273                      {    // We want to preserve current browsing context:
 274                          echo '<a rel="nofollow" href="'.regenerate_url( $params['context_isolation'], 'p='.$post_ID ).'">'.$text.'</a>';
 275                      }
 276                      else
 277                      {
 278                          // fp> THIS IS ALL OBSOLETE. There is a better way to have a post list with a specific widget.
 279                          // TO BE DELETED (waiting for photoblog cleanup)
 280  
 281                          // until the cleanup, a fix. I hope.
 282  
 283                          echo '<a href="'. $permalink .'">'.$text.'</a>';
 284                      }
 285              }
 286  
 287              echo $params['line_end'];
 288          }
 289  
 290          // Display more link:
 291          if( !empty($params['more_link']) )
 292          {
 293              echo $params['line_start'];
 294              echo '<a href="';
 295              $Blog->disp( 'arcdirurl', 'raw' );
 296              echo '">'.format_to_output($params['more_link']).'</a>';
 297              echo $params['line_end'];
 298          }
 299  
 300          echo $params['list_end'];
 301  
 302          echo $params['block_end'];
 303  
 304          return true;
 305      }
 306  
 307  
 308    /**
 309     * Get definitions for widget specific editable params
 310     *
 311       * @see Plugin::GetDefaultSettings()
 312       * @param local params like 'for_editing' => true
 313       */
 314  	function get_widget_param_definitions( $params )
 315      {
 316          $r = array(
 317              'title' => array(
 318                      'label' => T_('Block title'),
 319                      'note' => T_('Title to display in your skin.'),
 320                      'size' => 60,
 321                      'defaultvalue' => T_('Archives'),
 322              ),
 323              'limit' => array(
 324                  'label' => T_( 'Max items' ),
 325                  'note' => T_( 'Maximum number of items to display.' ),
 326                  'size' => 4,
 327                  'defaultvalue' => 12,
 328              ),
 329          );
 330          return $r;
 331      }
 332  
 333  }
 334  
 335  
 336  /**
 337   * Archive List Class
 338   *
 339   * @package evocore
 340   */
 341  class ArchiveList extends Results
 342  {
 343      var $archive_mode;
 344      var $arc_w_last;
 345  
 346      /**
 347       * Constructor
 348       *
 349       * Note: Weekly archives use MySQL's week numbering and MySQL default if applicable.
 350       * In MySQL < 4.0.14, WEEK() always uses mode 0: Week starts on Sunday;
 351       * Value range is 0 to 53; week 1 is the first week that starts in this year.
 352       *
 353       * @link http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
 354       *
 355       * @todo categories combined with 'ALL' are not supported (will output too many archives,
 356       * some of which will resolve to no results). We need subqueries to support this efficiently.
 357       *
 358       * @param string
 359       * @param integer
 360       * @param boolean
 361       */
 362  	function ArchiveList(
 363          $archive_mode = 'monthly',
 364          $limit = 100,
 365          $sort_order = 'date',
 366          $preserve_context = false,
 367          $dbtable = 'T_items__item',
 368          $dbprefix = 'post_',
 369          $dbIDname = 'ID' )
 370      {
 371          global $DB;
 372          global $blog, $cat, $catsel;
 373          global $Blog;
 374          global $show_statuses;
 375          global $author, $assgn, $status, $types;
 376          global $s, $sentence, $exact;
 377          global $posttypes_specialtypes;
 378  
 379          $this->dbtable = $dbtable;
 380          $this->dbprefix = $dbprefix;
 381          $this->dbIDname = $dbIDname;
 382          $this->archive_mode = $archive_mode;
 383  
 384  
 385          /*
 386           * WE ARE GOING TO CONSTRUCT THE WHERE CLOSE...
 387           */
 388          $this->ItemQuery = new ItemQuery( $this->dbtable, $this->dbprefix, $this->dbIDname ); // TEMPORARY OBJ
 389  
 390          // - - Select a specific Item:
 391          // $this->ItemQuery->where_ID( $p, $title );
 392  
 393          if( is_admin_page() )
 394          {    // Don't restrict by date in the Back-office
 395              $timestamp_min = NULL;
 396              $timestamp_max = NULL;
 397          }
 398          else
 399          {    // Restrict posts by date started
 400              $timestamp_min = $Blog->get_timestamp_min();
 401              $timestamp_max = $Blog->get_timestamp_max();
 402          }
 403  
 404          if( $preserve_context )
 405          {    // We want to preserve the current context:
 406              // * - - Restrict to selected blog/categories:
 407              $this->ItemQuery->where_chapter( $blog, $cat, $catsel );
 408  
 409              // * Restrict to the statuses we want to show:
 410              $this->ItemQuery->where_visibility( $show_statuses );
 411  
 412              // Restrict to selected authors:
 413              $this->ItemQuery->where_author( $author );
 414  
 415              // Restrict to selected assignees:
 416              $this->ItemQuery->where_assignees( $assgn );
 417  
 418              // Restrict to selected satuses:
 419              $this->ItemQuery->where_statuses( $status );
 420  
 421              // - - - + * * timestamp restrictions:
 422              $this->ItemQuery->where_datestart( '', '', '', '', $timestamp_min, $timestamp_max );
 423  
 424              // Keyword search stuff:
 425              $this->ItemQuery->where_keywords( $s, $sentence, $exact );
 426  
 427              $this->ItemQuery->where_types( $types );
 428          }
 429          else
 430          {    // We want to preserve only the minimal context:
 431              // * - - Restrict to selected blog/categories:
 432              $this->ItemQuery->where_chapter( $blog, '', array() );
 433  
 434              // * Restrict to the statuses we want to show:
 435              $this->ItemQuery->where_visibility( $show_statuses );
 436  
 437              // - - - + * * timestamp restrictions:
 438              $this->ItemQuery->where_datestart( '', '', '', '', $timestamp_min, $timestamp_max );
 439  
 440              // Include all types except pages, intros and sidebar links:
 441              $this->ItemQuery->where_types( '-'.implode(',',$posttypes_specialtypes) );
 442          }
 443  
 444  
 445          $this->from = $this->ItemQuery->get_from();
 446          $this->where = $this->ItemQuery->get_where();
 447          $this->group_by = $this->ItemQuery->get_group_by();
 448  
 449          switch( $this->archive_mode )
 450          {
 451              case 'monthly':
 452                  // ------------------------------ MONTHLY ARCHIVES ------------------------------------
 453                  $sql = 'SELECT EXTRACT(YEAR FROM '.$this->dbprefix.'datestart) AS year, EXTRACT(MONTH FROM '.$this->dbprefix.'datestart) AS month,
 454                                                                      COUNT(DISTINCT postcat_post_ID) AS count '
 455                                                      .$this->from
 456                                                      .$this->where.'
 457                                                      GROUP BY year, month
 458                                                      ORDER BY year DESC, month DESC';
 459                  break;
 460  
 461              case 'daily':
 462                  // ------------------------------- DAILY ARCHIVES -------------------------------------
 463                  $sql = 'SELECT EXTRACT(YEAR FROM '.$this->dbprefix.'datestart) AS year, MONTH('.$this->dbprefix.'datestart) AS month,
 464                                                                      DAYOFMONTH('.$this->dbprefix.'datestart) AS day,
 465                                                                      COUNT(DISTINCT postcat_post_ID) AS count '
 466                                                      .$this->from
 467                                                      .$this->where.'
 468                                                      GROUP BY year, month, day
 469                                                      ORDER BY year DESC, month DESC, day DESC';
 470                  break;
 471  
 472              case 'weekly':
 473                  // ------------------------------- WEEKLY ARCHIVES -------------------------------------
 474                  $sql = 'SELECT EXTRACT(YEAR FROM '.$this->dbprefix.'datestart) AS year, '.
 475                                                              $DB->week( $this->dbprefix.'datestart', locale_startofweek() ).' AS week,
 476                                                              COUNT(DISTINCT postcat_post_ID) AS count '
 477                                                      .$this->from
 478                                                      .$this->where.'
 479                                                      GROUP BY year, week
 480                                                      ORDER BY year DESC, week DESC';
 481                  break;
 482  
 483              case 'postbypost':
 484              default:
 485                  // ----------------------------- POSY BY POST ARCHIVES --------------------------------
 486                  $this->count_total_rows();
 487                  $archives_list = new ItemListLight( $Blog , $Blog->get_timestamp_min(), $Blog->get_timestamp_max(), $this->total_rows );
 488                  $archives_list->set_filters( array(
 489                          'visibility_array' => array( 'published' ),  // We only want to advertised published items
 490                          'types' =>  '-'.implode(',',$posttypes_specialtypes),    // Include all types except pages, intros and sidebar links
 491                      ) );
 492  
 493                  if($sort_order == 'title')
 494                  {
 495                      $archives_list->set_filters( array(
 496                      'orderby' => 'title',
 497                      'order' => 'ASC') );
 498                  }
 499  
 500                  $archives_list->query();
 501                  $this->rows = array();
 502                  while ($Item = $archives_list->get_item())
 503                  {
 504                      $this->rows[] = $Item;
 505                  }
 506                  $this->result_num_rows = $archives_list->result_num_rows;
 507                  $this->current_idx = 0;
 508                  $this->arc_w_last = '';
 509                  return;
 510          }
 511  
 512  
 513          // dh> Temp fix for MySQL bug - apparently in/around 4.1.21/5.0.24.
 514          // See http://forums.b2evolution.net/viewtopic.php?p=42529#42529
 515          if( in_array($this->archive_mode, array('monthly', 'daily', 'weekly')) )
 516          {
 517              $sql_version = $DB->get_version();
 518              if( version_compare($sql_version, '4', '>') )
 519              {
 520                  $sql = 'SELECT SQL_CALC_FOUND_ROWS '.substr( $sql, 7 ); // "SQL_CALC_FOUND_ROWS" available since MySQL 4
 521              }
 522          }
 523  
 524          parent::Results( $sql, 'archivelist_', '', $limit );
 525  
 526          $this->restart();
 527      }
 528  
 529  
 530      /**
 531       * Count the number of rows of the SQL result
 532       *
 533       * These queries are complex enough for us not to have to rewrite them:
 534       * dh> ???
 535       */
 536  	function count_total_rows()
 537      {
 538          global $DB;
 539  
 540          switch( $this->archive_mode )
 541          {
 542              case 'monthly':
 543                  // ------------------------------ MONTHLY ARCHIVES ------------------------------------
 544                  $sql_count = 'SELECT COUNT( DISTINCT EXTRACT(YEAR FROM '.$this->dbprefix.'datestart), EXTRACT(MONTH FROM '.$this->dbprefix.'datestart) ) '
 545                                                      .$this->from
 546                                                      .$this->where;
 547                  break;
 548  
 549              case 'daily':
 550                  // ------------------------------- DAILY ARCHIVES -------------------------------------
 551                  $sql_count = 'SELECT COUNT( DISTINCT EXTRACT(YEAR FROM '.$this->dbprefix.'datestart), EXTRACT(MONTH FROM '.$this->dbprefix.'datestart),
 552                                                                      EXTRACT(DAY FROM '.$this->dbprefix.'datestart) ) '
 553                                                      .$this->from
 554                                                      .$this->where;
 555                  break;
 556  
 557              case 'weekly':
 558                  // ------------------------------- WEEKLY ARCHIVES -------------------------------------
 559                  $sql_count = 'SELECT COUNT( DISTINCT EXTRACT(YEAR FROM '.$this->dbprefix.'datestart), '
 560                                                      .$DB->week( $this->dbprefix.'datestart', locale_startofweek() ).' ) '
 561                                                      .$this->from
 562                                                      .$this->where;
 563                  break;
 564  
 565              case 'postbypost':
 566              default:
 567                  // ----------------------------- POSY BY POST ARCHIVES --------------------------------
 568                  $sql_count = 'SELECT COUNT( DISTINCT '.$this->dbIDname.' ) '
 569                                                      .$this->from
 570                                                      .$this->where
 571                                                      .$this->group_by;
 572          }
 573  
 574          // echo $sql_count;
 575  
 576          $this->total_rows = $DB->get_var( $sql_count ); //count total rows
 577  
 578          // echo 'total rows='.$this->total_rows;
 579      }
 580  
 581  
 582      /**
 583       * Rewind resultset
 584       */
 585  	function restart()
 586      {
 587          // Make sure query has executed at least once:
 588          $this->query();
 589  
 590          $this->current_idx = 0;
 591          $this->arc_w_last = '';
 592      }
 593  
 594      /**
 595       * Getting next item in archive list
 596       *
 597       * WARNING: these are *NOT* Item objects!
 598       */
 599  	function get_item( & $arc_year, & $arc_month, & $arc_dayofmonth, & $arc_w, & $arc_count, & $post_ID, & $post_title, & $permalink )
 600      {
 601          // echo 'getting next item<br />';
 602  
 603          if( $this->current_idx >= $this->result_num_rows )
 604          {    // No more entry
 605              return false;
 606          }
 607  
 608          $arc_row = $this->rows[ $this->current_idx++ ];
 609  
 610          switch( $this->archive_mode )
 611          {
 612              case 'monthly':
 613                  $arc_year  = $arc_row->year;
 614                  $arc_month = $arc_row->month;
 615                  $arc_count = $arc_row->count;
 616                  return true;
 617  
 618              case 'daily':
 619                  $arc_year  = $arc_row->year;
 620                  $arc_month = $arc_row->month;
 621                  $arc_dayofmonth = $arc_row->day;
 622                  $arc_count = $arc_row->count;
 623                  return true;
 624  
 625              case 'weekly':
 626                  $arc_year  = $arc_row->year;
 627                  $arc_w = $arc_row->week;
 628                  $arc_count = $arc_row->count;
 629                  return true;
 630  
 631              case 'postbypost':
 632              default:
 633                  $post_ID = $arc_row->ID;
 634                  $post_title = $arc_row->title;
 635                  $permalink = $arc_row->get_permanent_url();
 636                  return true;
 637          }
 638      }
 639  }
 640  
 641  ?>

title

Description

title

Description

title

Description

title

title

Body