Procedural File: _template.funcs.php
Source Location: /blogs/inc/_core/_template.funcs.php
Functions
addup_percentage [line 1097]
void addup_percentage(
$hit_count, $hit_total, [ $decimals = 1], [ $dec_point = '.']
)
|
|
Parameters:
|
|
$hit_count: |
|
|
|
$hit_total: |
|
|
|
$decimals: |
|
|
|
$dec_point: |
|
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:
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:
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. |
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 |
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 |
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: |
|
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: |
|
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 |
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:
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:
display_if_empty [line 934]
boolean display_if_empty(
[ $params = array()]
)
|
|
Stub
Parameters:
API Tags:
| Return: | true if empty MainList |
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: |
|
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: |
|
header_nocache [line 228]
void header_nocache(
[ $timestamp = NULL]
)
|
|
Sends HTTP headers to avoid caching of the page.
Parameters:
API Tags:
header_noexpire [line 250]
This is to "force" (strongly suggest) caching.
WARNING: use this only for STATIC content that does NOT depend on the current user.
API Tags:
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. |
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:
include_headlines [line 789]
string include_headlines(
)
|
|
Outputs the collected HTML HEAD lines.
API Tags:
item_prevnext_links [line 862]
void item_prevnext_links(
[ $params = array()]
)
|
|
Stub: Links to previous and next post in single post mode
Parameters:
mainlist_get_item [line 905]
Item &mainlist_get_item(
)
|
|
Stub
Sets $Item ion global scope
mainlist_page_links [line 887]
void mainlist_page_links(
[ $params = array()]
)
|
|
Stub: Links to list pages:
Parameters:
void messages(
[ $params = array()]
)
|
|
Stub
Parameters:
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: |
|
void powered_by(
[ $params = array()]
)
|
|
Display "powered by b2evolution" logo
Parameters:
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
?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! |
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() |
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() |
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 |
Robots tag
Outputs the robots meta tag if necessary
void star_rating(
$stars, [ $class = 'middle']
)
|
|
Display rating as 5 stars
Parameters: