(Requires PHP 4.2.x+ Support)
(Requires PHP 4.2.x+ Support)
Our final planned tutorial involves customizing the server-side script, fotobuzz.php. A number of users have requested the ability to get email alerts when comments are added to an image. To achieve this functionality we've added 3 empty callback methods; onEntryAdd, onEntryDelete, and onEntryModify. If you open fotobuzz.php and look at the onEntryAdd method, you'll see the email example already there but commented out. Here's what it looks like.
function onEntryAdd($entry,$image) {Each of the hookin methods passes in an entry object and the full image path. Documentation of the entry object is also provided in fotobuzz.php right above the hookin methods.
The example below sends an email when a new entry is added
$to = "";
$subject = "New Comment On: ".basename($image);
$message = "Title: ".$entry['title']."\n";
$message .= "Comment: ".$entry['content']."\n\n";
$message .= "From: ".$entry['authors'][0]['name']."\n";
$message .= "Email: ".$entry['authors'][0]['email']."\n";
$message .= "URL: ".$entry['authors'][0]['url']."\n";
mail($to,$subject,$message,"From: fotobuzz_mailer");
}
So now it's quite easy to tie fotobuzz updates into other scripts and let you get at the info you need. Want to see other examples or have a tutorial suggestion, just let us know.
If you speak a language other than English, this one's for you. To localize FotoBuzz you simple have to translate a combination of just 16 phrases and keywords located in the file fbLang.js. We recommend using an editor that supports saving files in UTF-8 and testing your translations to make sure they show up properly in FotoBuzz. As an example, here's is the first keyword translated into a variety of languages:
English
var fbLangOk = "Ok";
Japanese
var fbLangOk = "??";
Spanish
var fbLangOk = "Sí";
French
var fbLangOk = "Oui";
German
var fbLangOk = "Ja";
Please feel free to email us with your translations and we will gladly include them with FotoBuzz as well as make them available for download.
One of the first things you'll want to do after setting up FotoBuzz on your site is change how it looks. The way you're going to do this is just by adding more keywords to the class string associated with your images.
- Here is a quick break down of all the options:
- fbNotesOff - hide comments when the viewlet first loads
- fbNumModeOff - use boxes instead of numbers to indicate image regions
- fbCaptionsOff - hide the comment captions by default
- fbDownloadOff - disable the "Save Image" button
- fbShadowOff - hide the viewlet shadow
- fbBorderOff - hide the viewlet border
- fbBorderColor#{color} - set the border color
- fbMatteOff - hide the viewlet matting
- fbMatteColor#{color} - set the matte color
- fbMatteSize{num} - set the matte size
- fbRefresh{num} - set an automatic comment refresh interval (in seconds)
Aside from the obvious style changes, the example includes an option to refresh the comments every 60 seconds. That's all there is to it.
Long overdue, but hopefully worth the wait, FotoBuzz 0.2 is ready to go. In addition to upgraded looks the new release provides a lot more functionality and customization.
- Here are some of the highlights:
- Multiple comments per region. Great for back and forth conversation on a particular region.
- Image region numbering. When you have a bunch of comments or want some logical sequencing this comes in quite handy.
- Atom support. Now you can subscribe to FotoBuzz images and keep up with comments in your favorite news reader.
- A smarter viewlet. FotoBuzz now keeps track of new and updated comments and with our new permission support, FotoBuzz knows which comments users make, allowing them to only edit their own.
- Script Hook ins. Want to extend FotoBuzz for your own purposes, no problem.
- Style control. Using simple CSS pseudo classes you can customize FotoBuzz to your own personal taste.
Over the next few days we'll be posting more about what you can do with FotoBuzz from getting email updates when new comments are made to localizing FotoBuzz to your language of choice.
Check it out and let us know what you think!
New Features:
- Script Hook-ins: This will make it much easier to extend the server-side scripts so you can do things like send an email alert when a new comment is made.
- MySQL storage: FotoBuzz installations will have the option to store image annotations in a MySQL database.
- New Comment Indicator: FotoBuzz will now keep track of the comments you've already seen.
- Multiple Selection Comments: This will let you add a comment to a selection already on the image. The current release only allows one comment per selection.
- Hide Comment Title: This will let you set an option so that only the selection box is visible and the full comment is shown when you rollover the selection. Currently the title comment is always visible.
- Additional Comment Data: Instead of just providing a name, you'll be able to leave a URL and/or email address, and specify which fields are mandatory.
- Options, options: We'll be adding a few more options to let you control what's displayed and current options like showing a shadow can now be set on a per image basis.
- UI Changes: A few tweaks to fix some clunky interfaces.
- Bug: Replace the blank dialog with an error message when unable the scripts are not able to write to the image.
- Bug: URLs with spaces and other escaped characters causes problems at the moment.
- Bug: A small bug prevents Linux users from loading pictures inside of FotoBuzz.
You can download the plugin here.
We've started using FotoBuzz to document our screenshots of Gush. Before our screenshots were static images display Gush's pretty interface, but new users were probably perplexed with all the new features. So by using FotoBuzz on our screenshots a web visitor can just mouse over the annotations and get a description of the feature. See for yourself.
This release of FotoBuzz requires PHP or Python support on your server and version 7 of the Flash Player. Since comments are actually stored inside your images, there is a current limitation that your images must be on the same server as the FotoBuzz script files.
The download includes a sample page to test your setup and our how to page shows you how to modify your existing pages to support FotoBuzz.
Give it a try and let us know what you think! Finally, comment on images the way you were always meant to!