RotateMarkup
Description
To use this script, the administrator defines $RotateMarkup['default'] as an array of markups to be substituted for the (:rotate:) directive when it is encountered. For example, this page is configured with:
$RotateMarkup['default'] = array(
'http://www.pmwiki.org/',
'http://www.pmwiki.org/pmwiki/pub/skins/pmwiki/pmwiki-32.gif',
'[[PITS.PITS | PITS Home Page]]',
'[[Cookbook:WikiSmileys | http://www.pmwiki.org/pmwiki/pub/smileys/happy.gif]]',
'%red% The PmWikiPhilosophy is excellent! %%'
);
$RotateMarkupFreq = 5;
$EnableIMSCaching = 0;
include_once('cookbook/rotatemarkup.php');
When the (:rotate:) directive is encountered, rotatemarkup.phpΔ replaces it with one of the markups defined in the array above. For example:
(:rotate:) |
(:rotate:) |
The variable $RotateMarkupFreq specifies how often the markup should be changed -- this page is configured to change the markup every five seconds. Thus, if you reload this page every five seconds you should see a different output in the example above.
Notes
- If the caching is enabled (see
$EnableIMSCaching) then browsers may reload pages from the cache and the rotation won't be evident. - Any valid PmWiki markup can be placed in the array, although using
(:rotate:)recursively is probably not a good idea. :-)
See Also
Contributors
- Pm, 2004-12-22
Questions
User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.