WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: midiweb on February 19, 2009, 01:12:28 PM

Title: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: midiweb on February 19, 2009, 01:12:28 PM
hi, I've been looking for a script, a snippet, or droplet  to display different changing logos of firms but at the same place, as small flash animations. I mean, for instance, a logo stays 2 seconds, another one after 4 seconds, and so on,... Cheers

Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: midiweb on February 19, 2009, 01:15:27 PM
sorry, I've just found the module "Random Image" .I'll try it.
Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: Hans on February 19, 2009, 09:30:05 PM
There's also a Droplet (http://www.websitebakers.com/pages/admin/admin-tools/droplets.php (http://www.websitebakers.com/pages/admin/admin-tools/droplets.php)) in AMASP
http://www.websitebakers.com/pages/droplets/official-library/images/random-images.php (http://www.websitebakers.com/pages/droplets/official-library/images/random-images.php)
Hans
Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: midiweb on May 19, 2009, 05:39:45 PM
hi, I tried the dropplet Randomimage but it displays one picture in one time. I would like to display all pictures from the folder in turn, alternately, as one loop.Do you know how to do that?
Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: Hans on May 19, 2009, 09:22:30 PM
http://www.websitebakers.com/pages/modules/image-galleries/smooth-gallery.php (http://www.websitebakers.com/pages/modules/image-galleries/smooth-gallery.php) in a certain configuration.
Hans
Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: Argos on May 20, 2009, 01:04:59 AM
Maybe not quite what you want out of the box, but with some work you might be able to use http://www.websitebakers.com/pages/modules/image-galleries/slideshow.php

Otherwise you have to use a simple third party image rotator script. There are many javascript ones, and also very neat ajax and jquery scripts with nice effects and options. And Flash ones of course.
Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: midiweb on May 20, 2009, 12:33:10 PM
What have I to change in the dropplet Randomimage to display in a loop without to reload tha page:

Code: [Select]
$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.');
$names = array();
while ($file = readdir($folder))  {
    $ext=strtolower(substr($file,-4));
    if ($ext==".jpg"||$ext==".gif"||$ext==".png"){
        $names[count($names)] = $file;
    }
}
closedir($folder);
shuffle($names);
$image=$names[0];
$name=substr($image,0,-4);
return '<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" width="'.$width.'" height="'.$height.'"/>';



I tried in the index.php with the PHP function

Code: [Select]
for($i=0;$i < 100;$i++)
     {
                  [[RandomImage?dir=logos]]
';
     }

But it displays 100 times the same logo and not the next logo.

Who can help me?

Title: Re: Looking for a module, a snippet, a droplet to display changing logos,....
Post by: Argos on May 20, 2009, 12:40:31 PM
You cannot use that, because you need some script function. A droplet has no script. That's why Hans and I suggested two different modules to look at.