UPDATE: 7/12/2009 -PhotoSmash 0.3 has been released. Its new homepage is just getting started, so you might need to browse below if you don’t find what you looking for over at Smashly.net. Thanks for your patience!
Release Candidate 2 version 0.2.996 (RC3 for 0.3.00) now available at WordPress.
Final Release Candidate before going public with 0.3.00!
I need to do some documentation. Launch the new home for PhotoSmash.
Note! This version has Sorting (only 2 choices right now – Date Uploaded – Ascending or Descending…more to come).
Going live very soon!!! I hope…
Beta Testers of 0.2.99?:
First: after uploading this version is to go to Plugin Info and run the Update Database. If you still get a Database Warning in PhotoSmash Settings page, your database needs to be updated.
Second: note that the behavior of custom forms has changed. Note that you no longer have to turn on Custom Form usage in PhotoSmash Settings. You can get a custom form to work by setting it in the Gallery Settings (there is a mass update button in PhotoSmash Settings/Advanced tab/Default upload form setting – this button will update all existing galleries to use the selected custom form). Or you can use the shortcodes in your post: [photosmash form=your_form_name]
Additional security enhancements around URL’s were made to this version. It now utilizes WP 2.8 URL sanitizing, and remains backwards compatible with 2.7.
Beta Testers wanted! Go to the PhotoSmash Other Versions download page and download the Development version. When you unzip, you should have version 0.2.992. I didn’t make this 0.3.00 so you can use the automatic update feature of WP to upgrade to the Gold version.
There are tons of new features, so please beat it up and let me know what you find. I’ve tried, kind of unsuccessfully to hide the complexity from the Plugin-n-go user of PhotoSmash, so if you have any suggestions for making the basic plugin more friendly…PLEASE let me know!
A new website, Smashly.net, is on its way also. It’s just a shell right now, but it will ultimately house PhotoSmash, Supple Forms, and the Smashly WordPress community. I want to have it ready for the PhotoSmash 0.3.00 official release…we shall see.
Thanks for your help!
Permanent Alert (posted 4/16/2009): Please note that using 0777 as a folder permission is highly discouraged (DESPITE MY RECOMMENDATIONS IN THE COMMENTS BELOW). Please note that I no longer recommend setting folder permissions to 0777, but rather the upload folders should have 0755. Version 0.2.55 includes the Plugin Info page in the admin section that helps you determine what your permissions are and will let you set them appropriately (unless SAFE MODE is on in your PHP config).
[Here begins the ORIGINAL Post]
I am pleased to announce the release of my first “real” WordPress plugin, PhotoSmash Galleries. While there are at least a dozen photo gallery plugins available for WordPress, PhotoSmash adds something to the WordPress world that wasn’t there before (at least, I think so). What could that possibly be? you ask. Well, PhotoSmash makes it possible for your users to upload photos to galleries right from your Posts or Pages.
For directions in using the plugin, see the Usage section below.
Download at the PhotoSmash page on WordPress
- Produces XHTML 1.0 Transitional markup for public facing pages
- User contributable photo galleries
- AJAX photo uploads
- Control who can upload images: admin only, authors & contributors (and higher), or registered users and higher
- Moderate images uploaded by registered users (Admins and authors are automatically approved)
- Receive email alerts for new images that need to be moderated
- Options page for setting general defaults or specific gallery settings
- Auto-adding of photo galleries
- Multiple galleries per post, added using a simple tag system
- Integrates with popular image viewing systems like Lightbox and Shadowbox
- Tweak appearance through the included css file
- Allows loading images to galleries by URL
- Option to set thumbnails to crop to size or maintain aspect raito
- Various display options for captions, including displaying the contributor’s name and website link
- Admins can set how many images per row in the galleries (can be set by gallery)
- Admins can set how many images per page ( 0 turns off pagination )
- Supports Role Manager plugin with “Upload to PhotoSmash” capability (when assigned to a subscriber, they can upload to any gallery and “Photosmash ?” capability (where ? is the gallery ID…when assigned to a subscriber, they can upload to that specific gallery, regardless of the minimum upload user)
- Option for a URL field on the upload form. Submitted URLs can be used as links for captions
I’ll add requested features here as people ask, so I don’t lose track:
- Give an option to show uploader’s name and link to website
- Allow image upload by URL.
- RSS or subscribe for notifications by email
- Use the on page upload to add photos to NextGen Gallery (I have no illusions about besting NextGen…I’m just aiming for fast and simple, so I don’t mind this one bit 😉 )
- Import photos from existing library
- Upload a zip file of photos
- Multiple photo uploads – swf uploader
- Need to remove the “by-reference” indicator from certain function calls in admin….causing PHP call-by-reference warning.
- Need to reduce the final file size from 5M to a user configurable variable in the ajax-upload.php settings…it’s letting uploaded files stay huge – slow to download with little real quality gain on screen
- Need to show Memory capabilities for server in the admin page.
- Think about breaking up the Defaults page from the Gallery Edit page….just something to consider
- Upload photos from Flickr or Photobucket
- Allow admins to set how many photos per row…use table for that
- Add paging to galleries, allowing admins to set # of photos per page
- Add CoolIris support (that thing just blows me away)
- Add tabs to admin pages
- Send email to Subscribers who upload images: 1) upload successful (maybe – they’ll see it on the gallery anyway if they’re logged in – can’t send an email otherwise) 2) image was moderated (definitely), allow admin to type brief msg or use default msg.
- Create special role that can be assigned to individual subscribers without turning on uploading for all subscribers
- Auto-resize upload (allow admin to set maximum pixel size of final images)
- Create watermarks from custom image.
- Allow creating new thumbnails to replace the originals.
- Add option for URL field on the upload form, with options to use URLs in captions.
- Latest additions widget
- Mashup pages by tags, contributors, latest
- Photo-level Comments
- Star ratings
- Option for contributors to delete images
- Shortcode for Showing individual images
- Dashboard image approval box
- Star rating system for photos
- Upload files other than images (mp3, videos, documents)
- is there no end to the freaking list???
Soooooo….if anyone makes any enhancements to the code that they think other users might like, please let me know.
Most sites don’t need to let users upload photos, and PhotoSmash handles that requirement as well by letting you set a minimum role for uploading by gallery. If you’re simply looking to do photo galleries that only you or your authors can upload to, you’ve got lots of options in the WordPress cosmos. Where PhotoSmash differentiates there is that it lets you add images directly within your posts and pages without going to the Admin section.
Personally, I needed PhotoSmash for my CityTracs website which I’m porting over to WordPress. I want to let users upload their photos to the destination galleries there, hence the origins of PhotoSmash. Hopefully, PhotoSmash will find its niche on the Web.
Here’s a shot from the PhotoSmash options page in the Admin…when you’re actually in there, scroll down to work with individual galleries:
And finally a shot of the AJAX image upload box:
Using PhotoSmash is extremely simple:
- Download PhotoSmash and unzip…you should wind up with a folder named: bwb-photosmash
- Upload the bwb-photosmash plugin folder to your /wp-content/plugins/ folder
- In the Plugins page of your WordPress Admin, activate PhotoSmash
- There are 3 ways to add new galleries to your posts:
- Under settings, go to the PhotoSmash options page and turn on Auto-adding of galleries. You can auto-add galleries to the top of each post or the bottom of each post by changing the drop down to the correct selection. Click Update Defaults button to save changes
- Also in the PhotoSmash options page, scroll down below the PhotoSmash defaults section and select New in the gallery drop down. Fill in the details you want to use for the new gallery, and click the Save Gallery button to create the new gallery. After the save is complete, select your new gallery from the Gallery drop down and click the Edit button to retrieve it. The code (like [photosmash id=1] )for adding this specific gallery to any post or page will be in red beneath the Gallery drop down. Cut and past the code anywhere you like in your posts or pages. You can also specify multiple specific galleries within a single post or page by putting the tags with their ids in as needed.
- PhotoSmash can also create galleries on the fly for specific posts. Simply enter the following code anywhere you like in posts or pages and a gallery will be automatically created: [photosmash] The code should include everything in red, including the braces and the = sign.
- To add photos to your galleries, go to the post or page and click Add Photos link. I’m not sure what the size limit is right now. It may vary based on your php.ini settings.
- If you choose to let Registered users upload photos, their photos will be visible to Admins and the themselves only. Admins will be presented with buttons for Approve or Bury. Approve is self explanatory. Bury simply deletes the record from the database and deletes (unlinks in PHP terms) the files from the bwbps and bwbps/thumbs/ folders in the wp-content/uploads/ folder
- You will receive an email alert for photos requiring moderation. These alerts use a pseudo-cron like scheduling scheme that is triggered whenever someone views one of your blog’s pages. You can set the alert program to check every 10 minutes, 1 hour, or 1 day, or not at all.
- To edit a photo’s caption, go to the PhotoSmash options page in wp-admin. Select the desired gallery from the drop down and click Edit. When the page comes back, the images for that gallery will show up at the bottom of the page. There will be text boxes beneath image allowing you to edit captions. Click save to save caption edits. Approve buttons will be present for images needing moderation. Delete will be available for all images.
- To integrate with Lightbox or Shadowbox, simply include the correct “rel” information in the Gallery specific options on the PhotoSmash options page. You can set your general PhotoSmash default rel in PhotoSmash Defaults section so that any newly created galleries will automatically get the rel. For Lightbox, set the rel to lightbox. Shadowbox can use lightbox or shadowbox. To group a galleries images together as an album for Shadowbox, use something like: shadowbox[album] as the gallery’s rel.
- To prevent a post from receiving a gallery when Auto-add is activated, simply enter the following tag anywhere in the post’s content:
- To use with Role Manager plugin: the Role Manager plugin lets you give specific subscribers additional capabilities. PhotoSmash supports these capabilities by allowing you to give users additional access to galleries that their roles do not allow (e.g. a Subscriber could upload to a gallery that is set to Admins only). Here are the steps:
- Install the Role Manager Plugin (see link above)
- In the Users menu box in Admin, click on Capabilities
- Add a capability called: Upload to PhotoSmash
- To assign this capability to a user, click Authors & Users
- Edit the user you are targeting
- At bottom of user profile screen, check the Upload to PhotoSmash checkbox in the Assign extra capabilities section and Save (Update) user…this user can now upload to any gallery regardless of the minimum role you have specified for those galleries.
- To target a specific gallery, in #3, create the capability: Photosmash ? (where ? is the gallery ID #, e.g. Photosmash 10 ). You can find the gallery ID # in the Gallery Settings screen in PhotoSmash admin section. It is the same number that is used in the shortcode that can be used to specify a gallery. Choose this capability in #6 instead of the Upload to Photosmash capability. Assigning both would be redundant since Upload to Photosmash gives access to all galleries. You can assign as many specific galleries to a user as you like.
- To add the URL field to the upload form and use the user submitted URLs as the link for your captions, there are 2 settings needed to use feature: 1) you must turn on the field to show up in the Upload Form. Do this in PhotoSmash Settings / Gallery Defaults tab, the checkbox at the bottom of form. 2) There are 2 options in Gallery Settings and PhotoSmash Settings pages under the Viewing tab and in the Image caption style that will use the User submitted URL as the caption link…look at option #3 and the last one.
- Whew…that’s about it….I think.
This plugin is available through WordPress.org so you will be able to upgrade it with the wonderful automatic plugin upgrade feature in WP 2.7.
If you’ve got ideas, or better yet, code to make PhotoSmash better, please let us know. Maybe somebody has ideas on how to integrate Flash gallery viewing like NextGen gallery has, or making the upload form more attractive. Anyway, I’d love to hear from you.
- Lightbox – there are 2 versions…one works, one doesn’t. This one does.
The Belated Changelog
- 0.2.62 (4/29/2009) – Fixed url validation on uploading images. Fixed css to make gallery table 100% width. Added options for using user submitted url’s as the thumbnail links (option must be set in Gallery Settings to become effective). Add option to make thumbnail and caption links target new windows (option is only under PhotoSmash Settings).
- 0.2.61 (4/27/2009) Fixed manual creation of new galleries to use PhotoSmash defaults. Now using Colin Verot’s upload class version 2.7 RC2. Previous version had a Safe Mode “feature” that was causing 400k errors.
- New Feature: (4/26/2009) 0.2.6 URL field added to upload form. 2 options added to allow the image caption to link to those urls. See the Usage section for instructions on use.
- 0.2.55 (4/16/2009) Added Plugin Info page in admin to assist with trouble shooting. Checks folders and tables and server info. Server info code borrowed from the immanent NextGen Gallery plugin by Alex Rabe. Change in folder permission recommendations from 0777 to 0755. Plugin Info page helps with those permissions as well.
- 0.2.54 (4/6/2009) Fixed “delete gallery” error in bwbps.admin.php. Nonce security wasn’t configured properly.
- 0.2.52 & 0.2.53 (3/23/2009) Fixed implosion error in bwbps-photosmash.php on line 767. Fixed a plugin conflict with redeclaring the JSON class when uploading. This conflict was found with Twitter Tools.
- New Feature: (3/13/2009) 0.2.5 Added support for Role Manager plugin. Can now grant specific subscribers access to upload to any gallery or to specific galleries regardless of the minimum roles. See Usage notes for details. Also, changed bwbps.js to allow IE uploads to show properly. Were showing in a single column due to rendering of “margin: auto”
- 2 New Features + bug fixes: 0.2.4 (3/11/2009) Added Tabs to admin pages. Added pagination by gallery. Fixed use of admin defined captions for Add Photos link and Upload form upload message. Fixed CSS for IE for number of images per row.
- New Feature: 0.2.3 (3/8/2009) admins can set how many images to display per row…setting is by gallery. Can also set default for new galleries
- 0.2.22 (3/6/2009) corrected XHTML validation error – replaced & with & in the ThickBox href on the Add Photos links.
- 0.2.21 (3/5/2009) corrected XHTML validation errors. Corrected duplication of moderation nonce on front page.
- New Feature: 0.2.2 (3/4/2009) added options for displaying captions, including displaying contributor’s WordPress nicename and their URL
- New Feature: 0.2.1 (3/3/2009) added ability to upload images from a URL
- New Feature: 0.2.0 added the ability to choose to either maintain aspect ratio or crop when creating thumbnails.
- 0.1.99 – in bwbps-photosmash.php fixed <?= WINC to <?php echo WIND; ?>…this was causing some uses problems. Changed bwbps.js to use standard $j(‘#bwbps_uploadfile’).val() instead of $j(‘input[@name=bwbps_uploadfile]’).fileValue().
- 0.1.97 – now using JSON.php class in admin Photo Manager page for ajax calls….affects ajax.php. Fixed the same json_encode problem for PHP4 in admin as for the upload
- 0.1.96 – added the JSON.php class to ajax_upload.php to make json_encode compatible with PHP4.
- 0.1.95 – changed the code that handles image files to utilize WP_CONTENT_DIR and WP_CONTENT_URL. This was needed to deal with implementations of WP that did not use the root directory, or used non-standard (but perfectly acceptable) locations for their Content or Upload directories.
- Thanks to Colin Verot for making his upload class available through the GPL. PhotoSmash uses Colin’s class.upload.php for manipulating images and making sure the correct folders exist.
- Thanks to Cory and Michal for their work on the JSON encoding class.
- Thanks to the WordPress community for sharing, inspiration, patience, and passion.
- Thanks to my alpha/beta debuggers…I won’t name names, because I don’t want to leave anyone out. But you can see much of there contributions in the first 120 comments below.
- Thanks to Alex Rabe for the immeasurable NextGEN Gallery, which has helped me figure out a few things and has provided inspiration and the occasional snippet of code…particularly in the area of the Tabs in admin pages and the styling on the pagination.
Finally, if you do end up liking PhotoSmash enough to use it, that will be a thrill for me. If it makes your life easier in some way and you want to throw a little donation my way, that would be an even bigger thrill and much appreciated. Either way, I hope you like P’Smash.