b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: evoskins ] [ index: evoskins ] [ all elements ]

Source for file _linkblog.php

Documentation is available at _linkblog.php

  1. <?php
  2.     /**
  3.      * This is the template that displays the linkblog
  4.      *
  5.      * This file is not meant to be called directly.
  6.      * It is meant to be called by an include in the _main.php template.
  7.      *
  8.      * b2evolution - {@link http://b2evolution.net/}
  9.      * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  10.      * @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
  11.      *
  12.      * @package evoskins
  13.      */
  14.     if!defined('DB_USER') ) die'Please, do not access this page directly.' );
  15.     
  16.     if!isset$linkblog ) )
  17.     {    // No link blog explicitely specified, we use default:
  18.         $linkblog $Blog->get('links_blog_ID');
  19.     }
  20.     
  21.     if$linkblog )
  22.     {    // No linkblog blog requested for this blog
  23.         return;
  24.     }
  25.  
  26.  
  27.     # maximum number of linkblog entries to display:
  28.     if(!isset($linkblog_limit)) $linkblog_limit 20;
  29.     # global linkblog delimiters:
  30.     if(!isset($linkblog_main_start)) $linkblog_main_start '<div class="bSideItem"><h3>'.
  31.                                                                                                                         T_('Linkblog').'</h3>';
  32.     if(!isset($linkblog_main_end)) $linkblog_main_end '</div>';
  33.     # Category delimiters:
  34.     if(!isset($linkblog_catname_before)) $linkblog_catname_before '<h4>';
  35.     if(!isset($linkblog_catname_after)) $linkblog_catname_after '</h4><ul>';
  36.     if(!isset($linkblog_catlist_end)) $linkblog_catlist_end '</ul>';
  37.     # Item delimiters:
  38.     if(!isset($linkblog_item_before)) $linkblog_item_before '<li>';
  39.     if(!isset($linkblog_item_after)) $linkblog_item_after '</li>';
  40.     
  41.     
  42.     // --- //
  43.     
  44.     
  45.     // Load the linkblog blog:
  46.     $LinkblogList new ItemList$linkblogarray()''''''$linkblog_cat$linkblog_catsel'''ASC''category title'''''''''''''''''$linkblog_limit'posts'$timestamp_min$timestamp_max );
  47.     
  48.     
  49.     // Dirty trick until we get everything into objects:
  50.     $saved_blog $blog;  
  51.     $blog $linkblog;
  52.     
  53.     // Open the global list
  54.     echo $linkblog_main_start;
  55.         
  56.     $previous_cat '';
  57.     $linkblog_cat '';
  58.     
  59.     while$Item $LinkblogList->get_category_group() )
  60.     {
  61.         // Open new cat:
  62.         echo $linkblog_catname_before;
  63.         $Item->main_category();
  64.         echo $linkblog_catname_after;
  65.         
  66.         while$Item $LinkblogList->get_item() )
  67.         {
  68.             echo $linkblog_item_before;
  69.             $Item->title()
  70.             echo ' ';
  71.             $Item->content10T_('more')'['']' );    // Description + more link 
  72.             ?>
  73.             <a href="<?php $Item->permalink(?>" title="<?php echo T_('Permanent link to full entry'?>"><img src="img/icon_minipost.gif" alt="<?php echo T_('Permalink'?>" width="12" height="9" class="middle" /></a>
  74.             <?php
  75.             echo $linkblog_item_after;
  76.         }
  77.     
  78.         // Close cat
  79.         echo $linkblog_catlist_end;
  80.     }
  81.     // Close the global list
  82.     echo $linkblog_main_end;
  83.     
  84.     // Restore after dirty trick:
  85.     $blog $saved_blog;        
  86. ?>

Documentation generated on Tue, 20 May 2008 01:55:22 +0200 by phpDocumentor 1.4.2