WordPress Plugin: EasyPermGals

Let me publish my first plugin: EasyPermGals.

EasyPermGals is based on easygals by Walter Vos. Where easygals allows you to manually activate the automatic gallery feature on a per-post/per-Page basis, EasyPermGals does this automatically. Each and every post or Page is checked for attached images which are then displayed in a neat gallery underneath.

Lightbox, if installed, may be used to view the full-size images.

After a feature request (along with a donation), I added the option to switch between manual and automatic thumbnail attachment. This allows you to define, exactly where the thumbnails are supposed to be embedded. Another request was the ability to call the automatic gallery within the theme files, so I added this as well. And since I like posts and Pages to have pretty header images, you can now upload an image, tag it with a title that includes [header] or [exclude], and the image will be shown in above the post/Page content. Obviously, [exclude] will ignore the image and not show a thumbnail in the list. This lets you use images inside your posts instead showing up in the gallery.

Features

  • Admin options for lightbox support and style rules
  • Customizable code-bit to help optimize embedding
  • works for posts and Pages (something that was important to me)
  • Full-Auto and manual mode

Demo

See it in action throughout this site. An example of the images that are attached to a post can be seen here, and this is what it’s like when it’s a Page, that has images attached to it.

Actually, there are 2 images attached to this post

Installation is simple:

  1. Download EasyPermGals
  2. Unzip
  3. upload easypermgals.php to yoursite/wp-content/plugins directory
  4. activate
  5. customize

Like it?

Then write me an email or post a comment and tell me so, or

Changelog:

May 3, 2010 – **Version 1.9.2**

* Added a [noeasypermgals] option. Now, if you want to use the full-auto feature but turn it OFF for a reason, you can put this code anywhere in your post’s or Page’s content and the gallery won’t display.

December 24, 2009 – **Version 1.9.1**

* Thanks to Frank for pointing out an error due to incorrect encoding of the file. Should now be fixed.

December 22, 2009 – **Version 1.9**

* Added No-Tooltip as option. My solution to prevent ugly mouse-over tooltips did not work with all lightbox installations so I made it optional.
* Tested with WP 2.9

Febuary 18, 2009 – **Version 1.8.1**

* removed the “title” tags for the header and thumbnail images. A lot of users mass-upload and end up with weird titles in their pictures, which don’t look pretty when you get those yellow tooltips.
* added width and height to the header image since one of my own themes didn’t like not knowing image dimensions :)
* realized I need to rewrite the whole thing. It’s totally inefficient and has numerous bugs, like when you have a header image attached, it will still output the “before” and “after” stuff you can set in the options. If this is bothering anyone, please donate. Donations motivate me to fix things ;)

November 25, 2008 – **Version 1.8**

* more template tags. I previously loaded the full size image and displayed it in a reduced size … now you can extract the medium sized pic as well.

* some bugfixes, like the missing border=0 definitions in the image tags etc.

October 27, 2008 – **Version 1.7**

* template tag with options … I needed header thumbnails :)

October 27, 2008 – **Version 1.62**

* Needed to call the header without the img tags, so I added a template function. This allows me to resize it to whatever I need, use as background image or whatever.
* Some other bugfix, I forgot what it was

September 7, 2008 – **Version 1.6.1**

* Found a major bug that caused malfunction when using [easypermgal] or [nogal] in the non-full-auto-mode. Works now.

August 28, 2008, later in the evening – **Version 1.6**

* Added the ability to use easypermgals in your themes. will return the list of thumbnails, will give you the header image. Actually per request from Sören

August 28, 2008 – **Version 1.5**

* Added the possibility to use [header] or [exclude] in the image title to make the image not show up automatically. The plan is to make EasyPermGals add an image that is titled with a [header] bit to show up above the post

August 19, 2008 – **Version 1.4**

* Was missing image titles, captions and descriptions … lightbox now shows captions

April 24, 2008 – **Version 1.3**

* Added the option to switch between manual and automatic mode.

April 11, 2008 – **Version 1.2**

* Admin options extended. You can now set the separating character as well as the bit of code that you may need to add before and after the EasyPermGals container.
* Also made the options menu prettier

April 10, 2008 – **Version 1.1**

* made EasyPermGals compatible with WordPress 2.5

* EasyPermGals now returns null if no image attachments exist
* released it to the world.

Remember, if you like it, send me an email, or post a comment, or

Bilder

Kommentare:

1. Anthony Acosta&hellip | 21. April 2008 um 18:13

I like it. I was wondering if instead of showing the images underneath each post, if it would be possible to only display attached images if a tag is embeded in the post such as [easygal] or something like that. Perhaps with a toggle on the settings page which would let you switch between the two.


2. daniel&hellip | 21. April 2008 um 18:20

Well, anthony, in that case you’d like to try Walter Vos’ EasyGals, which requires you to do just that: insert a tag to display the images.
EasyPermGals just adds them automatically.

A “switch” to toggle would be a neat thing. Let me think about it. Ideally it should be a checkbox in the regular write post/page area to set thumbnails yes/no.

BTW: Walter contacted me regarding WP 2.5 compatibility. If the downloaded version does not work, contact him directly. There’s a change in the thumbnail feature in WordPress 2.5 which requires our plugin to check if it’s an old or a new thumbnail.


3. Hamoon&hellip | 30. April 2008 um 19:14

Hi, I’ve downloaded and installed this plugin but I don’t know how to use it! I have turned on the “full-auto mode” but it does not recognize the links. how is it supposed to work? I have only added some image links to my page expecting your plugin to do the rest. Can you please put a code example of how to use this plugin manually for noobs like me!? Thanks for your support.


4. daniel&hellip | 30. April 2008 um 19:39

The plugin automatically lists all images attached to the post or page.
“attached” means that you use the integrated file-upload feature; you click the browse button, select your image from the hard disk and upload it.
I suggest you write a post first, then publish it and check if it’s online. Then you go back and edit the post to attach the images.

On the other hand, there might be a bug that I thought I squashed; try deactivating full-auto mode and saving the settings, then re-activating full-auto mode.
There might be a glitch in the initial settings when installing, it would be nice if you could confirm that.


5. Hamoon&hellip | 02. Mai 2008 um 07:21

Thanks for your reply. I was expecting this plugin to make a gallery using links to images but now I get that I must upload the images in my post (and that is reasonable). Unfortunately because of some errors, I can’t upload images in any post; so I came up with making my gallery manually.


6. daniel&hellip | 04. Mai 2008 um 00:29

Right, EasyPermGals just works with attached images.
Check your directory permission via FTP … that’s usually the first problem with image uploaders. Look for something with CHMOD ;)


7. baron&hellip | 28. August 2008 um 20:29

hi. Thanks for plugin

perfect.

Regards


8. abhinav&hellip | 07. Dezember 2008 um 03:27

Thanks for this – great idea.


9. vitto&hellip | 21. Januar 2009 um 18:01

hi mores
i wrote some post on wordpress forum and you answered me a couple of time..this is the post
http://wordpress.org/support/topic/235863?replies=9
i used your plugin easyPermGals, then i momentarily deactivate it to use it later but i have some weird stuff going on in my templates. I read somewhere that some plugin store cache pages in wp db. Is your one of them? if yes is there a way to clean that cache?
if not just ignore me:)
Thanks vitto


10. daniel&hellip | 22. Januar 2009 um 00:13

You need to remove the easypermgals_header() code from your template as well … if the plugin is deactivated, this function is not found and WordPress will show you an error.


11. Palin Ningthoujam&hellip | 10. März 2009 um 07:16

Hi Daniel. Great plugin. I was wondering there is a way the plugin can find pictures from posts already published. I notice it parse only posts published after its installation. Secondly, is there a way to have the thumbnails on the gallery link to their respective post urls instead of the picture urls? Can you please help.


12. admin&hellip | 10. März 2009 um 09:27

The plugin parses all images attached to posts – new posts as well as old ones. Important is the fact that you used the “upload image” feature in WordPress, since this way an uploaded image is associable with a post.
As to changing the links … you will need to edit the plugin since I don’t have time to add this as a feature just now. Edit easypermgals.php, go to line 52 and change wp_get_attachment_url to wp_get_attachment_link (twice). I think that should do it.
But it’s a nice suggestion, I can think of a switch to turn on/off linking to post urls instead of the images directly.


13. Palin Ningthoujam&hellip | 10. März 2009 um 09:31

Great. Thanks.


14. yaayaa&hellip | 22. Mai 2009 um 07:15

Hello Daniel

I am using your plugin and i want the image thumbnails to link to an attachment page instead of the image url.

I followed the tip you gave to Palin but it doesn’t seem to work. First of all, Line 52 does not have that particular code. It has something else.

What is the appropriate hack for this current version i am using? (Latest version)

I see wp_get_attachment_url($picture->ID) on line 103.

How do i make this direct to an attachment link? By simply replacing url with “link” doesnt work.


15. admin&hellip | 22. Mai 2009 um 11:30

You need a better editor :)
Yours obviously wraps lines – turn line wrap off then you should have the “proper” line numbers

Yes, you need to change the FIRST instance if “url” to “link”, the second one displays the thumbnail so you need to leave it the way it is. So, change
$this_easygal .= "ID) . "\"$lightbox title=\"".$title."\">ID) . "\"$lightbox>";
to
$this_easygal .= "ID) . "\"$lightbox title=\"".$title."\">ID) . "\"$lightbox>";
SHOULD work … must try it first.


16. Kowski&hellip | 19. Juni 2009 um 22:50

Where is the German Plugin?


17. admin&hellip | 20. Juni 2009 um 07:37

Es gibt kein deutsches Plugin, weil ich das mit der Internationalisierung bisher noch nicht kapiert habe.
Es ist aber nicht sehr kompliziert, mein Plugin … möchtest Du das Plugin auf Deutsch, oder die Installationsanleitung?


18. Daisy&hellip | 07. November 2009 um 02:42

I love this plugin, thank you! I’m hoping you can help though. I’ve embedded [easypermgals] in my post and it works great but on my homepage (index.php) I’d like it not show at all, it displays as blank space in my paragraph.

Is there a way to embed that code and for it only to take effect in my single posts, not on my homepage?

Thanks.


19. Daniel&hellip | 07. November 2009 um 08:59

Hmm, I think you need to change your index.php file to show the_excerpt() instead of the_content().
Alternatively, try using easypermgals in full-auto mode, where the images are attached to the end of the content automatically. If you use the_excerpt() on your front page, no images will be shown.


20. Daisy&hellip | 07. November 2009 um 09:56

Wow! That’s exactly what I was looking for. Thanks! Worked like a charm :)


21. Frank&hellip | 19. Dezember 2009 um 09:34

Thanks for the awesome script! I am currently at my wits end trying to get lightbox 2 and your plug-in to play nice with each other, however when I click on a thumb, I only get an image appearing on a different page as shown here:
http://dlrfoto.com/guadalajara-2007/77/

Any help with this to get these working would help immensely!

Thanks in advance,
Frank


22. Daniel&hellip | 19. Dezember 2009 um 10:34

Lightbox does not seem to be installed properly – the javascript is not loaded in your header. EasyPermGal implements the necessary “rel=lightbox” code.
Have a look at your lightbox plugin – is it activated?
If yes, check your theme’s header.php file to make sure it includes < ? php wp_head(); ? >.


23. Frank&hellip | 22. Dezember 2009 um 00:46

OK, so the lightbox is now up and running, however the images seem to be showing up twice.

Thanks again!


24. Frank&hellip | 22. Dezember 2009 um 01:52

Sorry for the lack of clarification.

When I click on “NEXT” in an image set, an image renders twice instead of showing up just once in the lightbox.


25. Daniel&hellip | 22. Dezember 2009 um 07:17

Okay, seems like your lightbox installation does not support the “trick” I used to prevent those ugly yellow tooltips which basically involves linking to the image twice.
Give me a few hours, I might either send you a modified plugin file, or add an option to disable it in the admin.


26. Daniel&hellip | 22. Dezember 2009 um 09:09

Frank, I update the plugin to add an option for the no-tooltip trick.
Update the plugin, it should work right away. If not, go into the options and activate, then deactivate again.


27. Melissa&hellip | 22. Dezember 2009 um 09:18

Daniel,

I’ve been working with Frank on creating his blog and I just made those updates for him. It works beautifully! Thank you so much for taking the time to fix this so quickly and immediately for him. You rock.

Melissa


28. Daniel&hellip | 22. Dezember 2009 um 09:23

You’re welcome! :)


29. Frank&hellip | 23. Dezember 2009 um 20:24

Yes Daniel, thank you for taking the time to work on these issues. Although another has popped up. Whenever I’ve make an update (saving a post, editing a post, or edting anything at all to my blog) I get a warning message page that says the following:

Warning: Cannot modify header information – headers already sent by (output started at /homepages/34/d90246755/htdocs/dlrfoto/wordpress/wp-content/plugins/easypermgals/easypermgals.php:1) in /homepages/34/d90246755/htdocs/dlrfoto/wordpress/wp-includes/pluggable.php on line 865


30. Daniel&hellip | 23. Dezember 2009 um 21:11

First, disable EasyPermGals and see if the problem persists.
If it does not, try the EasyPermGals.php file I’ll be sending you, it might be an invisible character in the code.


31. Frank&hellip | 23. Dezember 2009 um 22:43

:) Looks good! Thanks again for being available to fix these issues. Everything seems to work properly now.

Happy hollidays!


32. Daniel&hellip | 24. Dezember 2009 um 09:55

No problemo. I know what it’s like to be ALMOST there but not quite … and you’re dependent on a programmer to just fix a minor issue …
:)

Thanks for testing, it was a problem with the encoding of the php file, I must’ve mucked up something. I’ll deploy the new version now!


33. Tobias Bindemo&hellip | 25. Januar 2010 um 23:28

Hi,

Thanks for a great plugin! However, i’m having some problems.. In the backend of WP, i now get error messages since i installed EasyPermGals.

PART OF THE ERROR MESSAGE: “Warning: Cannot modify header information – headers already sent by” and then it say the EasyPermGals file.

Im running WP 2.9.1. Do you know what could be wrong?

Regards,
Tobias


34. Daniel&hellip | 26. Januar 2010 um 10:57

Are you sure you’re using the latest version? There was a problem with the encoding of the php file – I fixed that and uploaded a new version (1.9.1) on the 24th of december.


35. Tobias Bindemo&hellip | 26. Januar 2010 um 21:18

Hi!

I double checked and i have the latest version, 1.9.1.. When updating a post just now i got the following error message:


Warning: Cannot modify header information – headers already sent by (output started at /home/web31343f/domains/utansmink.se/public_html/wp-content/plugins/easypermgals.php:1) in /home/web31343f/domains/utansmink.se/public_html/wp-includes/pluggable.php on line 868″

Any idea?


36. Milli&hellip | 16. Februar 2010 um 00:01

Found an error in your code:

<div class='easypermgals' style='’>

It should be:

<div class='easypermgals' style='’

Because of this the gallery starts with ‘>


37. Milli&hellip | 16. Februar 2010 um 00:22

I see that the problem only occurs when you don’t fill in the Style Definitions.


38. Milli&hellip | 16. Februar 2010 um 02:16

When EasyPermGals is active the ‘edit media’ fuction doesn’t fuction anymore.


39. Daniel&hellip | 16. Februar 2010 um 07:18

Thanks for the info, Milli. I’ll have a look at the style thing …
But why the edit media function would no longer function is beyond me … are we talking about editing the title, description etc. of uploaded files?


40. Ciramor&hellip | 22. Februar 2010 um 20:46

It seems there is an incompatibility issue between 1.9.1 and latest WordPress, 2.9.2.
Anyone else experiencing this?


41. Ciramor&hellip | 22. Februar 2010 um 20:56

Get it… Another encoding issue? I downloaded a fresh version 1.9.1 from WP database. Anyway, I opened the easypermgals.php file, at the very end added a line feed, save, and everything was ok.


42. Daniel&hellip | 22. Februar 2010 um 21:43

Probably.
I don’t know what’s going wrong with these files, lately. Somehow “TextWrangler” is more of a “TextMangler” :)
Good job fixing it, thanks for pointing it out.


43. Milli&hellip | 03. Mai 2010 um 17:15

Is it possible to not have the gallery on just one page (home page)?
I’ve tried the [exclude] tag on all the pictures for that page but Easypermgals will still generate an empty gallery.


44. Daniel&hellip | 03. Mai 2010 um 17:44

Unfortunately, no, at the moment this is not possible.
I’d need to insert a [NoEasypermgals] option, where you put that into your content and it prevents the auto-gallery from showing.

But I can’t do that at the moment … maybe in a few weeks I can look into it.


45. Milli&hellip | 03. Mai 2010 um 18:06

Thanks, i’ll look forward for that feature.


46. Daniel&hellip | 03. Mai 2010 um 21:42

Well, I couldn’t let it go :)
Download the new version, use [noeasypermgals] to make the gallery not show up.


47. Milli&hellip | 03. Mai 2010 um 22:49

Wow, that’s really fast. :)
Thanks a lot.


48. adam buxton&hellip | 17. Mai 2010 um 14:29

hi
i’m just finishing development on a site using your plugin and its wonderfull for none tech users, there seems to be a bug that some times the new image does not load on click of the next or prev , but the image number does change and the image refreshes(but stays same) unsure if its the plugin or the jquery lightbox plugin

i’ve upgraded to 1.92
http://urbanlettings.com/properties/?p=69

any help appreciated!


49. Daniel&hellip | 17. Mai 2010 um 14:54

I looked through your site and it seems to work just fine.


50. Plugins para crear una ga&hellip | 23. Juli 2010 um 11:12

[...] EasyPermGals: Este plugin basado en el easygals de Walter Vos, permite añadir las opciones de galería de imágenes en los posts o páginas que tú definas, tomando las imágenes de los archivos cargados. [...]


51. Jon&hellip | 04. Februar 2011 um 22:37

Hello,
I am having the same problem as a few others had where it says I cannot modify the header information. I tried uninstalling the plug-in and reinstalling. When i did, I got this message on the plug-ins page
“The plugin generated 3 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

When I create a new post and type something in the Title, I get this
Warning: Cannot modify header information – headers already sent by (output started at /home/content/38/6090538/html/Handcrafted Car Audio/blog/wp-content/plugins/easypermgals/easypermgals.php:1) in /home/content/38/6090538/html/Handcrafted Car Audio/blog/wp-includes/classes.php on line 1601
Any thoughts? I really want to get this to work, it’s the last piece of my puzzle. Thank you.


Kommentar hinterlassen:

Pflichtfeld

Pflichtfeld, hidden

Trackback  |  Kommentare als RSS Feed abonnieren