Coding a lightbox in a plug in
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #1
Coding a lightbox in a plug in
I am trying to make a template in a plug in that will cause a lightbox to open when the resulting inserted image is clicked on:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
{
   $text = $this->html($text);
	if($link != '')
          {
	return "<div class=\"wikiimage\"><a href=\"{$link}\" rel=\"lightbox\"><img src=\"{$url}\" alt=\"{$text}\" /></a><br />{$text}</div>\n";
           }
	else
	{
	return "<div class=\"wikiimage\"><img src=\"{$url}\" alt=\"{$text}\" /><br />{$text}</div>\n";
	}
}


however, this is not working for me. When I inspect element using firebug then I get this:

Code:
<a rel="lightbox" href="http://www.leefish.nl/mybb/wiki.php?file/how-to-make-ambtattoos/ambtattoo-tut-1.jpg"><img alt="" src="http://www.leefish.nl/mybb/wiki.php?file/how-to-make-ambtattoos/ambtattoo-tut-1.jpg"></a>


It should be

Code:
<a href="http://www.leefish.nl/mybb/wiki.php?file/how-to-make-ambtattoos/ambtattoo-tut-1.jpg" rel="lightbox" ><img alt="" src="http://www.leefish.nl/mybb/wiki.php?file/how-to-make-ambtattoos/ambtattoo-tut-1.jpg"></a>


How should I order the input in the php to make the lightbox code show correctly? At the moment when I click on the image it just opens in a new window, rather than in a lightbox.



[Image: leelink.gif]
MYBB1.6 & XThreads
08-19-2010 06:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Coding a lightbox in a plug in - leefish - 08-19-2010 06:13 PM

 Standard Tools
Forum Jump: