Page 1 of 1

content plugin from my custom component - gallery

Posted: Fri Jun 06, 2008 1:07 pm
by patterncatcher
I am trying to call Simple Image gallery in my component,
It is a content plugin that looks for { gallery }foldername{ /gallery } in an article and put the images for the folder there.
How can I call a content plugin from my component?

Re: content plugin from my custom component - gallery

Posted: Mon Aug 25, 2008 12:31 am
by g00s3m4n
Hello,

Have you had any success?
I am attempting the same thing and have not been able to find a solution.

Thanks,

Re: content plugin from my custom component - gallery

Posted: Mon Aug 25, 2008 1:23 pm
by patterncatcher
I created my own solution using jquery lightbox.
Download both, and call scripts from document.
You may need to use noconflict for jquery if you are also using mootools, google it.

Javascript (put in document header)

Code: Select all

$(document).ready(function() {
$('a[@rel*=lightbox]').lightBox();
}
then in the php:

In Images/stories I created a folder called theimagefolder, inside of which are folders with name of id of database entry ($row->id) then put the code in the components .html.php file:

Code: Select all

$dir = JPATH_SITE.'/images/stories/theimagefolder/'.$row->id; // 
	
   	// open specified directory
  	 $dirHandle = opendir($dir);
		while ($file = readdir($dirHandle)) {
      // if not a subdirectory and if filename contains the string '.jpg' 
      if(!is_dir($file) && strpos($file, '.jpg')>0) {
         // update count and string of files to be returned
		 $imgurl= $live_site."images/stories/theimagefolder/".$row->id."/".$file;
		 ?>
		 <a  rel="lightbox" href = "<? echo $imgurl; ?>" title="Your title" ><img src ="<? echo $imgurl; ?>" alt="Your alt"   width="100" height="70"  /></a>
		 
		 <?
         
		 $count++;
         echo $ourlink;
      	}
   	} 
   closedir($dirHandle);

Hope this helps