Connect with us

Plugins

Gallery Plus

Published

on

You may notice on some of our posts a gallery of images. We are using the built in WordPress up-loader, and when there are a few images we use the gallery insert button. But we are fans of jQuery and are using Thickbox.

As you know the basic gallery insert with attach the gallery images and link them to an image attachment page. Instead we installed the Gallery Plus plugin by Justin Hawkwood.

This plugin alone will add the ability under the Settings — options to add a “title” attribute in the <a> link and a rel attribute of “lightbox”.

Now I do have some site’s with lightbox installed, and I am a fan of the script, but I didn’t want to use the Scriptaculous script. And I do know that there is a Lightbox script based on jQuery.

Anyway… since I am using the Thickbox script on this site, the plugin needed a little tweaking:

There are two files contained in the download: gallery-plus.php & options.php, both with need to be edited. Lets start with the options.php:

Find.

update_option('gallery_plus_overlay', $_POST['gallery_plus_overlay']);

Add the 2nd line below, like this.

update_option('gallery_plus_overlay', $_POST['gallery_plus_overlay']);
update_option('gallery_plus_overlay2', $_POST['gallery_plus_overlay2']);

Next Find.

$gallery_plus_overlay = stripslashes(get_option('gallery_plus_overlay'));

Add the 2nd line below, like this.

$gallery_plus_overlay = stripslashes(get_option('gallery_plus_overlay'));
$gallery_plus_overlay2 = stripslashes(get_option('gallery_plus_overlay2'));

This is where it gets tricky. Find these next lines.

<tr valign="baseline">
<th scope="row"><?php _e('"rel" value in &lt;a&gt; tag:') ?></th>
<td><select name="gallery_plus_overlay">
<option value="none"<?php if ($gallery_plus_overlay == 'none') echo ' selected="selected"'; ?>>none</option>
<option value="lightbox"<?php if ($gallery_plus_overlay == 'lightbox') echo ' selected="selected"'; ?>>lightbox</option>
</select> Specify which, if any, javscript image overlay package to use. THIS PLUGIN DOES NOT INSTALL ANY OVERLAY PACKAGES.<br /><em>Note: Only applies when <strong>Link type</strong> is set to "image".</em>
</td></tr>

And Add these lines above.

<tr valign="baseline">
<th scope="row"><?php _e('Insert "class=..." Attribute In Link:') ?></th>
<td><select name="gallery_plus_overlay2">
<option value="none"<?php if ($gallery_plus_overlay2 == 'none') echo ' selected="selected"'; ?>>NONE</option>
<option value="thickbox"<?php if ($gallery_plus_overlay2 == 'thickbox') echo ' selected="selected"'; ?>>thickbox</option>
</select> <em>Note: Only applies when <strong>Link Images To Full Resolution</strong> is on.</em>
</td></tr>

It should look like this:

<tr valign="baseline">
<th scope="row"><?php _e('Insert "class=..." Attribute In Link:') ?></th>
<td><select name="gallery_plus_overlay2">
<option value="none"<?php if ($gallery_plus_overlay2 == 'none') echo ' selected="selected"'; ?>>NONE</option>
<option value="thickbox"<?php if ($gallery_plus_overlay2 == 'thickbox') echo ' selected="selected"'; ?>>thickbox</option>
</select> <em>Note: Only applies when <strong>Link Images To Full Resolution</strong> is on.</em>
</td></tr>


<tr valign="baseline">
<th scope="row"><?php _e('"rel" value in &lt;a&gt; tag:') ?></th>
<td><select name="gallery_plus_overlay">
<option value="none"<?php if ($gallery_plus_overlay == 'none') echo ' selected="selected"'; ?>>none</option>
<option value="lightbox"<?php if ($gallery_plus_overlay == 'lightbox') echo ' selected="selected"'; ?>>lightbox</option>
</select> Specify which, if any, javscript image overlay package to use. THIS PLUGIN DOES NOT INSTALL ANY OVERLAY PACKAGES.<br /><em>Note: Only applies when <strong>Link type</strong> is set to "image".</em>
</td></tr>

Now lets edit the gallery-plus.php file:

Find.

'overlay' => get_option('gallery_plus_overlay'),

Add the 2nd line below, like this.

'overlay' => get_option('gallery_plus_overlay'),
'overlay2' => get_option('gallery_plus_overlay2'),

Next Find.

<a href=\"$full_image_href[0]\"" . (($overlay != 'none') ? ' class="' . $overlay . '"' : '') . ($atagtitle ? " title=\"".trim(htmlspecialchars($attachment->post_title, ENT_QUOTES ))."\"" : '') . "><img src=\"$thumbnail_link[0]\" title=\"".trim(htmlspecialchars($attachment->post_title, ENT_QUOTES ))."\" alt=\"".trim(htmlspecialchars($attachment->post_excerpt, ENT_QUOTES))."\" width=\"$thumbnail_link[1]\" height=\"$thumbnail_link[2]\" class=\"attachment-thumbnail\" /></a></{$icontag}>";

And change the $overlay to $overlay2, like this.

<a href=\"$full_image_href[0]\"" . (($overlay2 != 'none') ? ' class="' . $overlay2 . '"' : '') . ($atagtitle ? " title=\"".trim(htmlspecialchars($attachment->post_title, ENT_QUOTES ))."\"" : '') . "><img src=\"$thumbnail_link[0]\" title=\"".trim(htmlspecialchars($attachment->post_title, ENT_QUOTES ))."\" alt=\"".trim(htmlspecialchars($attachment->post_excerpt, ENT_QUOTES))."\" width=\"$thumbnail_link[1]\" height=\"$thumbnail_link[2]\" class=\"attachment-thumbnail\" /></a>
</{$icontag}>";

note: I know that this is really just riding the plugin of the lightbox script and telling it to use the thickbox only script, but till it’s added in, this is the way I went about it.

Thanks

Continue Reading
Click to comment

You must be logged in to post a comment Login

Leave a Reply

Plugins

WordPress Audio Player Plugin

Published

on

I recently went looking for a good audio player for WordPress. I came across WPAudioPlayer from 1 pixel out.

The plugin is extremely simple to use and has a really awesome automatic color detention tool which will match to your site with ease. For more info visit the demo page at http://www.1pixelout.net/code/audio-player-wordpress-plugin/

Continue Reading

News

cforms II now GPL compliant

Published

on

Well, it was a long run, ok, only 24 hours when Mr. Seidel’s announced that he would pull the plug on further updates to the cforms plugin.

But after consideration and many emails, he has released a update to a GPL compliant version of his plugin: 10.2.

Continue Reading

Plugins

Search Unleased: A custom WordPress plugin

Published

on

Most all WordPress theme’s use a a simple search form to search your site. But what it you wanted to search your whole site and not just your posts.

Search Unleashed comes into the picture. Search Unleashed performs searches across all data, including that added by plugins.

Some features of this plugin are:

  • Full text search with wildcards and logical operations
  • Search posts, pages, comments, titles, URLs, tags, and meta-data (all configurable)
  • Search data after it has been processed by plugins, not before
  • Search highlighting of all searches, including titles and comments
  • Search highlighting of incoming searches from Google, Yahoo, MSN, Altavista, Baidu, and Sogou
  • Search results show contextual search information, not just a post excerpt
  • Record search phrases and display in a log
  • Exclude specific posts and pages from results
  • Compatible with WP-Cache
  • Supports WordPress 2.0.5 through to 2.7
  • No changes required to your theme
Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

John Singleton Net Worth: 5 Interesting Facts You Should Know

John Singleton Net Worth: 5 Interesting Facts You Should Know

John Singleton is an American producer, director, and screenwriter. He is best known for directing the movie “Boyz n the Hood” for which he was nominated for the Best Director in Academy Awards. Here are five facts about John Singleton including his net worth, career, and much more. 1. John Singleton’s net worth is estimated […]

Cuban Doll Net Worth: 5 Interesting Facts You Should Know

Cuban Doll Net Worth: 5 Interesting Facts You Should Know

There are so many people around the world, who came to fame after being active on social media. Aaliyah Keef, who is best known as Cuban Doll too came out being popular from Instagram. She usually shares a professional lifestyle in her pictures. Here are some amazing facts about Cuban doll including her net worth, […]

Lil Uzi Vert Net Worth

Lil Uzi Vert Net Worth

Lil Uzi Vert Net Worth. Music is growing at a very rapid growth, such was for famous American rapper and songwriter, popularly known as Vert, but later changed to Lil Uzi Vert because fans described his rap flow very fast. His real name is Symere Woods, born on July 31st, 1994 in Philadelphia, Francisville. He […]

Justin Rose Net Worth

Justin Rose Net Worth

Who is Justin Rose? Justin Rose is an English golfer who plays mostly on the PGA Tour. Justin is known for winning the gold at men’s individual tournament and also being the runner up twice at the Masters’ Tournament in 2015 and 2017. Justin’ Early Life Justin was born on July 30, 1980, in Johannesburg, […]

Trending