NAVIGATION
This is an old revision of the document!
A quite simple solution to show Shows a random category alias- or id and show the result at the place of the tag {RANDOMCATEGORY}.
Have a look: contain-php-file-variables
rt_random_category V1.0 18.07.10
Docu: –
Forum: http://forum.phpwcms.org/viewtopic.php?p=114312#p114312
Autor: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= 1.3
Version: V1.0
Tag: {RANDOMCATEGORY}
Filename: rt_random_category.php
Folder: template/inc_script/frontend_render/
Condition: → /config/phpwcms/conf.inc.php
<?php /** ********************************************************************************************* * 18.07.10 KH: http://planmatrix.de V1.1 * frontend_render-Script: Random category alias ********************************************************************************************* */ // ------------------------------------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ------------------------------------------------------------------------------------------- $id = array_rand ( $content["struct"], 1 ); while ($content["struct"][$id]["acat_hidden"] != 0) $id = array_rand ( $content["struct"], 1 ); // Output alias $content["all"] = str_replace('{RANDOMCATEGORY}',$content["struct"][$id]["acat_alias"],$content["all"] ); // Output id // $content["all"] = str_replace('{RANDOMCATEGORY}',$id,$content["all"] ); ?>