ItemListLight ItemListLight(
Blog
&$Blog, [mixed
$timestamp_min = NULL], [mixed
$timestamp_max = NULL], [integer|NULL
$limit = 20], [string
$cache_name = 'ItemCacheLight'], [string
$param_prefix = ''], [array
$filterset_name = '']
)
|
|
Constructor
Parameters:
|
Blog |
&$Blog: |
|
|
mixed |
$timestamp_min: |
Default filter set: Do not show posts before this timestamp, can be 'now' |
|
mixed |
$timestamp_max: |
Default filter set: Do not show posts after this timestamp, can be 'now' |
|
integer|NULL |
$limit: |
Limit |
|
string |
$cache_name: |
name of cache to be used (for table prefix info) |
|
string |
$param_prefix: |
prefix to differentiate page/order params when multiple Results appear one same page |
|
array |
$filterset_name: |
restrictions for itemlist (position, contact, firm, ...) key: restriction name, value: ID of the restriction |
Information Tags:
| Todo: | add param for saved session filter set |
void activate_preset_filters(
)
|
|
Activate preset default filters if necessary
void dates_to_end(
[string
$before_empty_day = '<h2>'], [string
$after_empty_day = '</h2>'], [string
$format = '']
)
|
|
Template function: display potentially remaining empty days until the end of the filter interval
Parameters:
|
string |
$before_empty_day: |
string to display before the date (if changed) |
|
string |
$after_empty_day: |
string to display after the date (if changed) |
|
string |
$format: |
date/time format: leave empty to use locale default time format |
void date_if_changed(
[array
$params = array()]
)
|
|
Template tag: Display the date if it has changed since last call
Optionally also displays empty dates in between.
Parameters:
void get_advertised_start_date(
)
|
|
Get the adverstised start date (does not include timestamp_min)
Note: there is a priority order in the params to determine the start date: -dstart -week + m -m -dstop - x days
API Tags:
void get_advertised_stop_date(
)
|
|
Get the adverstised stop date (does not include timestamp_max)
Note: there is a priority order in the params to determine the stop date. -dstop -week + m -m -dstart + x days
void &get_category_group(
)
|
|
If the list is sorted by category...
Note: this only supports one level of categories (nested cats will be flatened)
array get_filter_titles(
[
$ignore = array()], [
$params = array()]
)
|
|
Generate a title for the current list, depending on its filtering params
Parameters:
API Tags:
| Return: | List of titles to display, which are escaped for HTML display (dh> only checked this for 'authors'/?authors=, where the output was not escaped) |
Information Tags:
| Todo: | cleanup some displays |
| Todo: | implement HMS part of YMDHMS |
If the list is sorted by category...
This is basically just a stub for backward compatibility
Redefined in descendants as:
string get_lastpostdate(
[string
$dateformat = 'Y-m-d H:i:s']
)
|
|
Get datetime of the last post/item
Parameters:
API Tags:
| Return: | 'Y-m-d H:i:s' formatted; If there are no items this will be $localtimenow. |
Information Tags:
| Todo: | dh> Optimize this, if this can be said after having done query() already. |
| Todo: | dh> Cache result |
void get_total_num_posts(
)
|
|
Return total number of posts
This is basically just a stub for backward compatibility
API Tags:
boolean load_from_Request(
[boolean
$use_filters = true]
)
|
|
Init filter params from Request params
Parameters:
|
boolean |
$use_filters: |
do we want to use saved filters ? |
API Tags:
| Return: | true if we could apply a filterset based on Request params (either explicit or reloaded) |
void page_links(
[
$params = array()]
)
|
|
Template tag
Parameters:
Run Query: GET DATA ROWS *** LIGHT ***
Contrary to ItemList2, we only do 1 query here and we extract only a few selected params. Basically all we want is being able to generate permalinks.
Redefinition of:
- Results::query()
- Run the query now!
Redefined in descendants as:
Reset the query -- EXPERIMENTAL
Useful to requery with a slighlty moidified filterset
Redefinition of:
- Results::reset()
- Reset the query -- EXPERIMENTAL
boolean restore_filterset(
)
|
|
Load previously saved filterset from session.
API Tags:
| Return: | true if we could restore something |
Save current filterset to session.
void set_default_filters(
array
$default_filters, [array
$preset_filters = array()]
)
|
|
Set default filter values we always want to use if not individually specified otherwise:
Parameters:
|
array |
$default_filters: |
default filters to be merged with the class defaults |
|
array |
$preset_filters: |
default filters for each preset, to be merged with general default filters if the preset is used |
void set_filters(
array
$filters, [boolean
$memorize = true]
)
|
|
Set/Activate filterset
This will also set back the GLOBALS !!! needed for regenerate_url().
Parameters:
|
array |
$filters: |
|
|
boolean |
$memorize: |
|
Make sure date displaying starts at the beginning of the current filter interval
Note: we're talking about strict dates (no times involved)