Imagescroller_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

maeg
Posts: 525
Joined: Fri Feb 20, 2009 2:27 pm
Location: Agerbæk, Denmark
Contact:

Re: Imagescroller_XH

Post by maeg » Sun Apr 22, 2012 4:02 pm

Hi

Thanks for quick replay (agen) :D

It works perfect!

thanks

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Slideshow_XH

Post by cmb » Sat Apr 26, 2014 9:18 pm

Korvell wrote:Maybe there's a mix of both plugins in the planning ? ;)
In planning, yes, but that is since a long time... Sorry.
maeg wrote:Slideshow dosen't support that option, try flexslider xh
+1
Last edited by cmb on Mon Apr 28, 2014 9:51 pm, edited 2 times in total.
Reason: moved this and the following posts from ./viewtopic.php?f=12&t=5525&p=41076#p41076
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Slideshow_XH

Post by cmb » Sun Apr 27, 2014 12:30 pm

Korvell wrote:I know it's possible with Imagescroller_XH, but I wish for my images to show randomized.
That could be easily accomplished. Have a look at plugin/imagescroller/index.php. There are two functions that build an array of images: imagescroller_images_from_dir() and imagescroller_images_from_file(), where it would be possible to randomize the arrays:

Code: Select all

function imagescroller_images_from_dir($dir) {
...
    natcasesort($imgs); // remove this line
    shuffle($imgs); // insert this line
    return $imgs;
}
...
function imagescroller_images_from_file($fn) {
...
    shuffle($res); // insert this line
    return $res;
}
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Slideshow_XH

Post by Korvell » Sun Apr 27, 2014 7:53 pm

The modification of index.php for Imagescroller_XH works, but then it works just like Slideshow_XH - showing the images randomized. If I call Imagescroller_XH with the data file option supplying links for the images the images doesn't show randomized but in the order they are listed in the data file. Then it's just the same as Slideshow_XH apart from the link.

Tested the flexslider, but it doesn't really work for me - the images are all just shown at once in a long vertical list...

I'll stick with Slideshow_XH for now and use a separate page with links for all the images.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Slideshow_XH

Post by cmb » Sun Apr 27, 2014 10:10 pm

Korvell wrote:If I call Imagescroller_XH with the data file option supplying links for the images the images doesn't show randomized but in the order they are listed in the data file.
Hm, that should have been solved by the second mofication. The complete function:

Code: Select all

function imagescroller_images_from_file($fn) {
    $dir = dirname($fn).'/';
    $data = file_get_contents($fn);
    $data = str_replace(array("\r\n", "\r"), "\n", $data);
    $recs = explode("\n\n", $data);
    foreach ($recs as $rec) {
    $rec = array_map('trim', explode("\n", $rec));
    $rec[0] = $dir.$rec[0];
    $res[] = $rec;
    }
    shuffle($res);
    return $res;
}
shuffle() in the second but last line should shuffle the array of images, so that their order is randomized.
Korvell wrote:Tested the flexslider, but it doesn't really work for me - the images are all just shown at once in a long vertical list...
That's most likely caused by a JavaScript error. If you like, you can have a look at the Error/JavaScript console of your browser (F12 -> ... depending on the browser).
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Slideshow_XH

Post by Korvell » Sun Apr 27, 2014 11:20 pm

Ouch - my mistake - a copy'n'paste mistake :oops:
Now it works just fine showing the images randomly with link. Btw - modified the index.php so that the links are opened in a new window (a suggestion for the next version ;) )
Now I just need a simple way to turn off the navigation buttons - don't need that and I feel they do get in the way because my images are just about 180x110 px.

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Slideshow_XH

Post by Tata » Mon Apr 28, 2014 10:31 am

Make them "display:none" in plugin stylesheet.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Slideshow_XH

Post by cmb » Mon Apr 28, 2014 10:43 am

Tata wrote:Make them "display:none" in plugin stylesheet.
Or use transparent 1x1 px PNGs instead (replace the respective images in plugins/imagescroller/images/): http://commons.wikimedia.org/wiki/File:1x1.png
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Slideshow_XH

Post by Korvell » Mon Apr 28, 2014 3:02 pm

Changed .show into .hide in this line of the plugins' index.php:

Code: Select all

$(this).find('img.imagescroller_prev, img.imagescroller_next, img.imagescroller_play, img.imagescroller_stop').show()
into

Code: Select all

$(this).find('img.imagescroller_prev, img.imagescroller_next, img.imagescroller_play, img.imagescroller_stop').hide()
Works like a charm and I'm happy :) Thank You all!

PS: If I would need the original Imagescroller_XH plugin functionality somewhere else on my site - could I then simply make a copy of the plugin folder and name it differently?

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Slideshow_XH

Post by Tata » Mon Apr 28, 2014 7:18 pm

Or maybe a new variable in config.php:

Code: Select all

$plugin_cf['imagescroller']['navig']="0"; //0 = hide, 1 = show
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply