<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>:: TechBlog :: &#187; WPG2</title>
	<atom:link href="http://techblog.touchbasic.com/html/tag/wpg2/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.touchbasic.com/html</link>
	<description>Techblog is collection of articles covering a wide variety of tech related topics including: Linux, Microsoft, Google, web development, web design, open source, wordpress, security, and more.</description>
	<lastBuildDate>Fri, 06 May 2011 00:58:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to get the WPG2 plugin to work with Thickbox</title>
		<link>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/</link>
		<comments>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 21:12:07 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[g2image]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[thickbox]]></category>
		<category><![CDATA[WPG2]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/</guid>
		<description><![CDATA[If you have a Gallery2 installation intergrated with WordPress 2.3 &#8211; using the WPG2 plugin &#8211; then you are probably aware that the G2Image chooser includes a choice for inserting images into posts using the LightBox effect and pointing to a full-sized image. Well, i needed a choice/option that worked in a similar way but [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a Gallery2 installation intergrated with WordPress 2.3 &#8211; using the WPG2 plugin &#8211; then you are probably aware that the G2Image chooser includes a choice for inserting images into posts using the LightBox effect and pointing to a full-sized image.</p>
<p>Well, i needed a choice/option that worked in a similar way but for Thickbox. Since both Lightbox and Thickbox are triggered by including special attributes on each anchor (a link) and pointing to a full-sized image &#8211; i figured it could not be that hard to find and edit the code that inserts the LightBox bit and swap it out for some Thickbox code.</p>
<blockquote><p>LightBox format is: < a href="fullsized.jpg" rel="lightbox" >< img src="thumb.jpg" />< /a ><br />
ThickBox format is: < a href="fullsized.jpg" class="thickbox" >< img src="thumb.jpg" />< /a ></p></blockquote>
<p>All i ended up doing was adding the thickbox class=&#8221;thickbox&#8221; in addition to the lightbox rel=&#8221;lightbox&#8221;.</p>
<p>So the final result inserts the combined code into your WordPress posts:</p>
<blockquote><p>< a href="fullsized.jpg" class="thickbox" rel="lightbox" >< img src="thumb.jpg" />< /a ></p></blockquote>
<p>Now it works with either Lightbox or Thickbox scripts (i wouldn&#8217;t use both at the same time).<br />
Note: you still need to provide the appropriate javascript (Thickbox or Lightbox) and link to it in your header file for this to work.</p>
<blockquote><p>Tested with:<br />
WordPress v2.3.1<br />
Gallery2 v2.2.3 core 1.2.0.5<br />
WPG2 v3.0.2</p></blockquote>
<p>Anyway, here are the 3 WPG2 plugin files i edited to get this going:</p>
<blockquote><p>
<strong>wp-content/plugins/wpg2/g2image/g2image.php</strong> &#8211; [download the changed file <a href="http://touchbasic.googlepages.com/g2image.php">here</a>]<br />
<strong>wp-content/plugins/wpg2/g2image/jscripts/functions.js</strong> &#8211; [download the changed file <a id="p187" href="http://techblog.touchbasic.com/html/wp-content/uploads/2007/11/functions.js">here</a>]<br />
<strong>wp-content/plugins/wpg2/wpg2embed.inc</strong> &#8211; [download the changed file <a href="http://touchbasic.googlepages.com/wpg2embed.inc">here</a>]
</p></blockquote>
<p>These are the exact edits i made (but watch out! because copy/pasting seems to change the single quote marks):</p>
<p>g2image.php &#8211; modify option to give choice (in dropdown menu of W2Image chooser) for specifically inserting Thickbox<br />
	[code lang="php"] $message['thumbnail_lightbox'] = T_('Thumbnail with LightBox link to Fullsized Image'); [/code]<br />
	[code lang="php"] $message['thumbnail_lightbox'] = T_('Thumbnail with ThickBox link to Fullsized Image'); [/code]</p>
<p>functions.js &#8211; modify javascript to do the actual inserting of code with Thickbox<br />
	[code lang="php"] htmlCode += '<a href="' + fullsize_img[i] + '" rel="lightbox'; [/code]<br />
	[code lang="php"] htmlCode += '<a href="' + fullsize_img[i] + '" class="thickbox" rel="lightbox'; [/code]</p>
<p>wpg2embed.inc - modify wpg2tag so option (in dropdown menu of W2Image chooser) will work with Thickbox [optional]<br />
Note: for this to work you also need to have "Should WPG2 Tags have Lightbox Support?" set to "Yes" in your backend: WPG2 > Lightbox Options.<br />
	[code lang="php"] $img = str_replace('><img ', ' rel="lightbox['.$post-/>ID.']"><img ', $img); [/code]<br />
	[code lang="php"] $img = str_replace('/><img ', ' class="thickbox" rel="lightbox['.$post-/>ID.']"><img ', $img); [/code]</a/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

