==================================================================
Snippet-title: random_entry v3.0
Creator: Graham Keellings
E-mail: pivot@keellings.com
Website: http://www.keellings.com/software/pivot.php
Creation date: 13 June 2005, Kouvola, Finland
==================================================================
Content of zipped file:
-----------------------
snippet_random_entry.php
readme_random_entry.txt (this file)
IMPORTANT
---------
This snippet requires at least Pivot 1.3 to work correctly. On previous versions the last 3 parameters will be ignored.
Usage:
------
1) unpack this package in your extensions/snippets/ folder.
2) place a [[random_entry]] tag, with the appropriate parameters, in any of your template files, whereever you want the random entry link or text to appear
3) rebuild the FrontPage(s).
Description:
------------
* Selects a random blog entry and returns either its URL (permalink) or the
* text of the entry (title/subtitle/introduction/body), as specified by the
* parameters.
*
* The user may optionally specify a blog or category to restrict selection.
*
* See http://keellings.com/blog/_demos/random_entry.php
* for some examples.
Parameters:
-----------
* Note, when returning the body of the entry into the middle column of my
* three column blog, I pass the following paramaters.
* [[random_entry:.:*:0:15:
|
:::|
]]
* The
are necessary to force the output into the centre column.
* Please don't ask for much help in formatting, as I do not know HTML very well.
*
* @param string weblog - If '.' is passed, then the snippet will
* attempt to use the current blog, failing
* that, the first blog found (default = '.').
* If '*' is passed, all blogs will be
* considered. A blog name may also be passed.
* @param string category - Consider only entries of the given category,
* or all categories if set to '*' (default)).
* @param bool url - if 1 (default), will return the URL
* (permalink) of the selected entry and
* subsequent parameters are ignored.
* @param int flags - a bit mask which indicates which parts of the
* entry should be returned. If you are not
* conmfortable with binary, then please contact
* the author.
* $flags | 8 = output title
* $flags | 4 = output subtitle
* $flags | 2 = output introduction
* $flags | 1 = output body
* e.g $flags = 8 | 1 (9) means output
* title and body
* @param bool titleFormat - one or two HTML format tags, separated by |
* The first will be output before the text of
* the title, the second afterwards.
* E.g |
* Default value is '|
' (break afterwards)
* @param bool subtitleFormat - same as titleFormat, but affects subtitle
* @param bool introFormat - same as titleFormat, but affects introduction
* @param bool bodyFormat - same as titleFormat, but affects body
*
* @access public
* @return string URL (PermaLink) of a random entry, or the text of the entry,
* formatted as requested.
* v 3.0 2007/06/10 by hansfn (Molde, Norway)
* - bug fix for muløtiple random entries (reported in the forum).
* - date formatting now using Pivot date/time formatting tags.
* - using parse_intro_or_body in stead o