Source for file _functions_template.php
Documentation is available at _functions_template.php
* Misc Functions to be called from the template
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
* @author This file built upon code from original b2 - http://cafelog.com/
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
require_once( dirname(__FILE__
).
'/_functions_cats.php' );
require_once( dirname(__FILE__
).
'/_functions_blogs.php' );
require_once( dirname(__FILE__
).
'/_functions_bposts.php' );
require_once( dirname(__FILE__
).
'/_functions_comments.php' );
require_once( dirname(__FILE__
).
'/_functions_trackback.php' );
require_once( dirname(__FILE__
).
'/_functions_pingback.php' );
* Template function: output base URL to b2evo's image folder
* {@internal imgbase(-)}}
* fplanque: 0.8.3: changed defaults
* @todo Respect locales datefmt
* @param string prefix to display, default is 'Archives for: '
* @param string format to output, default 'htmlbody'
* @param boolean show the year as link to year's archive (in monthly mode)
function single_month_title( $prefix =
'#', $display =
'htmlbody', $linktoyeararchive =
true, $blogurl =
'', $params =
'' )
if( $prefix ==
'#' ) $prefix =
' '.
T_('Archives for').
': ';
if( !empty($m) &&
$display )
if( $display ==
'htmlbody' &&
!empty( $my_month ) &&
$linktoyeararchive )
{ // display year as link to year's archive
$my_year =
'<a href="' .
archive_link( $my_year, '', '', '', false, $blogurl, $params ) .
'">' .
$my_year .
'</a>';
$title =
$prefix.
$my_month.
' '.
$my_year;
{ // We also want to display a day
if( !empty($w) &&
($w>=
0) ) // Note: week # can be 0
{ // We also want to display a week number
* Display "Archive Directory" title if it has been requested
* {@internal arcdir_title(-) }}
* @param string Prefix to be displayed if something is going to be displayed
* @param mixed Output format, see {@link format_to_output()} or false to
* return value instead of displaying it
function arcdir_title( $prefix =
' ', $display =
'htmlbody' )
$info =
$prefix.
T_('Archive Directory');
* Create a link to archive
* {@internal archive_link(-)}}
* @param boolean show or return
* @param string link, instead of blogurl
* @param string GET params for 'file'
function archive_link( $year, $month, $day =
'', $week =
'', $show =
true, $file =
'', $params =
'' )
if( (! $Settings->get('links_extrapath')) ||
(!empty($params)) )
{ // We reference by Query: Dirty but explicit permalinks
$link .=
$separator.
zeroise($month,2);
$link .=
$separator.
zeroise($day,2);
elseif( $week !==
'' ) // Note: week # can be 0 !
if( ! $Settings->get('links_extrapath') )
{ // We reference by Query: Dirty but explicit permalinks