Page 1 of 1

Extending the "Simple Image Gallery" Plugin

Posted: Tue Dec 12, 2006 7:54 pm
by cimarron
Hello:

If you need more flexibility in the description of images, you can use the following hack:

Around line 60 of  plugin_jw_sig.php, you can add this code:

$_description=$mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a]['filename'].".desc";
if(file_exists($_description))  {
  $_message_= file_get_contents($_description);
}else{
  $_message_ = $param->get('message', 'You are browsing images from the article:');
}

This code retrieves the content of a file named "name_of_image.desc" (if it exists) and use it instead of the default value.

So you just need to upload a text file with the same name of the image (plus extension .desc) and that text will be displayed.


Regards

Re: Extending the "Simple Image Gallery" Plugin

Posted: Tue Dec 12, 2006 9:00 pm
by aravot
Thanks will try later today

Re: Extending the "Simple Image Gallery" Plugin

Posted: Fri Dec 15, 2006 7:47 pm
by aravot
Tried it did not work, can you say where exactly the code goes, I inserted the code after

Code: Select all

$html .= '<div class="sig_cont"><div class="sig_thumb"><a href="'.$mosConfig_live_site.$rootfolder.$_images_dir_.'/'.$images[$a]['filename'].'" rel="lightbox[sig]" title="'.$_message_.'<br /><b>'.$itemtitle.'</b>" target="_blank"><img src="'.$mosConfig_live_site.'/mambots/content/plugin_jw_sig/showthumb.php?img='.$_images_dir_.'/'.$images[$a]['filename'].'&width='.$_width_.'&height='.$_height_.'&quality='.$_quality_.'"></a></div></div>';

Re: Extending the "Simple Image Gallery" Plugin

Posted: Sat Dec 16, 2006 1:25 am
by cimarron
Hi.

Thanks for your test.

Actually it goes above the line you mentioned

Code: Select all

for($a = 0;$a<=$noimage;$a++) {
                     if($images[$a]['filename'] != '') {
                        $_description=$mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a]['filename'].".desc";
                        if(file_exists($_description))
                        {
                                $_message_= file_get_contents($_description);

                        }else{
                                $_message_ = $param->get('message', 'You are browsing images from the article:');
                        }

                        $html .= '<div class="sig_cont"><div class="sig_thumb"><a href="'.$mosConfig_live_site.$rootfolder.$_images_dir_.'/'.$images[$a]['filename'].'" rel="lightbox[sig]" title="'.$_message_.'<br /><b>'.$itemtitle.'</b>" target="_blank"><img src="'.$mosConfig_live_site.'/mambots/content/plugin_jw_sig/showthumb.php?img='.$_images_dir_.'/'.$images[$a]['filename'].'&width='.$_width_.'&height='.$_height_.'&quality='.$_quality_.'"></a></div></div>';

Let me know if that works for you.

regards

Re: Extending the "Simple Image Gallery" Plugin

Posted: Sat Dec 16, 2006 8:55 am
by aravot
Thanks, that worked the only thing to remember image extension is required e.g. 'joomla.jpg.desc'

Re: Extending the "Simple Image Gallery" Plugin

Posted: Wed Jan 03, 2007 4:59 pm
by mstillwagon
Am I missing something here? I tried it and can't get it to work. Do I need to alter the code if my images reside in a subdirectory (stories/sample/)?

Re: Extending the "Simple Image Gallery" Plugin

Posted: Thu Feb 15, 2007 10:03 pm
by bluebledthesea
mstillwagon wrote: Am I missing something here? I tried it and can't get it to work. Do I need to alter the code if my images reside in a subdirectory (stories/sample/)?
I'm also having a problem getting the captions to show. I'm positive I put the code in the exact location that was instructed. My images are in stories/otherfolder and are called tour1.jpg, tour2.jpg, etc. I've added files containing the description called tour1.jpg.desc, tour2.jpg.desc, etc. in the same folder where my images reside. What could I possibly be missing or doing wrong? Am I supposed to alter the additional code if my images are in a special folder?

Thank you!  ???

Re: Extending the

Posted: Fri Apr 26, 2013 2:08 am
by izzo
I know this is an old thread, but it might as well be what I need.

Just installed the plugin - v2.2 on J2.5, all good and dandy, however it is 6 years later (since when the thread was made...)

There is no plugin_jw_sig.php!!!! The ONLY php file I am finding is jw_simpleImageGallery.php...

Any idea?

Re: Extending the

Posted: Thu May 02, 2013 11:18 pm
by izzo
Bueller?

Re: Extending the

Posted: Mon May 13, 2013 2:00 am
by izzo
Anyone?