b2evolution

Multilingual multiuser multiblog engine

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

Source for file multiblogs.php

Documentation is available at multiblogs.php

  1. <?php
  2. /**
  3.  * This is a demo template displaying multiple blogs on the same page
  4.  *
  5.  * If you're new to b2evolution templates or skins, you should not start with this file
  6.  * It will be easier to start examining blog_a.php or noskin_a.php for instance...
  7.  *
  8.  * @package evoskins
  9.  * @subpackage noskin
  10.  */
  11.  
  12. # First blog will be displayed the regular way (why bother?)
  13. $blog 2;        // 2 is for "demo blog A" or your upgraded blog (depends on your install)
  14.  
  15. # Tell b2evolution you don't want to use evoSkins
  16. # (evoSkins are designed to display only one blog at once + optionnaly a linkblog)
  17. $skin '';
  18.  
  19. # This setting retricts posts to those published, thus hiding drafts.
  20. # You should not have to change this.
  21. $show_statuses array();
  22.  
  23. # Here you can set a limit before which posts will be ignored
  24. # You can use a unix timestamp value or 'now' which will hide all posts in the past
  25. $timestamp_min '';
  26.  
  27. # Here you can set a limit after which posts will be ignored
  28. # You can use a unix timestamp value or 'now' which will hide all posts in the future
  29. $timestamp_max 'now';
  30.  
  31. # Additionnaly, you can set other values (see URL params in the manual)...
  32. # $order = 'ASC'; // This for example would display the blog in chronological order...
  33.  
  34. /**
  35.  * Let b2evolution handle the query string and load the blog data:
  36.  */
  37. require(dirname(__FILE__).'/b2evocore/_blog_main.php');
  38.  
  39. # Now, below you'll find the magic template...
  40. ?>
  41. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  42. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang(?>" lang="<?php locale_lang(?>"><!-- InstanceBegin template="/Templates/Standard.dwt" codeOutsideHTMLIsLocked="false" -->
  43. <head>
  44. <!-- InstanceBeginEditable name="doctitle" -->
  45. <meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset(?>" />
  46.     <title>Multiblog demo<?php
  47.         single_cat_title' - ''htmlhead' );
  48.         single_month_title' - ''htmlhead' );
  49.         single_post_title' - ''htmlhead' );
  50.         arcdir_title' - ''htmlhead' );
  51.         last_comments_title' - ''htmlhead' );
  52.         profile_title' - ''htmlhead' );
  53.     ?></title>
  54. <!-- InstanceEndEditable --> 
  55. <!-- InstanceBeginEditable name="head" -->
  56. <base href="<?php skinbase()// You're not using any skin here but this won't hurt. However it will be very helpfull to have this here when you make the switch to a skin! ?>" />
  57. <meta name="description" content="<?php $Blog->disp'shortdesc''htmlattr' )?>" />
  58. <meta name="keywords" content="<?php $Blog->disp'keywords''htmlattr' )?>" />
  59. <meta name="generator" content="b2evolution <?php echo $b2_version ?>" /> <!-- Please leave this for stats -->
  60. <link rel="alternate" type="text/xml" title="RDF" href="<?php $Blog->disp'rdf_url''raw' ?>" />
  61. <link rel="alternate" type="text/xml" title="RSS .92" href="<?php $Blog->disp'rss_url''raw' ?>" />
  62. <link rel="alternate" type="text/xml" title="RSS 2.0" href="<?php $Blog->disp'rss2_url''raw' ?>" />
  63. <link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp'atom_url''raw' ?>" />
  64. <link rel="pingback" href="<?php $Blog->disp'pingback_url''raw' ?>" />
  65. <!-- InstanceEndEditable --> 
  66. <link rel="stylesheet" href="rsc/fp02.css" type="text/css" />
  67. </head>
  68. <body>
  69. <div class="pageHeader">
  70. <div class="pageHeaderContent">
  71.  
  72. <!-- InstanceBeginEditable name="NavBar2" -->
  73. <?php // --------------------------- BLOG LIST INCLUDED HERE -----------------------------
  74.     # this is what will start and end your blog links
  75.     $blog_list_start '<div class="NavBar">';
  76.     $blog_list_end '</div>';
  77.     # this is what will separate your blog links
  78.     $blog_item_start '';
  79.     $blog_item_end '';
  80.     # This is the class of for the selected blog link:
  81.     $blog_selected_link_class 'NavButton2';
  82.     # This is the class of for the other blog links:
  83.     $blog_other_link_class 'NavButton2';
  84.     # This is additionnal markup before and after the selected blog name
  85.     $blog_selected_name_before '<span class="small">';
  86.     $blog_selected_name_after '</span>';
  87.     # This is additionnal markup before and after the other blog names
  88.     $blog_other_name_before '<span class="small">';
  89.     $blog_other_name_after '</span>';
  90.     // Include the bloglist
  91.     requireget_path('skins').'/_bloglist.php');
  92.     // ---------------------------------- END OF BLOG LIST --------------------------------- ?>
  93. <!-- InstanceEndEditable -->
  94.  
  95. <div class="NavBar">
  96. <div id="Logo">&nbsp;</div>
  97. <div class="pageTitle">
  98. <h1 id="pageTitle"><!-- InstanceBeginEditable name="PageTitle" --><?php echo T_('Multiblog demo'?><!-- InstanceEndEditable --></h1>
  99. </div>
  100. </div>
  101.  
  102. <div class="pageHeaderEnd"></div>
  103.       
  104. </div>
  105. </div>
  106.  
  107.  
  108. <div class="pageSubTitle"><!-- InstanceBeginEditable name="SubTitle" --><?php echo T_('This demo template displays 3 blogs at once (1 on the left, 2 on the right)'?><!-- InstanceEndEditable --></div>
  109.  
  110.  
  111. <div class="main"><!-- InstanceBeginEditable name="Main" -->
  112.  
  113. <!-- =================================== START OF MAIN AREA =================================== -->
  114.  
  115. <div class="bPosts">
  116. <h2>#1: <a href="<?php $Blog->disp'blogurl''raw' ?>"><?php echo $Blog->disp'name''htmlbody' ?></a></h2>
  117. <h2><?php
  118.     single_cat_title();
  119.     arcdir_title();
  120.     profile_title();
  121. ?></h2>
  122.  
  123.  
  124. <?php // ------------------------------------ START OF POSTS ----------------------------------------
  125.     ifisset($MainList) ) $MainList->display_if_empty()// Display message if no post
  126.  
  127.     ifisset($MainList) ) while$Item $MainList->get_item() )
  128.     {
  129.     $MainList->date_if_changed();
  130.     ?>
  131.     <div class="bPost" lang="<?php $Item->lang(?>">
  132.         <?php $Item->anchor()?>
  133.         <div class="bSmallHead">
  134.         <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>
  135.         <?php $Item->issue_time();    echo ', 'T_('Categories')': ';    $Item->categories(?>
  136.         </div>
  137.         <h3 class="bTitle"><?php $Item->title()?></h3>
  138.         <div class="bText">
  139.             <?php $Item->content()?>
  140.             <?php link_pages(?>
  141.         </div>
  142.         <div class="bSmallPrint">
  143.             <?php $Item->feedback_link'comments'''' &bull; ' // Link to comments ?>
  144.             <?php $Item->feedback_link'trackbacks'''' &bull; ' // Link to trackbacks ?>
  145.             <?php $Item->feedback_link'pingbacks'''' &bull; ' // Link to trackbacks ?>
  146.  
  147.             <?php $Item->trackback_rdf(// trackback autodiscovery information ?>
  148.  
  149.             <a href="<?php $Item->permalink(?>" title="Permanent link to full entry"><?php echo T_('Permalink'?></a>
  150.         </div>
  151.         <?php // ---------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ----------------
  152.         $disp_comments 1;                    // Display the comments if requested
  153.         $disp_comment_form 1;            // Display the comments form if comments requested
  154.         $disp_trackbacks 1;                // Display the trackbacks if requested
  155.  
  156.         $disp_trackback_url 1;        // Display the trackbal URL if trackbacks requested
  157.         $disp_pingbacks 1;                // Display the pingbacks if requested
  158.         requireget_path('skins').'/_feedback.php');
  159.         // ------------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ------------------- ?>
  160.     </div>
  161. <?php // ---------------------------------- END OF POSTS ------------------------------------ ?>
  162.  
  163.     <p class="center"><strong><?php posts_nav_link()?></strong></p>
  164.  
  165. <?php // ---------------- START OF INCLUDES FOR LAST COMMENTS, STATS ETC. ----------------
  166.     switch$disp )
  167.     {
  168.         case 'comments':
  169.             // this includes the last comments if requested:
  170.             requireget_path('skins').'/_lastcomments.php' );
  171.             break;
  172.  
  173.         case 'arcdir':
  174.             // this includes the archive directory if requested
  175.             requireget_path('skins').'/_arcdir.php');
  176.             break;
  177.  
  178.         case 'profile':
  179.             // this includes the profile form if requested
  180.             requireget_path('skins').'/_profile.php');
  181.             break;
  182.     }
  183. // ------------------- END OF INCLUDES FOR LAST COMMENTS, STATS ETC. ------------------- ?>
  184. </div>
  185.  
  186. <!-- =================================== START OF SIDEBAR =================================== -->
  187.  
  188. <div class="bSideBar">
  189.  
  190.     <!-- =================================== START OF BLOG B =================================== -->
  191.  
  192.     <div class="bSideItem">
  193.     <?php
  194.         // Dirty trick until we get everything into objects:
  195.         $saved_blog $blog;
  196.         $blog 3;    // Blog B now
  197.         $Blog_B Blog_get_by_ID);    // Blog B
  198.     ?>
  199.         <h3>#2: <a href="<?php $Blog_B->disp'blogurl''raw' ?>"><?php echo $Blog_B->disp'name''htmlbody' ?></a></h3>
  200.     <?php
  201.         // You can restrict to specific categories by listing them in the two params below: '', array()
  202.         // '', array(9,15) will restrict to cats 9 and 15
  203.         // '9,15', array() will restrict to cats 9,15 and all their subcats
  204.         $BlogBList new ItemList$blog,     $show_statuses''$m$w''array()$author$order$orderby$posts'''''''''''''''3''posts'$timestamp_min$timestamp_max );
  205.  
  206.         while$Item $BlogBList->get_item() )
  207.         {
  208.         ?>
  209.         <div class="bPostSide" lang="<?php $Item->lang(?>">
  210.             <?php $Item->anchor()?>
  211.  
  212.             <h3 class="bTitle"><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><?php $Item->title()?></h3>
  213.             <div class="bText">
  214.                 <?php $Item->content1false )?>
  215.                 <?php link_pages(?>
  216.             </div>
  217.         </div>
  218.         <?php
  219.         }
  220.  
  221.         // Restore after dirty trick:
  222.         $blog $saved_blog;
  223.     ?>
  224.     </div>
  225.  
  226.     <!-- =================================== START OF BLOG C =================================== -->
  227.  
  228.     <div class="bSideItem">
  229.     <?php
  230.         // Dirty trick until we get everything into objects:
  231.         $saved_blog $blog;
  232.         $blog 4;        // Linkblog now
  233.         $Blog_roll Blog_get_by_ID)// Blog roll
  234.     ?>
  235.         <h3>#3: <a href="<?php $Blog_roll->disp'blogurl''raw' ?>"><?php echo $Blog_roll->disp'name''htmlbody' ?></a></h3>
  236.     <?php
  237.         // You can restrict to specific categories by listing them in the two params below: '', array()
  238.         // '', array(9,15) will restrict to cats 9 and 15
  239.         // '9,15', array() will restrict to cats 9,15 and all their subcats
  240.         $LinkblogList new ItemList$blog,    $show_statuses''$m$w''array()$author$order$orderby$posts'''''''''''''''3''posts'$timestamp_min$timestamp_max );
  241.  
  242.         while$Item $LinkblogList->get_item() )
  243.         {
  244. ?>
  245.         <div class="bPostSide" lang="<?php $Item->lang(?>">
  246.             <?php $Item->anchor()?>
  247.  
  248.             <h3 class="bTitle"><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><?php $Item->title()?></h3>
  249.             <div class="bText">
  250.                 <?php $Item->content1false )?>
  251.                 <?php link_pages(?>
  252.             </div>
  253.         </div>
  254.         <?php
  255.         }
  256.  
  257.         // Restore after dirty trick:
  258.         $blog $saved_blog;
  259.     ?>
  260.     </div>
  261.  
  262.     <!-- =================================== END OF BLOG C =================================== -->
  263.  
  264.  
  265.     <div class="bSideItem">
  266.         <h3><?php echo T_('Misc'?></h3>
  267.         <ul>
  268.             <?php
  269.                 // Administrative links:
  270.                 user_login_link'<li>''</li>' );
  271.                 user_register_link'<li>''</li>' );
  272.                 user_admin_link'<li>''</li>' );
  273.                 user_profile_link'<li>''</li>' );
  274.                 user_logout_link'<li>''</li>' );
  275.             ?>
  276.         </ul>
  277.     </div>
  278.  
  279.     <p class="center">powered by<br />
  280.     <a href="http://b2evolution.net/" title="b2evolution home"><img src="<?php echo $img_url ?>/b2evolution_button.png" alt="b2evolution" width="80" height="15" border="0" class="middle" /></a></p>
  281.  
  282. </div>
  283. <!-- InstanceEndEditable --></div>
  284. <table cellspacing="3" class="wide">
  285.   <tr> 
  286.   <td class="cartouche">Original page design by <a href="http://fplanque.net/">Fran&ccedil;ois PLANQUE</a> </td>
  287.     
  288.     <td class="cartouche" align="right"> <a href="http://b2evolution.net/" title="b2evolution home"><img src="img/b2evolution_button.png" alt="b2evolution" width="80" height="15" border="0" class="middle" /></a></td>
  289.   </tr>
  290. </table>
  291. <p class="baseline">
  292.  
  293.     <a href="http://validator.w3.org/check/referer"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" class="middle" /></a> 
  294.   
  295.     <a href="http://jigsaw.w3.org/css-validator/"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" class="middle" /></a>
  296.     
  297.     <?php ifisset($Blog) ) 
  298.     ?>
  299.     
  300.     <a href="http://feedvalidator.org/check.cgi?url=<?php $Blog->disp'rss2_url''raw' ?>"><img src="img/valid-rss.png" alt="Valid RSS!" style="border:0;width:88px;height:31px" class="middle" /></a>
  301.  
  302.     <a href="http://feedvalidator.org/check.cgi?url=<?php $Blog->disp'atom_url''raw' ?>"><img src="img/valid-atom.png" alt="Valid Atom!" style="border:0;width:88px;height:31px" class="middle" /></a>
  303.     
  304.     <?php ?>
  305.     
  306.     &nbsp;<!-- InstanceBeginEditable name="Baseline" -->
  307. <?php
  308.     log_hit();    // log the hit on this page
  309.     debug_info()// output debug info if requested
  310. ?>
  311. <!-- InstanceEndEditable --></p>
  312. </body>
  313. <!-- InstanceEnd --></html>

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