Procedural File: _template.funcs.php
Source Location: /blogs/inc/_core/_template.funcs.php
Functions
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 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 362]
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 |
void credits(
[ $params = array()]
)
|
|
Template tag
Parameters:
display_if_empty [line 603]
boolean display_if_empty(
[ $params = array()]
)
|
|
Stub
Parameters:
API Tags:
| Return: | true if empty MainList |
header_nocache [line 144]
Sends HTTP headers to avoid caching of the page.
header_redirect [line 52]
void header_redirect(
[string $redirect_to = NULL], [boolean $permanent = 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: |
URL to redirect to (overrides detection) |
|
boolean |
$permanent: |
is this a permanent redirect? if true, send a 301; otherwise a 303 |
Information Tags:
| Todo: | fp> do NOT allow $redirect_to = NULL. This leads to spaghetti code and unpredictable behavior. |
include_headlines [line 504]
string include_headlines(
)
|
|
Outputs the collected HTML HEAD lines.
API Tags:
item_prevnext_links [line 541]
void item_prevnext_links(
[ $params = array()]
)
|
|
Stub: Links to previous and next post in single post mode
Parameters:
mainlist_get_item [line 582]
Item &mainlist_get_item(
)
|
|
Stub
mainlist_page_links [line 566]
void mainlist_page_links(
[ $params = array()]
)
|
|
Stub: Links to list pages:
Parameters:
void messages(
[ $params = array()]
)
|
|
Stub
Parameters:
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:
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 $relative_to_base = FALSE], [string $title = NULL], [string $media = NULL]
)
|
|
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/js) for javascript file |
|
boolean |
$relative_to_base: |
relative_to_base. False (default) if the file is in the rsc/css folder. True to make it relative |
|
string |
$title: |
title. The title for the link tag |
|
string |
$media: |
media. ie, 'print' |
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: |
relative_to_base. False (default) if the file is in the rsc/js folder. True to make it relative |
Robots tag
Outputs the robots meta tag if necessary