PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

FLASH BANNER RANDOM !

1 reply to this topic
#1
kaspars

    PrestaShop Newbie

  • Members
  • Pip
  • 21 posts
PLEASE HELP ! I need this code .tpl file . Or there this code input ?
$imglist='';
//$img_folder is the variable that holds the path to the swf files.
// see that you dont forget about the "/" at the end
$img_folder = "images/";
mt_srand((double)microtime()*1000);
//use the directory class
$imgs = dir($img_folder);
//read all files from the directory, ad them to a list
while ($file = $imgs->read()) {
if (eregi("swf", $file))
$imglist .= "$file ";
} closedir($imgs->handle);
//put all images into an array
$imglist = explode(" ", $imglist);
$no = sizeof($imglist)-2;
//generate a random number between 0 and the number of images
$random = mt_rand(0, $no);
$image = $imglist[$random];
//display random swf
echo '<embed src="'.$img_folder.$image.'" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="520"
height="120"></embed>';


Ineed install this code block left , block center , block footer , block right !

#2
1eyebrow

    PrestaShop Newbie

  • Members
  • Pip
  • 21 posts
http://www.ecartserv.../products-page/

Grab this mod it lets you add blocks and code to the blocks and its easy to use. In the following thread he explains how to use it a bit.

http://www.prestasho...iewthread/7315/