Differences

This shows you the differences between two versions of the page.

english:phpwcms_replacer_rts:frontend_render:random-article-alias-id [2010/07/18 18:31]
Knut Heermann (flip-flop)
english:phpwcms_replacer_rts:frontend_render:random-article-alias-id [2018/06/03 18:09] (current)
Line 1: Line 1:
{{indexmenu_n>810}} {{indexmenu_n>810}}
-====== RANDOMARTICLE ======+====== RANDOMARTICLE_ALIAS/ID ======
-A quite simple solution to show a random article by alias- or id and show the result at the place of the tag **{RANDOMARTICLE}**.+A quite simple solution to show a random article by alias- or id and show the result at the place of the TAGs **{RANDOMARTICLE_ALIAS}** / **{RANDOMARTICLE_ID}**.
\\ \\
Line 9: Line 9:
---- ----
-**rt_random_article** V1.0  18.07.10  +**rt_random_article_alias** V1.0  18.07.10  
Docu: -- \\ Docu: -- \\
Line 21: Line 21:
   
-Tag: RANDOMARTICLE}  \\+TAGs: {RANDOMARTICLE_ALIAS} and {RANDOMARTICLE_ID}  \\
-Fileiname: **rt_random_article.php** +Fileiname: **rt_random_article_alias.php**
Folder:  ** template/inc_script/frontend_render/ ** Folder:  ** template/inc_script/frontend_render/ **
Line 40: Line 40:
-<code php |h rt_random_article |h >+<code php |h rt_random_article_alias |h >
<?php <?php
Line 47: Line 47:
* 18.07.10 KH: http://planmatrix.de V1.0 * 18.07.10 KH: http://planmatrix.de V1.0
* frontend_render-Script: Random article alias/id * frontend_render-Script: Random article alias/id
 +* TAGs: {RANDOMARTICLE_ALIAS} and {RANDOMARTICLE_ID}
********************************************************************************************* *********************************************************************************************
*/ */
Line 55: Line 56:
// ------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------
-if (strpos($content["all"], '{RANDOMARTICLE}') ) {+if (strpos($content["all"], '{RANDOMARTICLE_') ) {
$hidden_article = ''; // CUSTOM: All not available article like '23,45,78,...' $hidden_article = ''; // CUSTOM: All not available article like '23,45,78,...'
Line 79: Line 80:
// Output alias // Output alias
- $content["all"] = str_replace('{RANDOMARTICLE}',$result['0']['article_alias'],$content["all"] );+ $content["all"] = str_replace('{RANDOMARTICLE_ALIAS}',$result['0']['article_alias'],$content["all"] );
// Output id // Output id
- // $content["all"] = str_replace('{RANDOMARTICLE}',$result['0']['article_id'],$content["all"] );+ $content["all"] = str_replace('{RANDOMARTICLE_ID}',$result['0']['article_id'],$content["all"] );
} }
Line 92: Line 93:
  * In “$hidden_article” article IDs can be registered, which are excluded from selection. ('23,56,74,12,…') please use apostrophes at the beginning and end!   * In “$hidden_article” article IDs can be registered, which are excluded from selection. ('23,56,74,12,…') please use apostrophes at the beginning and end!
-  * If you need the id instead of the alias, please uncomment the line below %%"// Output id"%% and comment the line below %%"// Output alias"%%.+  * <del>If you need the id instead of the alias, please uncomment the line below %%"// Output id"%% and comment the line below %%"// Output alias"%%.</del> \\ 
 +**Update 19.07.2010 KH:** Two TAGs {RANDOMARTICLE_ALIAS} and {RANDOMARTICLE_ID}. 
 + 
 +\\
english/phpwcms_replacer_rts/frontend_render/random-article-alias-id.1279470685.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0