WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: Stefek on April 03, 2010, 02:07:43 PM

Title: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on April 03, 2010, 02:07:43 PM
Welcome to the microGallery Droplet.

You may use this Droplet to place a (small)Gallery where ever you like (NEWS Posts etc.).
This droplet, of course, doesn't replace a general image-gallery-module, but it comes in handy if you need to display some pictures from a media-directory without to much effort.

Edit: I'm placing a recent version in this post (see code).
Thanks to all for further suggestions.
Thanks to User 'macsmet' for his initial code for Table Display.
Thanks to User 'DarkViper' for his explanation of the procedures the Droplet Engine uses (explanations & hints of this kind allways appraciated).
Thanks to User 'iradj' for reporting a bug.
Thanks to User 'Jamesypoo' for his request on sorting functionality (ASC|DESC|RANDOM).

I merged all those Ideas into this new Version, cleaned up the code and made the error hints "multilanguage".
New Parameters in use, see list below.

Important: The microGallery Droplet just gets the images from the directories and has no influence on the JS Files you use. If you want to use microGallery with a specialized JS, you will need to include it yourself. The microGallery will then deliver the images you specified in the droplet-call.




Quote from:  Droplet Name:  microGallery
Description: Place a microGallery anywhere

Code: ( Droplet Code ) [Select]
<?php
/*
"microGallery - place Gallery anywhere"
----------------------------------------
@Author: Christian M. Stefan (Stefek) <stefek@designthings.de>
*/

global $MESSAGE;
$output_value ="";
//  check if the 'folder' Parameter is set in the Droplet
if (!isset($folder)):
$output_value $MESSAGE['MOD_FORM']['REQUIRED_FIELDS'].":<b>microGallery call =></b> <tt>folder={path/to/the/folder}</tt>";
endif;

$img_dir WB_PATH.MEDIA_DIRECTORY.'/'.$folder.'/';
$img_url WB_URL.MEDIA_DIRECTORY.'/'.$folder.'/';  

// directory exists --->
if (is_dir($img_dir)):
// open directory and go through the files
$dir dir($img_dir);

while (FALSE !== $image_file $dir->read()):

//use jpg, gif and png files only
if (!preg_match('/.+\.(jpeg|jpg|gif|png)$/'$image_file) || 
substr($image_file01) == "."
continue;
    
   /**
    * Make Array of images for the microGallery if image files exist
    */
// convert filenames into Titles    
$img_title str_replace(array(".png"".jpg"".gif"".jpeg"), ""$image_file);
$img_title str_replace("_"" "$img_title); 
if (isset($img_title) && !empty($img_title)):     
    $link $img_url.$image_file;    
    $group = isset($group) ? $group ''//ignore $group if &group Parameter isn't set in Droplet-Call
    $image_array[] = "<a class='colorbox' href='".$link."' rel='lightbox[".$group."]' title='".$img_title."'>file'".$img_title."'</a>";
    $linkonly[] = $link;
    $image_show[] = "<a class='colorbox' href='".$link."' rel='lightbox[".$group."]' title='".$img_title."'>
    <img src='"
.$link."' alt='".$img_title."' title='".$img_title."' style='width:auto; height:120px; border:0;'/></a>";
endif;
endwhile;

if(empty($image_show)): //no images in this directory
$output_value $MESSAGE['MEDIA']['NONE_FOUND'].': (<tt> '.$img_url.' </tt>)';
return $output_value;
endif;

/**
* DISPLAY microGallery
*/

$display  (isset($display)) ? $display 'table';
$cssclass = (isset($cssclass)) ? ' class="'.$cssclass.'"' ''//&cssclass=yourclass
// check sorting
if((isset($sort) && $display == 'table') || (isset($sort) && $display == 'all')){
if($sort=='ASC'asort($image_show);
if($sort=='DESC'rsort($image_show);
if($sort=='RANDOM'shuffle($image_show);
}
switch ($display):
case 'table'//&display=table OR not-set at all
$picsperrow = (isset($cols)) ? $cols 4// Set the amount of pics per row
$output_value "<table".$cssclass."><tr>";
for ($i=0$i<count($image_show); $i++):
if (($i 0) && ($i $picsperrow == 0))
$output_value .= "</tr><tr>";
$output_value .= "<td>".$image_show[$i]."</td>";
endfor;
while ($i $picsperrow 0):
$output_value .= "<td>&nbsp;</td>";
$i++;
endwhile;
$output_value .= "</tr></table>";
break;
case 'all':  //&display=all
if(isset($sort) && $sort=='ASC'asort($image_show);
if(isset($sort) && $sort=='DESC'rsort($image_show);
if(isset($sort) && $sort=='RANDOM'shuffle($image_show);
sort($image_show);
$output_value "<ul".$cssclass.">";
foreach ($image_show as $image){     
    $output_value .= '<li>'.$image.'</li>';
}
$output_value .= '</ul>';
break;
case 'first':  //&display=first
$output_value =  $image_show[0];
break;
case 'notfirst'//&display=notfirst 
array_shift($image_array); //skip first Element of Array
$output_value '<ul style="display:none">';
foreach ($image_array as $image){     
    $output_value .= '<li>'.$image.'</li>';
}
$output_value .= '</ul>';
break;

case 'firstlink'//&display=firstlink
$output_value =  $linkonly[0];
break;
endswitch;

// <-------end: if directory exists
else:
// directory doesn't exists --->
$output_value $MESSAGE['MEDIA']['DIR_DOES_NOT_EXIST'].': (<tt> '.$img_url.' </tt>)';
endif;    
return 
$output_value;
Quote from:  Droplet Comment

Comment:Use the Droplet as follows:
[[microGallery?folder={path_to_image_directory}&display={first, notfirst, all, firstlink}&group={any_group_name}]]



Explanation of all Parameters.

?folder Parameter:
(this should be your firs parameter in the droplet call. Note the '?' (quotation mark) for the first parameter whereas '&' is used for all following settings)

What you need to do is simply install the droplet below and then use (example):
[[microGallery?folder=flowers]]
Be sure the folder 'flowers' exists in your media directory and has images in it.

You can also use deeper directories like this:
[[microGallery?folder=cars/german/oldtimer/borgward&display=all]]

Note: the starting point for your galleries is MEDIA_DIRECTORY/
If the specified folder is empty or doesn't exists you will get a massage in frontend.

Further Settings:

&display Parameters:

New Parameters (for table):

&cssclass Parameter:
Now you can use a custom class for the <ul> or <table> tag.
This may be of some importance to you due to your template stylesheet.

&group Parameter:

Set what ever you like. This is important for multiple microGalleries on the same page only (if you use ColorBox or a simmilar JS Lightbox)

&sort Parameter:

Sort ascending, descending or random.
Use:
&sort=ASC
&sort=DESC
&sort=RANDOM
(uppercase)


Enjoy!
Any feedback  welcome.


Regards,
Stefek

[/list]
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on April 05, 2010, 02:47:48 PM
Hi Stefek,

I like it very much and makes adding photogallery's so much simpler.
I also like the ColorBox integration. I didn't test all the options yet but will in a few days.

I think the 'display:all' should be default (without extra code).  Is that possible?
I don't like the images to be listed this way. I like it more with colums and rows and will try to add that.
And is there a way to add slideshow to the ColorBox?

Keep up the good work!

Greetings,

MacSmet
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Harry P. on April 05, 2010, 03:37:05 PM
Hi Stefek,

quite handy, that droplet!

Question: I tried to replace class='colorbox' with class='pic_fb' for FancyBox

I have the FancyBox module installed and the init code for it in my template's index.php

Yet it doesn't seem to work to simply replace? the class definition?

Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: mr-fan on April 05, 2010, 03:56:31 PM
I think the 'display:all' should be default (without extra code).  Is that possible?

hi macsmet,

just copy the code from the case "all":
Code: [Select]
$images = '<ul>';
foreach ($image_show as $image){    
    $images .= '<li>'.$image.'</li>';
}
$images .= '</ul>';

replace it with the the default case:
Code: [Select]
default:
$images ='"&display" parameter is wrong by <tt>'.$folder.'</tt>, please correct';
endswitch;

then you got the "all" param as default...

regards martin


Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 05, 2010, 04:09:13 PM
Hello guys, thanks for testing and feedback.

Unfortunately I have no time these days to give further support for it.
Try to figure it out for yourself.

I will come back to this thread in the middle of the week.

Kind regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Harry P. on April 05, 2010, 04:12:39 PM
As for using FancyBox, I found the answer:

Besides using class= 'pic_fb', one also needs to remove rel='lightbox[".$group."]'

Then the fancy popup display works just fine!
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 05, 2010, 06:56:15 PM
I think the 'display:all' should be default (without extra code).  Is that possible?

hi macsmet,

just copy the code from the case "all":
Code: [Select]
$images = '<ul>';
foreach ($image_show as $image){    
    $images .= '<li>'.$image.'</li>';
}
$images .= '</ul>';

replace it with the the default case:
Code: [Select]
default:
$images ='"&display" parameter is wrong by <tt>'.$folder.'</tt>, please correct';
endswitch;

then you got the "all" param as default...

regards martin




Hello Martin,
this won't work.
It can't.

Because, in this case the default switch is meant to catch cases where the user typed in a name which doesn't exist (example, he writes: &display=wholedirectory or  &display=allll - both of them are not defined), so the default switch is called and returns &display parameter is wrong by yourfolder/bladibla, please correct.

Hello MacSmat,
I think the 'display:all' should be default (without extra code).  Is that possible?

I don't think, that this should be default.
But if you want to make it default, you well need to rewrite/change the "else condition" after the switch.

Find the // &all isn't set comment and the following code :
Code: [Select]
else:
// &all isn't set
 echo "'&all' isn't set";
 return TRUE;
endif;
and replace it with:
Code: [Select]
else:
/*  &all isn't set
echo "'&all' isn't set";
return TRUE;
*/
$images = '<ul>';
foreach ($image_show as $image){    
    $images .= '<li>'.$image.'</li>';
}
$images .= '</ul>';
return $images;
endif;

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 05, 2010, 07:02:28 PM
@MacSmet

I don't like the images to be listed this way. I like it more with colums and rows and will try to add that.
Ye, cool.
Just work it out.

And is there a way to add slideshow to the ColorBox?
I am not sure of that.
Please check the developers Site.

The Droplet just gets the images from the directories and has no influence on the JS Files you use.


@HerryP
Cool.
I am glad you figured it out by yourself.

Regards,
Stefek

Happy Easter!
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on April 05, 2010, 07:15:06 PM
@Stefek:
I figured it out myself just one hour ago because Martin's suggestion didn't work.
Thanks anyway!

Now working on the columns and rows.

Greetings,

MacSmet
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: maverik on April 05, 2010, 10:10:31 PM
if you use my colorbox snippet slideshow will go with

Code: [Select]
Make Array of images for the microGallery ----->
    */
    if (file_exists($img_dir.$image_file)):    
    $link = $img_url.$image_file;    
    $group = isset($group) ? $group : ''; //ignore $group if &group Parameter isn't set in Droplet    
            $image_array[] = "<a rel='cslide' href='".$link."'  title='".$img_title."'>file'".$img_title."'</a>";
            $linkonly[] = $link;
            $image_show[] = "<a rel='cslide' href='".$link."' title='".$img_title."'>
    <img src='".$link."' title='".$img_title."' style='width:auto; height:120px'/></a>";
       
   endif;

i dont now if there is a problem with $group, i have deletet it and it works.

but i think it isnt good to load the great image and make it with height 120 to a thumbnail >> loadingtime !

it works as slideshow here http://wbsvn.developer-base.de/pages/micro.php
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 05, 2010, 10:20:45 PM
Hello Maverik,

yes it works with the slideshow, but unfortunatly only then, if you have only one Group (and the droplet is used only once).

On the page where I make use of this roplet, I am not using the "thumbs" at all.
Only links.
And only to the first picture of the group (the others are hidden with css).

So, when I have then 3 different Galleries with links to them, they all will mess up together using the slideshow.

Link1
Link2
Link3

Any of them should be handled as a unique set (group) of images.
I wasn't able to find the right trick (if it exisist) on developers site.

If you know and can share would be mostly appreciated.

Kind regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: maverik on April 05, 2010, 10:57:58 PM
the only trick with colorbox i know is to make more than one rel groups.

i mean:

rel=cslide1
rel=cslide2

and so on.

in frontend.js you duplicate

Code: [Select]
$("a[rel='cslide1']").colorbox({ .....code for slideshow
$("a[rel='cslide2']").colorbox({ .....code for slideshow


i hope you understand my some brocken english  :-D :-D

Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 06, 2010, 01:08:11 PM
And is there a way to add slideshow to the ColorBox?

Hello MacSmet,
the way to make use of the ColorBox Slideshow is quite easy.

Change (in Droplet Code) the line $image_show[] to:
$image_show[] = "<a href='".$link."' rel='cslide_".$group."' title='".$img_title."'>
in the Java Script add the asterisk * in the selector, like this
$("a[rel*='cslide']").colorbox({  

now you will be able to add any group name you want:
&group=1 will work but, &group=birds or &group=books will work also and will make a slideshow group for every single droplet call.

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on April 06, 2010, 11:03:54 PM
@Stefek:
Thanks for all your suggestions!
I played with adding colums and rows for the images and the following works for me (it's not perfect yet):
Code: [Select]
$images = '<table border="0" cellpadding="0" cellspacing="0" width="500"><tr><td width="120">';
foreach ($image_show as $image){    
    $images .= ''.$image.'';
}

$images .= '</td></tr></table>';

return $images;

Maybe you can add this to your droplet.

Greetings,

MacSmet
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 07, 2010, 01:27:56 AM
Hello MacSmet,
as I can see by the code, there is some problem with nesting the table data cells (td's) and table rows, right?
I will think it over next days.
A kind of controller would be helpful, in order to control the amount of td's per row.

Let me see, if I'll find some time next  days.
Or maybe some one else will have fun to extend the droplet.
We will see.

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on April 07, 2010, 09:54:38 AM
Yes my solution is to limt the with of the table to 500px.
I found a solution in another imagegallery so maybe you can use this:
Code: [Select]
// count elements in array
$img_count = count($img_list);
$img_total = count($img_list);

//figure out how many pages are needed to display all the thumbs
$page_count =  ceil($img_count / ($img_rows * $img_columns));

if(is_dir($WB_PATH.$gallery_path)) {
// start outputting content
echo '<table class="lb" cellspacing="4">' . "\n";
// Check which image to start with on the page
if (isset($_GET['img_count'])) {
$img_count = $_GET['img_count'];
}

// Set count to zero for initial view
if (!isset($_GET['img_count'])) {
$img_count = 0;

}

$row_count = 1;
$col_count = 1;

while($row_count <= $img_rows) {

echo '<tr class="lb" >';

while ($col_count <= $img_columns) {
echo '<td align="center" style="border:solid 0px #000">';
if ($img_total > $img_count){
echo '<a href="' . WB_URL . $gallery_path . $img_list[$img_count] . '" class="lb_image_link" rel="lightbox[' . $gallery_name . ']" title="' . $gallery_name . '"><img class="lb_image" src="' . WB_URL . $thumb_path . $img_list[$img_count] . '" border="0" /></a>';
}
echo '</td>' . "\n";
$col_count++;
$img_count++;
}
echo "</tr>\n";
$col_count = 1;
$row_count++;
}

echo '</table>';

Greetings,

MacSmet
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 07, 2010, 08:40:06 PM
Hello MacSmet,

the following code should work for you.
Just replace between "else:" / "endif;"

Code: [Select]
<?php
/*
 -------------| output microGallery in table
 */
 
$picsperrow 4// Set the amount of pics per row
$images "<table><tr>";

for ($i=0$i<count($image_show); $i++):
if (($i 0) && ($i $picsperrow == 0))
$images .= "</tr><tr>";
$images .= "<td>".$image_show[$i]."</td>";

endfor;

while ($i $picsperrow 0):
$images .= "<td>&nbsp;</td>";
$i++;
endwhile;

$images .= "</tr></table>";

return $images

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on April 08, 2010, 06:11:36 PM
@Stefek: You're amazing!
Thanks. This is one of the best droplets ever!!!!

One thing missing.Like Maverick said: thumbnails should be generated by GD (if possible)


Greetings,

MacSmet
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Harry P. on April 08, 2010, 07:39:10 PM
Could you guys please post the complete table version? Can't get the patches working... thanks!  :-)
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 09, 2010, 12:07:02 AM
@macSmat.

I will freeze the development of this droplet for now.
GD would be possible, but it's really complicated for a droplet.
And I am using this droplet in a different way (as mentioned, only first image and the rest in a hidden div, only links).
However, I will have a look into it later. My Job doesn't allow me to be too experimental right now. ^^

@HarryP
Here's the merged droplet.


Code: (microGallery_with_Tebles_as_default) [Select]
<?php
/*

"microGallery - place Gallery anywhere"
----------------------------------------
 DROPLET for use with WebsiteBaker CMS
----------------------------------------

@Author: Christian M. Stefan (Stefek)

TODO:
1) check the code by pro coder
2) create massage if the folder is empty (small bug occurs if a empty dir is called)
3) making the costumization easier (needed?)
4) using of GD Library to create thumbs on the fly (needed?)
5) small documentation

*/


//  check if the &#39;folder&#39; Flag is set in the Droplet
if (!isset($folder)):
echo "Your droplet-call is not complete, please set &#39;folder={path}&#39;";
return TRUE;
endif;

$img_dir WB_PATH.MEDIA_DIRECTORY.&#39;/&#39;.$folder.&#39;/&#39;;
$img_url WB_URL.MEDIA_DIRECTORY.&#39;/&#39;.$folder.&#39;/&#39;;  

// directory exists --->
    
if (is_dir($img_dir)) { 
    
// open directory and go through the files       
      
$dir dir($img_dir);
      
      while (
FALSE !== $image_file $dir->read()): 
      
    // skip index files and pointers         
        if (preg_match("~.php~"$image_file) || substr($image_file01) == "."):
         continue;
        endif;      
       
   // convert filenames into Titles    
    $img_title str_replace(array(".png"".jpg"".gif"".jpeg"), ""$image_file);
    $img_title str_replace("_"" "$img_title); 
   
    if (!file_exists($img_dir.$image_file)) :
     echo &#39;directory empty&#39;;
    return TRUE;
    endif;
   
   
/**
     * Make Array of images for the microGallery ----->
     */
    if (file_exists($img_dir.$image_file)):    
    $link $img_url.$image_file;    
    $group = isset($group) ? $group : &#39;&#39;; //ignore $group if &group Parameter isn&#39;t set in Droplet      
            $image_array[] = "<a class=&#39;colorbox&#39; href=&#39;".$link."&#39; rel=&#39;lightbox[".$group."]&#39; title=&#39;".$img_title."&#39;>file&#39;".$img_title."&#39;</a>"
            $linkonly[] = $link
            $image_show[] = "<a class=&#39;colorbox&#39; href=&#39;".$link."&#39; rel=&#39;lightbox[".$group."]&#39; title=&#39;".$img_title."&#39;>
     <img src=&#39;"
.$link."&#39; title=&#39;".$img_title."&#39; style=&#39;width:auto; height:120px&#39;/></a>"
         
   endif;
   // <!------
   
endwhile;

}
// <------- directory exists
else {
// directory doesn&#39;t exists --->
echo "Directory (<tt> &#39;.$img_dir.&#39; </tt>) doesn&#39;t exist";
return TRUE;
     }    


/**
* DISPLAY microGallery
*/
if (isset($display)):

switch ($display):
case &#39;first&#39;:
$images =  $image_show[0];
break;

case &#39;notfirst&#39;:
array_shift($image_array); //skip first Element of Array
$images = &#39;<ul style="display:none">&#39;;
foreach ($image_array as $image){     
     $images .= &#39;<li>&#39;.$image.&#39;</li>&#39;;
}
$images .= &#39;</ul>&#39;;
break;

case &#39;all&#39;:
$images = &#39;<ul>&#39;;
foreach ($image_show as $image){     
     $images .= &#39;<li>&#39;.$image.&#39;</li>&#39;;
}
$images .= &#39;</ul>&#39;;
break;
case &#39;firstlink&#39;:
$images =  $linkonly[0];
break;

default:
$images =&#39;"&display" parameter is wrong by <tt>&#39;.$folder.&#39;</tt>, please correct&#39;;
endswitch;

return 
$images;

else: 
/*
-------------| output microGallery in table DEFAULT, if &display Flag isn&#39;t set
*/
 
$picsperrow 4// Set the amount of pics per row
$images "<table><tr>";

for ($i=0$i<count($image_show); $i++):
if (($i 0) && ($i $picsperrow == 0))
$images .= "</tr><tr>";
$images .= "<td>".$image_show[$i]."</td>";

endfor;

while ($i $picsperrow 0):
$images .= "<td>&nbsp;</td>";
$i++;
endwhile;

$images .= "</tr></table>";

return $images
endif;


Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Harry P. on April 09, 2010, 09:12:27 AM
Thanks, Stefek!  :-)


EDIT: Just tried the table version, but images still show up in one column (like with the original droplet).

Anything else to adjust?
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on April 09, 2010, 11:35:20 AM

Anything else to adjust?

No, just leave the &display parameter. (don't use it at all.)

Example:
[[microGallery?folder=cars]]

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Harry P. on April 09, 2010, 11:51:32 AM
Ah, now it's working... perfect - thanks!
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: snark on April 17, 2010, 09:28:03 AM
not that it is of great importance but it does not run under camino / mac


Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on April 17, 2010, 12:56:36 PM
@snoork: you must be doing something wrong because it works just fine here with Camino 2.02 on OSX 6.3.

greetings!
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: snark on April 17, 2010, 01:14:31 PM
updated the browser and I will now keep my big mouth shut ...

 8-)
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: SickBoy75 on May 18, 2010, 09:30:41 AM
Hi,

I added a new param 'col' to set the number of columns in default mode.

if not set, the default value for col it's 4

just this code

Code: [Select]
if (isset($col)){ $picsperrow = $col; } else { $picsperrow = 4;} // Set the amount of pics per row
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on August 21, 2010, 03:55:08 PM
Hello,

due to a request of User 'Kirk' I reworked and cleaned up the whole droplet and expanded the "docu".

I merged all Ideas into this new Version, cleaned up the code and made the error hints "multilanguage".
New Parameters in use for table display and custom css-class.

New Code in the first post:
https://forum.WebsiteBaker.org/index.php/topic,17806.msg118063.html#msg118063

Enjoy!
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: kirk on August 21, 2010, 07:13:18 PM
Hi Stefek,

just great. Thank´s a lot.

Kirk
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on August 21, 2010, 07:24:08 PM
My plesure, my friend ;-)

Best Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: DJKat on September 22, 2010, 02:25:00 PM
Great stuff!!! *thumbs up*

What I'm missing is a param to tell the gallery which way to sort the pics...  :|

Dany
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on September 22, 2010, 02:45:09 PM
Hello and thanks.

Do you have an idea how to implement this?

Which sorting filters to use? Name, when Uploaded, size?

Someone?


Already implemented.


Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: macsmet on September 22, 2010, 02:52:32 PM
Hi there,

I use the microGallery a lot because it is so very easy to use!
Lately I noticed that microGallery also shows the other files that is inside the folder.
It doesn't show a preview because these other files are no JPEG but ZIP files.
Is there a way to exclude ZIP files and/or only show JPEG files?

Greetings,

MacSmet
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: DJKat on September 22, 2010, 02:57:14 PM
Actually I have no idea how to do this...

But when I put it on a page for testing with pics numbered 1 to 35, it shows me pic #20, #31, #33, #26...
Therefor I think it would be great to have the opportunity to tell the gallery to sort them by name. ;)

Dany
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on September 22, 2010, 03:12:45 PM
Hello MacSmet, yes it can be done.
Will have a look into this.

DJKat,
I will have a closer look into your suggestion, but can't promise to implement this within the next days.

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: noname8 on October 26, 2010, 09:55:21 PM
This is awesome!!

Used with colorbox this just rules!

Can I somehow change the default text [[microgallery]]
to

[[microGallery?folder=cars&group=cslide]]

?
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on October 26, 2010, 10:23:20 PM
Hello nn8,

I must apologize, but I don't understand what you're asking for.

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: jamesypoo on October 31, 2010, 07:17:33 PM
Hi I was just wondering if you had been able to make it sort images by file name as requested a few posts above? This is a very valuable droplet to me and that one extra feature would make it perfect!

Thanks.
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on October 31, 2010, 07:24:13 PM
Hello,

there is no option to choose it now.

However, if you have some PHP skills, you may apply the PHP build in sort() function to do this.

Information here:
http://www.php.net/manual/en/function.sort.php

Kind regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: noname8 on November 01, 2010, 07:51:16 PM
Hello nn8,

I must apologize, but I don't understand what you're asking for.

Regards,
Stefek

when I insert the droplet to any page, it outputs a text [[microgallery]]
I'd like to change it to my config wit selected parameters and a sample path.. possible?
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on November 03, 2010, 01:57:16 AM
Hello,

Did you insert the droplet code to the Droplets Console (Admin Tool)?

If not, you cant use this droplet.
What do you mean with "my config"?

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on November 03, 2010, 03:45:49 AM
Hi I was just wondering if you had been able to make it sort images by file name as requested a few posts above? This is a very valuable droplet to me and that one extra feature would make it perfect!

Thanks.

Hello Jamesypoo.

Just updated the microGallery Code (in first post).

This is the change of interest for you:
Code: [Select]
<?php // check sorting
if((isset($sort) && $display == &#39;table&#39;) || (isset($sort) && $display == &#39;all&#39;)){
if($sort==&#39;ASC&#39;) asort($image_show);
if($sort==&#39;DESC&#39;) rsort($image_show);
if($sort==&#39;RANDOM&#39;) shuffle($image_show);
}

Udate the Dropletin your Droplet Console and apply in your [[droplet_call]]

&sort=ASC,
&sort=DESC or:
&sort=RANDOM

Please let me know if this worked for you.

Regards,
Stefek
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: Stefek on November 03, 2010, 03:54:28 AM
Hi there,

I use the microGallery a lot because it is so very easy to use!
Lately I noticed that microGallery also shows the other files that is inside the folder.
It doesn't show a preview because these other files are no JPEG but ZIP files.
Is there a way to exclude ZIP files and/or only show JPEG files?

Greetings,

MacSmet
Hello MacSmet,

I updated the microGallery (first Post) and the mentioned issue should be handled now.
See also the new implementation of the $sort parameter.

Kind Regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: iradj on November 04, 2010, 12:23:47 PM
Hi Stefek,

How can I eliminate a subdirectory in the micro-gallery-directory?

With all the other files .txt, .php etc works very well.

Iradj
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: iradj on November 05, 2010, 10:14:43 AM
Is there no solution?

Iradj
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on November 05, 2010, 01:36:18 PM
Lieber Iradj,

ich muss gestern Deinen Post übersehen haben. Entschuldige.

Ich habe das Droplet so angepasst, dass es jetzt funktionieren sollte.
Magst Du es nachprüfen und bescheid geben?

Schönen Gruß,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: iradj on November 05, 2010, 02:15:24 PM
Einfach Spitze. Danke

Iradj
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on November 05, 2010, 02:24:24 PM
You're welcome

(I forgot this is a english thread  :oops: :-P)

Kind regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: noname8 on November 09, 2010, 02:28:02 PM
There was a problem with sorting:

Your 1.st post has typo:

Quote
&sort Parameter:
Sort ascending, descending or random.
Use:
&order=ASC
&order=DESC
&order=RANDOM
(uppercase)

Should be &sort=  not &order=

But that did not work for me, so I used instead of line asort($image_show);
this one:

Code: [Select]
aksort($image_show);




function aksort(&$array,$valrev=false,$keyrev=false) {
  if ($valrev) { arsort($array); } else { asort($array); }
  $vals = array_count_values($array);
    $i = 0;
    foreach ($vals AS $val=>$num) {
        $first = array_splice($array,0,$i);
        $tmp = array_splice($array,0,$num);
        if ($keyrev) { krsort($tmp); } else { ksort($tmp); }
        $array = array_merge($first,$tmp,$array);
        unset($tmp);
        $i = $i+$num;
        // Fixed from previous post: $i = $num;
    }
}


//from php.net comments, auhor: mike at clear-link dot com


+ Thank you for this great (best) image gallery for wb
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on November 09, 2010, 02:37:27 PM
Thanks for response,

I will test it later and probably adapt parts of your code.

Should be &sort=  not &order=
Yes, it's obvious, thank you.

Kind regards,
Stefek

Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: noname8 on November 10, 2010, 10:43:24 PM
Thanks for response,

I will test it later and probably adapt parts of your code.

Should be &sort=  not &order=
Yes, it's obvious, thank you.

Kind regards,
Stefek



I'd be happy to know why the original sort didn't work. But it might be my server also..

The code isn't my, that's why there is author comment & source at the bottom. Just copied it from php.net
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: noname8 on November 17, 2010, 07:45:02 PM
Small fix for copying the path with extra space (can cause a lot of problems tough)

add to line ~29 before the   $img_dir = WB_PATH.MEDIA_DIREC TORY.'/'.$folder.'/';
Code: [Select]
$folder=trim($folder);

Let's say I've chosed ONE way to use this gallery multiple times.

How can average person add new gallery without writing code ???
My idea is to add javascript input popup into MEDIA folder browsin window.
Like "Create gallery, click here" and it would give js popup to copy the code to clipboard.
Code: [Select]
prompt("Copy this to clipboard and paste to a page editor", "[[microGallery?folder=gallery34&group=lightbox&sort=DESC]]");
But how to get a current browsed folder path without media to th js ?
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on November 17, 2010, 08:47:15 PM
Hello,

the microGallery Droplet won't replace a regular page module.
You should give a chance the "folder gallery" Module, which may fit your needs more.
This module generates for example thumbnails from all images.

microGallery Droplet is meant as an alternative way to inject a small Gallery to places where a standards Gallery Module doesn't make sense or is impossible to place without to much effort.

Kind regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: noname8 on November 17, 2010, 11:09:56 PM
All these galleries are way too difficult to use for regular person.
Using microgallery and autoresize pictures when uploading it can be used very nicely even with set of 10 or 20 pictures without long loading times. So your droplet just seems to be the best!

I somehow managed to get the edit into wb admin to make this code popup into media browser:

template\wb_theme\templates\media_browse.htt:
(find and replace row ~47  : {TEXT_CURRENT_FOLDER}: {MEDIA_DIRECTORY}{CURRENT_DIR}
Code: [Select]
{MICROGALLERYADD} {TEXT_CURRENT_FOLDER}: {MEDIA_DIRECTORY}{CURRENT_DIR}

admin\media\browse.php:
line ~121, before // Insert values
Code: [Select]
if(strlen($directory)<1)$microgallerydirectory='';
else $microgallerydirectory='<a href="#" onclick="prompt(\'Copy this to clipboard and paste to a page editor\', \'[[microGallery?folder='.ltrim($directory, "/").'&group=lightbox&sort=DESC]]\');return false";> Get gallery code</a> ::';

also couple rows later the set_var array end should look like this:

Code: [Select]
'INCLUDE_PATH' => WB_URL.'/include',
'MICROGALLERYADD' => $microgallerydirectory




[gelöscht durch Administrator]
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: noname8 on January 21, 2011, 11:36:30 AM
So this awsome droplet has couple of things to be fixed !

- if you have digital camera & windows XP the images are always   .JPG   not .jpg   (uppercase)
--> Not visible in gallery !

so:
 
Code: [Select]
if (!preg_match('/.+\.(jpeg|jpg|gif|png)$/', $image_file) ||
-->
// HELP! CANNOT ADD /i without giving error ?!!?


$img_title = str_replace(array(".png", ".jpg", ".gif", ".jpeg"), "", $image_file);
-->
$img_title = str_ireplace(array(".png", ".jpg", ".gif", ".jpeg"), "", $image_file); //ireplace


Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: DJKat on January 28, 2011, 09:27:51 AM
Hi folks!

First thanks a lot again for this great droplet!  :-D


I have fixed the JPG-issue for me this way:
Replaced line 26 with this
Code: [Select]
if (!preg_match('/.+\.(jpeg|jpg|gif|png|JPG|JPEG)$/', $image_file) || Just added JPG and JPEG. ;)


But I still have got another problem with microgallery...
When I add &sort=ASC to the call which would result in [[microGallery?folder=microgallery&group=fotos&sort=ASC]] shows the same order as if I had left the sort-command.

Any idea why this doesnt work?

Regards,
Dany


---------- EDIT ----------

Added aksort to my droplet and it works fine.
Maybe this sorting could be added in the original droplet as well...?

Regards,
Dany
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on March 28, 2011, 05:13:08 PM
Quote
Added aksort to my droplet and it works fine.
what does it mean?

i have killed the a from asort and it works (line 57).
but this can't be the right way.
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on March 28, 2011, 07:05:37 PM
Hello guys,

look at the code:

Code: [Select]
<?php // ---> snippet

// check sorting
if((isset($sort) && $display == &#39;table&#39;) || (isset($sort) && $display == &#39;all&#39;)){
if($sort==&#39;ASC&#39;) asort($image_show);
if($sort==&#39;DESC&#39;) rsort($image_show);
if($sort==&#39;RANDOM&#39;) shuffle($image_show);
}

Sort will work only if 'all' (or 'table') is set to the display parameter.
No other combinations will be supportet.



Regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on March 28, 2011, 07:33:01 PM
it want not work.

my call:
[[microGallery?folder=testordner&group=mad&display=table&sort=ASC]]  (or DESC)

there are 2 pics: green.jpg & blue.jpg
they never change the position.  :-D
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on March 28, 2011, 07:36:45 PM
So you've got a problem now. :-D

Bon chance.

Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on March 28, 2011, 08:29:45 PM
here is a idea for one new display=:
the droplet show 1 pic from a folder. the lightbox will show all pics from this folder.
droplet-call: [[microGallery?folder=something&display=one]]

the code could be:
Code: [Select]
<?php
case &#39;one&#39;:  //&display=one
$output_value =  $image_show[0];
array_shift($image_array); //skip first Element of Array
$output_value .= &#39;<ul style="display:none">&#39;;
foreach ($image_array as $image){     
    $output_value .= &#39;<li>&#39;.$image.&#39;</li>&#39;;
}
$output_value .= &#39;</ul>&#39;;
break;

the code is a mix from cases "first" and "notfirst".
add the code in the droplet befor:  endswitch;

would be great if the rel in this case is cslide instead 'lightbox[".$group."]

edit: for import a test-droplet attached.
droplet-call must be:  [[microGallery-one?folder=somewhere&display=one]]

[gelöscht durch Administrator]
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on March 28, 2011, 08:40:11 PM
Hello Frank,

nice one.

I am not working any further on this droplet.
If you want, you can work on a solution where there is another "Setting" for the 'rel'.

Maybe you have the time to go deeper into the Sort problem too.

Kind regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on March 28, 2011, 08:44:44 PM
hi stefek, i hope we have more as only me.  :-D

maybe other users have ideas/solutions too.
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on March 28, 2011, 09:10:20 PM
Yes, of course.
Feel free to fork the code.
That's why its open source.

Regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on March 28, 2011, 09:19:07 PM
no, i don't want make a fork, only a test-droplet.

the extra-code should be in the original-droplet, if the code is working good.
for some users it is easier import as change code.
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on March 28, 2011, 09:33:26 PM
Anyway you will need to fork it first, won't you?

Forking is a good thing. Look at gitHub.
All functioning teams (dev groups) work with forks in one way or another.

Regards,
Stefek
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: baggi80 on August 17, 2011, 01:25:18 PM
Hi,

nice droplet  :-)

I know there ist no developing on this droplet but I have a Problem with the upcoming Gallery when I click a picture and I hope someone can help me.

Example with two Pictures in the folder. When I push the forward button, the galery close. When I open the second Picture and push the backward button it works... pushing the forward button again it close.


Someone idea?
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on August 17, 2011, 01:37:08 PM
u can try to comment out this in module colorbox frontend.js:
Code: [Select]
var $gallery, previous, next;

        next = $.fn.colorbox.next;

        $.fn.colorbox.next = function(){
                if($gallery.index(previous) == ($gallery.length - 1)){
                        $.fn.colorbox.close();
                } else {
                        next();
                }
        };


                $gallery = $("a[rel='cslide']");

                $gallery.colorbox({onComplete: function(){
                        previous = this;
                }, onOpen: function(){
                        previous = this;
                }});

this should close slideshow at the end, but sometimes it makes more ... *g*
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: baggi80 on August 17, 2011, 01:52:27 PM
Okay thx now it works as expected
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: mic on August 20, 2011, 11:48:56 AM
You may use this Droplet to place a (small)Gallery where ever you like (NEWS Posts etc.).
This droplet, of course, doesn't replace a general image-gallery-module, but it comes in handy if you need to display some pictures from a media-directory without to much effort.

Hi Stefek,

I can't get it to work. When I paste the code into the droplet-editor, the drop gets red immediately and WB complains about invalid code. I can't figure out what is going wrong.

Any help appreciated.

#m
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on August 20, 2011, 12:02:45 PM
hi, the droplet-code is ok.
please paste your code here, i'll check it.
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: mic on August 20, 2011, 12:17:51 PM
hi, the droplet-code is ok.
please paste your code here, i'll check it.

Great! ;)

It is the exact code from page #1 of this thread though.

I just added a couple of droplets, but none complained, so I think it is not a problem of Droplet (V1.51)

Code: [Select]
<?php
/*
"microGallery - place Gallery anywhere"
----------------------------------------
@Author: Christian M. Stefan (Stefek) <stefek@designthings.de>
*/

global $MESSAGE;
$output_value ="";
//  check if the &#39;folder&#39; Parameter is set in the Droplet
if (!isset($folder)):
$output_value $MESSAGE[&#39;MOD_FORM&#39;][&#39;REQUIRED_FIELDS&#39;].":<b>microGallery call =></b> <tt>folder={path/to/the/folder}</tt>";
endif;

$img_dir WB_PATH.MEDIA_DIRECTORY.&#39;/&#39;.$folder.&#39;/&#39;;
$img_url WB_URL.MEDIA_DIRECTORY.&#39;/&#39;.$folder.&#39;/&#39;;  

// directory exists --->
if (is_dir($img_dir)):
// open directory and go through the files
$dir dir($img_dir);

while (FALSE !== $image_file $dir->read()):

//use jpg, gif and png files only
if (!preg_match(&#39;/.+\.(jpeg|jpg|gif|png)$/&#39;, $image_file) || 
substr($image_file01) == "."
continue;
    
   /**
    * Make Array of images for the microGallery if image files exist
    */
// convert filenames into Titles    
$img_title str_replace(array(".png"".jpg"".gif"".jpeg"), ""$image_file);
$img_title str_replace("_"" "$img_title); 
if (isset($img_title) && !empty($img_title)):     
    $link $img_url.$image_file;    
    $group = isset($group) ? $group : &#39;&#39;; //ignore $group if &group Parameter isn&#39;t set in Droplet-Call
    $image_array[] = "<a class=&#39;colorbox&#39; href=&#39;".$link."&#39; rel=&#39;lightbox[".$group."]&#39; title=&#39;".$img_title."&#39;>file&#39;".$img_title."&#39;</a>";
    $linkonly[] = $link;
    $image_show[] = "<a class=&#39;colorbox&#39; href=&#39;".$link."&#39; rel=&#39;lightbox[".$group."]&#39; title=&#39;".$img_title."&#39;>
    <img src=&#39;"
.$link."&#39; alt=&#39;".$img_title."&#39; title=&#39;".$img_title."&#39; style=&#39;width:auto; height:120px; border:0;&#39;/></a>";
endif;
endwhile;

if(empty($image_show)): //no images in this directory
$output_value $MESSAGE[&#39;MEDIA&#39;][&#39;NONE_FOUND&#39;].&#39;: (<tt> &#39;.$img_url.&#39; </tt>)&#39;;
return $output_value;
endif;

/**
* DISPLAY microGallery
*/

$display  (isset($display)) ? $display : &#39;table&#39;;
$cssclass = (isset($cssclass)) ? &#39; class="&#39;.$cssclass.&#39;"&#39; : &#39;&#39;; //&cssclass=yourclass
// check sorting
if((isset($sort) && $display == &#39;table&#39;) || (isset($sort) && $display == &#39;all&#39;)){
if($sort==&#39;ASC&#39;) asort($image_show);
if($sort==&#39;DESC&#39;) rsort($image_show);
if($sort==&#39;RANDOM&#39;) shuffle($image_show);
}
switch ($display):
case &#39;table&#39;: //&display=table OR not-set at all
$picsperrow = (isset($cols)) ? $cols 4// Set the amount of pics per row
$output_value "<table".$cssclass."><tr>";
for ($i=0$i<count($image_show); $i++):
if (($i 0) && ($i $picsperrow == 0))
$output_value .= "</tr><tr>";
$output_value .= "<td>".$image_show[$i]."</td>";
endfor;
while ($i $picsperrow 0):
$output_value .= "<td>&nbsp;</td>";
$i++;
endwhile;
$output_value .= "</tr></table>";
break;
case &#39;all&#39;:  //&display=all
if(isset($sort) && $sort==&#39;ASC&#39;) asort($image_show);
if(isset($sort) && $sort==&#39;DESC&#39;) rsort($image_show);
if(isset($sort) && $sort==&#39;RANDOM&#39;) shuffle($image_show);
sort($image_show);
$output_value "<ul".$cssclass.">";
foreach ($image_show as $image){     
    $output_value .= &#39;<li>&#39;.$image.&#39;</li>&#39;;
}
$output_value .= &#39;</ul>&#39;;
break;
case &#39;first&#39;:  //&display=first
$output_value =  $image_show[0];
break;
case &#39;notfirst&#39;: //&display=notfirst 
array_shift($image_array); //skip first Element of Array
$output_value = &#39;<ul style="display:none">&#39;;
foreach ($image_array as $image){     
    $output_value .= &#39;<li>&#39;.$image.&#39;</li>&#39;;
}
$output_value .= &#39;</ul>&#39;;
break;

case &#39;firstlink&#39;: //&display=firstlink
$output_value =  $linkonly[0];
break;
endswitch;

// <-------end: if directory exists
else:
// directory doesn&#39;t exists --->
$output_value $MESSAGE[&#39;MEDIA&#39;][&#39;DIR_DOES_NOT_EXIST&#39;].&#39;: (<tt> &#39;.$img_url.&#39; </tt>)&#39;;
endif;    
return 
$output_value;

#m
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on August 20, 2011, 12:24:50 PM
i test with 1.51 and the code is ok.
the leading <?php is not needed, but the modul remove this for you.

hm, what can be the problem?
droplet-name, desc or comment?
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: mic on August 20, 2011, 12:35:04 PM
i test with 1.51 and the code is ok.
the leading <?php is not needed, but the modul remove this for you.

hm, what can be the problem?
droplet-name, desc or comment?

Hey, I just did it again and simply copied the presets for name, desc and comment - and it is all blue ;)

Now I'll see if I can get the gallery as such to work.

You pointed me the right way. Many thanks!

UPDATE: Alas, the gallery won't work.

The frontend spits:

Code: [Select]
Fatal error: Call to undefined function use_fancy_box() in /volume1/web/sandbox_wsb/modules/droplets/droplets.php(29) : eval()'d code on line 2
And that line (first part of file) reads:

Code: [Select]
<?php
/**
 *
 * @category        module
 * @package         droplets
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
 * @author          WebsiteBaker Project
 * @copyright       2004-2009, Ryan Djurovich
 * @copyright       2009-2010, Website Baker Org. e.V.
 * @link http://www.websitebaker2.org/
 * @license         http://www.gnu.org/licenses/gpl.html
 * @platform        WebsiteBaker 2.8.x
 * @requirements    PHP 4.4.9 and higher
 * @version         $Id$
 * @filesource $HeadURL$
 * @lastmodified    $Date$
 *
 * droplets are small codeblocks that are called from anywhere in the template.
 *  To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]\
 *
 *  1.0.2, bugfix, Reused the evalDroplet function so the extracted parameters will be only available within the scope of the eval and cleared when ready.
 *  1.0.3, optimize, reduce memory consumption, increase speed, remove CSS, enable nested droplets
 *
 */

function do_eval($_x_codedata$_x_varlist, &$wb_page_data)
{
extract($_x_varlistEXTR_SKIP);
return(eval($_x_codedata));
}

function processDroplets( &$wb_page_data ) {
// collect all droplets from document
$droplet_tags = array();
$droplet_replacements = array();
if( preg_match_all( &#39;/\[\[(.*?)\]\]/&#39;, $wb_page_data, $found_droplets ) )
{
foreach( $found_droplets[1] as $droplet )
{
if(array_key_exists( &#39;[[&#39;.$droplet.&#39;]]&#39;, $droplet_tags) == false)
{

Cheers!
#m
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on August 20, 2011, 01:09:36 PM
the droplet want work with colorbox.
a link to your site could help.
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: mic on August 20, 2011, 01:36:48 PM
the droplet want work with colorbox.
a link to your site could help.

It isn't online yet. This is local on my NAS.

Ah, wait. I don't think I have colorbox installed, neither for LA nor as single module...

I'll check and report that later. Gotta shoot a little now ;)

Thanks

#m
Title: Re: microGallery *droplet* (place Gallery anywhere)
Post by: erutter on August 21, 2011, 08:01:03 PM
hello! i cant get it work with the colorbox. i insert colorbox into my template, i insert it into the droplet code, but where i have to insert the code in the java script.. where i can find the java script??

Thanks :)

And is there a way to add slideshow to the ColorBox?

Hello MacSmet,
the way to make use of the ColorBox Slideshow is quite easy.

Change (in Droplet Code) the line $image_show[] to:
$image_show[] = "<a href='".$link."' rel='cslide_".$group."' title='".$img_title."'>
in the Java Script add the asterisk * in the selector, like this
$("a[rel*='cslide']").colorbox({  

now you will be able to add any group name you want:
&group=1 will work but, &group=birds or &group=books will work also and will make a slideshow group for every single droplet call.

Regards,
Stefek

Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on August 21, 2011, 09:05:30 PM
the colorbox snippet contains already  the javascript-code (frontend.js).
nothing to do for you.

this
Quote
Fatal error: Call to undefined function use_fancy_box()...
is anywhere in a droplet-call (like [[fancybox]]).
delete it. to find maybe in the wysiwyg-content or index.php of your template...
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: baggi80 on August 25, 2011, 10:49:02 AM
Hello,

is there a way to center the thumbnail inside the wysiwyg if there ist only one picture in the folder?

thx baggi
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: dbs on August 25, 2011, 11:00:25 AM
hi, you could make a div with id="yourdiv" around the droplet and style with css:
Code: [Select]
#yourdiv table{margin: 0 auto;}untested...
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: baggi80 on August 25, 2011, 12:01:17 PM
jepp works... thx for the hint  :-D
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: noname8 on January 05, 2012, 09:39:38 AM
Couple of challenges for the good coders:

- Sort options DASC, DDESC = ability to sort the images by the file date modified
- Limit n = Ability to show max n qty of  images. Awesome with the date option to show a "showreel" of most new images.
Real deal:
- Paginate n, ability to divide the images with GET queries to multiple pages

Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: crnogorac081 on May 03, 2012, 10:42:35 AM
Guys, is there a demo somewhere ? I would like to see it in action..

cheers,
Ivan
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Stefek on May 03, 2012, 12:24:38 PM
Hello Ivan,

what demo do you need exactly?

The Pictures are taken from your MEDIA_DIRECTORY.'/ your_named_subfolde r'

If there is anything I can help you with, let me know.

KR,
Christian
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: crnogorac081 on May 03, 2012, 03:42:26 PM
I just got it, i needed colobox files :)

cheers,
Ivan
Title: Re: [*droplet*] microGallery (place Gallery anywhere)
Post by: Lomex on September 26, 2012, 08:16:10 PM
Hello,
even if this is the English forum, I ask here once in German. (weil mein Englisch is not so gut)

Bei mir werden nicht alle Bilder angezeigt, die sich im Ordner befinden. Scheint so, als wenn wahllos irgendwelche angezeigt werden. Manchmal werden auch gar keine angezeigt, mit der Meldung das sich keine Bilder im Ordner befinden.

Woran kanns liegen?