Hi everyone,
I found this great random newsbox script:
<?php
$newsBoxList=array();
foreach ($h as $possibleNews)
if (!(strpos($possibleNews,"News_")===FALSE)) array_push($newsBoxList,$possibleNews);
echo newsbox($newsBoxList[mt_rand(0,count($newsBoxList)-1)]); ?>
I want to show it ONLY in the index... so I guess I need to put it in the content area... but how?
Random newsbox in content?
Re: Random newsbox in content?
... with CMSimple Scripting.markus.leder wrote:so I guess I need to put it in the content area... but how?
Be sure to put the code in a single line, enclosed between #CMSimple and #.
Or RTFM : http://www.cmsimple.com/?Installer%27s_ ... _Scripting
Holger
-
- Posts: 9
- Joined: Sun Sep 14, 2008 3:47 am
Re: Random newsbox in content?
Problem... even though I got the script working random thnks to your great advice,
I am not able to get it into the content area where it is supposed to be.
The random newsbox is NOT SHOWING INSIDE THE CONTENT AREA but ON TOP OF THE PAGE...
HELP
I am not able to get it into the content area where it is supposed to be.
The random newsbox is NOT SHOWING INSIDE THE CONTENT AREA but ON TOP OF THE PAGE...
HELP
Re: Random newsbox in content?
Try with the following code:markus.leder wrote:The random newsbox is NOT SHOWING INSIDE THE CONTENT AREA but ON TOP OF THE PAGE...
Code: Select all
#CMSimple $output=preg_replace("/".chr(35)."CMSimple.*".chr(35)."/",HERE YOUR SCRIPT CODE,$c[$s]);#