nats_display_news
Displays a list of affiliate news items. The list may be restricted and formatted using the parameters described below.
Alias: display_news
Parameters
(Required parameters in bold)
Templates used to display output. Not used if either parameter, headlines or newsid, is also used
Any valid template name
The template, function_display_news
tpl="mytemplate"
headlines
Displays output in the template, function_display_news_headlines. Not used if the parameter, newsid is also used
0 or 1 (exclusive)
0. Will use the template, function_display_news
headlines="1"
newsid
Displays a single news item using the template, function_display_news_full
Any valid news ID number
None. Display more than one news item
newsid="123"
time
Only shows news items published before this time
Any text the PHP function strtotime() can parse
The current time. Will not show news items with a future publication date.
time="1 August 2008"
count
How many items to show on each page
Zero or any integer greater than zero
5; shows five news items on each page
count="10"
start
How many previous news items to ignore
Zero or any integer greater than zero
0; ignores no news items -- starts with the first news item
start="10"
order
What order to display the news in
Any valid order
?
?
section
Limit output to news from one or more categories (sections)
Any valid section or comma-separated list of sections
None. Shows news from all sections
section="mysection,yoursection"
Prefix output variables with this word. (Click link for details)
Any valid Smarty variable name
None. (No prefix is used)
assign_prefix="myvar"
Output
A list of news items or, if the newsid parameter is set, a single complete news item.
news
Array of all the news items pulled from the function
news_count
Total count of news items
Notes
You cannot use a custom template if the parameter newsid is also used.
See Also
strtotime() -- PHP.net documentation on strtotime.
Last updated
Was this helpful?