b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Procedural File: _template.funcs.php

Source Location: /blogs/inc/_core/_template.funcs.php

Page Details

This file implements misc functions that handle output of the HTML page.

This file is part of the evoCore framework - http://evocore.net/ See also http://sourceforge.net/projects/evocms/.

Author:  fplanque: Francois PLANQUE.
Author:  blueyed: Daniel HAHLER.
Version:  $Id: _template.funcs.php,v 1.72 2010/02/08 17:51:34 efy-yury Exp $
Copyright:  

(c)2003-2010 by Francois PLANQUE - http://fplanque.net/ Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - http://thequod.de/contact.

Filesource:  Source Code for this file
Functions
addup_percentage  [line 1097]

void addup_percentage( $hit_count, $hit_total, [ $decimals = 1], [ $dec_point = '.']  )
Parameters:
   $hit_count: 
   $hit_total: 
   $decimals: 
   $dec_point: 


[ Top ]
add_css_headline  [line 746]

void add_css_headline( string $headline  )

Add a CSS headline.

This is an extra function, to provide consistent wrapping and allow to bundle it (i.e. create a bundle with all required JS files and these inline code snippets, in the correct order).

Parameters:
string   $headline:  CSS


[ Top ]
add_headline  [line 718]

void add_headline( string $headline  )

Add a headline, which then gets output in the HTML HEAD section.

If you want to include CSS or JavaScript files, please use require_css() and require_js() instead. This avoids duplicates and allows caching/concatenating those files later (not implemented yet)

Parameters:
string   $headline: 


[ Top ]
add_js_for_toolbar  [line 758]

void add_js_for_toolbar( )

Registers all the javascripts needed by the toolbar menu


Information Tags:
Todo:  fp> include basic.css ? -- rename to add_headlines_for* -- potential problem with inclusion order of CSS files!! dh> would be nice to have the batch of CSS in a separate file. basic.css would get included first always, then e.g. this toolbar.css.

[ Top ]
add_js_headline  [line 732]

void add_js_headline( string $headline  )

Add a Javascript headline.

This is an extra function, to provide consistent wrapping and allow to bundle it (i.e. create a bundle with all required JS files and these inline code snippets, in the correct order).

Parameters:
string   $headline:  Javascript


[ Top ]
add_js_translation  [line 700]

void add_js_translation( string $string, string $translation  )

Memorize that a specific translation will be required by the current page.

All requested translations will be included in the page body only once (when footerlines is called)

Parameters:
string   $string:  string, untranslated string
string   $translation:  translation, translated string


[ Top ]
app_version  [line 836]

void app_version( )

Template tag.



[ Top ]
base_tag  [line 443]

string base_tag( string $url, [ $target = NULL]  )

Returns a "<base />" tag and remembers that we've used it (regenerate_url() needs this).

Parameters:
string   $url:  URL to use (this gets used as base URL for all relative links on the HTML page)
   $target: 


[ Top ]
bloginfo  [line 1061]

void bloginfo( $what  )

DEPRECATED

Parameters:
   $what: 


[ Top ]
blog_home_link  [line 497]

void blog_home_link( [ $before = ''], [ $after = ''], [ $blog_text = 'Blog'], [ $home_text = 'Home']  )

Output a link to current blog.

We need this function because if no Blog is currently active (some admin pages or site pages) then we'll go to the general home.

Parameters:
   $before: 
   $after: 
   $blog_text: 
   $home_text: 


[ Top ]
bullet  [line 848]

void bullet( boolean $bool  )

Displays an empty or a full bullet based on boolean

Parameters:
boolean   $bool:  true for full bullet, false for empty bullet


[ Top ]
comment_allowed_tags  [line 1073]

void comment_allowed_tags( [string $format = 'htmlbody']  )

Display allowed tags for comments (Mainly provided for WP compatibility. Not recommended for use)

Parameters:
string   $format:  format


[ Top ]
credits  [line 955]

void credits( [array $params = array()]  )

Template tag for credits

Note: You can limit (and even disable) the number of links being displayed here though the Admin interface: Blog Settings > Advanced > Software credits

Parameters:
array   $params: 


[ Top ]
display_if_empty  [line 934]

boolean display_if_empty( [ $params = array()]  )

Stub

Parameters:
   $params: 

API Tags:
Return:  true if empty MainList


[ Top ]
headers_content_mightcache  [line 69]

void headers_content_mightcache( [string $type = 'text/html'], [integer $max_age = '#'], [ $charset = '#']  )

This is a placeholder for future development.

Parameters:
string   $type:  content-type; override for RSS feeds
integer   $max_age:  seconds
   $charset: 


[ Top ]
header_content_type  [line 42]

void header_content_type( [string $type = 'text/html'], [ $charset = '#']  )

Template tag. Output content-type header

Parameters:
string   $type:  content-type; override for RSS feeds
   $charset: 


[ Top ]
header_nocache  [line 228]

void header_nocache( [ $timestamp = NULL]  )

Sends HTTP headers to avoid caching of the page.

Parameters:
   $timestamp: 

API Tags:
See:  http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html


[ Top ]
header_noexpire  [line 250]

void header_noexpire( )

This is to "force" (strongly suggest) caching.

WARNING: use this only for STATIC content that does NOT depend on the current user.


API Tags:
See:  http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html


[ Top ]
header_redirect  [line 110]

void header_redirect( [string $redirect_to = NULL], [boolean|integer $status = false]  )

Sends HTTP header to redirect to the previous location (which can be given as function parameter, GET parameter (redirect_to), is taken from Hit::$referer or $baseurl).

$Debuglog and $Messages get stored in $Session, so they are available after the redirect.

NOTE: This function exit() the php script execution.

Parameters:
string   $redirect_to:  Destination URL to redirect to
boolean|integer   $status:  is this a permanent redirect? if true, send a 301; otherwise a 303 OR response code 301,302,303

Information Tags:
Todo:  fp> do NOT allow $redirect_to = NULL. This leads to spaghetti code and unpredictable behavior.

[ Top ]
include_footerlines  [line 808]

void include_footerlines( )

Outputs the collected translation lines before </body>

yabs > Should this be expanded to similar functionality to headlines?


API Tags:
See:  add_js_translation()


[ Top ]
include_headlines  [line 789]

string include_headlines( )

Outputs the collected HTML HEAD lines.


API Tags:
See:  add_headline()


[ Top ]
item_prevnext_links  [line 862]

void item_prevnext_links( [ $params = array()]  )

Stub: Links to previous and next post in single post mode

Parameters:
   $params: 


[ Top ]
link_pages  [line 1083]

void link_pages( )

DEPRECATED



[ Top ]
mainlist_get_item  [line 905]

Item &mainlist_get_item( )

Stub

Sets $Item ion global scope



[ Top ]
mainlist_page_links  [line 887]

void mainlist_page_links( [ $params = array()]  )

Stub: Links to list pages:

Parameters:
   $params: 


[ Top ]
messages  [line 876]

void messages( [ $params = array()]  )

Stub

Parameters:
   $params: 


[ Top ]
percentage  [line 1092]

void percentage( $hit_count, $hit_total, [ $decimals = 1], [ $dec_point = '.']  )

Return a formatted percentage (should probably go to _misc.funcs)

Parameters:
   $hit_count: 
   $hit_total: 
   $decimals: 
   $dec_point: 


[ Top ]
powered_by  [line 1017]

void powered_by( [ $params = array()]  )

Display "powered by b2evolution" logo

Parameters:
   $params: 


[ Top ]
request_title  [line 274]

void request_title( [array $params = array()]  )

Display a global title matching filter params

Outputs the title of the category when you load the page with

  1. ?cat=
Display "Archive Directory" title if it has been requested Display "Latest comments" title if these have been requested Display "Statistics" title if these have been requested Display "User profile" title if it has been requested

Parameters:
array   $params:  params
  • "auto_pilot": "seo_title": Use the SEO title autopilot. (Default: "none")

Information Tags:
Todo:  single month: Respect locales datefmt
Todo:  single post: posts do no get proper checking (wether they are in the requested blog or wether their permissions match user rights, thus the title sometimes gets displayed even when it should not. We need to pre-query the ItemList instead!!
Todo:  make it complete with all possible params!

[ Top ]
require_css  [line 595]

void require_css( string $css_file, [boolean|string $relative_to_base = false], [string $title = NULL], [string $media = NULL], [ $version = '#']  )

Memorize that a specific css that file will be required by the current page.

All requested files will be included in the page head only once (when headlines is called)

Accepts absolute urls, filenames relative to the rsc/css directory. Set $relative_to_base to TRUE to prevent this function from adding on the rsc_path

Parameters:
string   $css_file:  alias, url or filename (relative to rsc/css) for CSS file
boolean|string   $relative_to_base:  Is the file's path relative to the base path/url? Use true to not add any prefix ("$rsc_url/css/").
string   $title:  title. The title for the link tag
string   $media:  media. ie, 'print'
   $version: 

Information Tags:
Todo:  dh>merge with require_js()

[ Top ]
require_js  [line 525]

void require_js( string $js_file, [boolean $relative_to_base = false]  )

Memorize that a specific javascript file will be required by the current page.

All requested files will be included in the page head only once (when headlines is called)

Accepts absolute urls, filenames relative to the rsc/js directory and certain aliases, like 'jquery' and 'jquery_debug' If 'jquery' is used and $debug is set to true, the 'jquery_debug' is automatically swapped in. Any javascript added to the page is also added to the $required_js array, which is then checked to prevent adding the same code twice

Parameters:
string   $js_file:  alias, url or filename (relative to rsc/js) for javascript file
boolean   $relative_to_base:  Is the file's path relative to the base path/url? Use false if file is in $rsc_url/js/

Information Tags:
Todo:  dh>merge with require_css()

[ Top ]
require_js_helper  [line 650]

void require_js_helper( [string $helper = '']  )

Memorize that a specific js helper will be required by the current page.

All requested helpers will be included in the page head only once (when headlines is called) All requested helpers will add their required translation strings and any other settings

Parameters:
string   $helper:  helper, name of the required helper


[ Top ]
robots_tag  [line 462]

void robots_tag( )

Robots tag

Outputs the robots meta tag if necessary



[ Top ]
star_rating  [line 989]

void star_rating( $stars, [ $class = 'middle']  )

Display rating as 5 stars

Parameters:
   $stars: 
   $class: 


[ Top ]


Documentation generated on Sat, 06 Mar 2010 04:24:38 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).