b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. b2evolution Files
  4. summary.php

summary.php

`summary.php` is an example of how to display the latest 3 posts from every blog on a single summary page. Summary.php is especially interesting for people with multiple (more than 2) blogs or for use as an overview page for a group.

`summary.php` is no longer distributed with b2evolution v6+ but you can download it from this page. Just change the extension from `.txt` to `.php` and place the file in your b2evolution base folder.

If you want the capabilities of `summary.php` customized to your own site, you can insert the PHP code into your own layout.

What is the code you need in that page?

PHP

 <?php
 /**
 * Check this: we are requiring _main.inc.php INSTEAD of _blog_main.inc.php because we are not
 * trying to initialize any particular blog
 */
 require(dirname(__FILE__).'/evocore/_main.inc.php');
 ?>

and on the place where you want the summary of the posts :

PHP

 <?php 
  for( $blog=blog_list_start('stub'); $blog!=false; $blog=blog_list_next('stub') )
  { # by uncommenting the following lines you can hide some blogs
        // if( $blog == 1 ) continue; // Hide blog 1...
        // if( $blog == 2 ) continue; // Hide blog 2...
        // if( $blog == 3 ) continue; // Hide blog 3...
        // if( $blog == 4 ) continue; // Hide blog 4...
  ?>

  <h3><a href="<?php blog_list_iteminfo('blogurl', 'raw' ) ?>" title="<?php blog_list_iteminfo  ( 'shortdesc', 'htmlattr'); ?>"><?php blog_list_iteminfo( 'name', 'htmlbody'); ?></a></h3>
	<ul>
 	 <?php	// Get the 3 last posts for each blog:
	$BlogBList = & new ItemList( $blog,  '', '', '', '', '', array(), '', 'DESC', '', 3, '', '', '', '', '', '', '', 'posts' );
	 while( $Item = $BlogBList->get_item() )
	 { ?>
	   <li>	   
	   <a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>(<?php $Item->issue_date() ?>)
	   </li>
	 <?php } ?>
	   <li><a href="<?php blog_list_iteminfo('blogurl', 'raw' ) ?>"><?php echo T_('More posts...') ?></a></li>
	</ul>
 <?php
  }  ?>

Attachments:

  • summary.txt (6.5 KB)
Created by fatimahnasra • Last edit by fplanque on 2020-06-09 00:24 • •

No feedback yet

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
    • Email Skins/Themes
    • b2evolution Files
      • Codebase Overview
      • .htaccess File
      • a_noskin.php
      • multiblogs.php
      • summary.php
      • Publish an XML Site Map
      • contact.php
      • Using Grunt
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Open Source CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque