PrestaShop Forums: FLASH BANNER RANDOM ! - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


FLASH BANNER RANDOM !


FLASH BANNER RANDOM !

#1 kaspars

    PrestaShop Newbie

  • 14 Nov 2008
  • Members
  • Pip
  • 21 posts

Posted 17 November 2008 - 08:47 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 17 November 2008 - 10:27 PM

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/





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users