Hi,
FotoBuzz (
http://2entwine.com/fotobuzz/ ) is a php/flash combination plugin which allow you to put comments ON the pictures!
It is licensed under a Creative Commons License (
http://creativecommons.org/licenses/by-nc-nd/2.0/), so no use for commercial purpose
Here is an example of FotoBuzz integrated into CPG:
http://nol33t.free.fr/cpg/displayimage.php?pos=-513The way it works:
- when there's a bigger picture to display, now it's with a link and not when you click on the picture
- users who are allowed to add comments in CPG can add comments on the pictures too ( by using the USER_CAN_POST_COMMENTS var )
- only the admins of CPG can modify or remove a comment on a picture ( by using the USER_IS_ADMIN var )
- no database modification: FotoBuzz writes comments into the jpeg header ( JFIF ). Drawback, pictures on your site are modified, don't say i did not tell you
And now here is the way to integrate it:
1/ copy the FotoBuzz files (zip attached) below into your CPG folder:
------
fbloader.swf
fotobuzz.swf
fbIR.js
fotobuzz.php
atomparser.inc
fbjfif.inc
fotobuzzxml.inc
utility.inc
------
2/ modify displayimage.php
line 190, replace
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
$pic_html .= "</a>\n";
} else {
$pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
with
$pic_html .= $lang_display_image_php['view_fs']. "</a><br>\n";
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"fotobuzz\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
} else {
$pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"fotobuzz\" border=\"0\" /><br />\n";
3/ modify script.js:
add this 4 lines at the end of the file
fbViewletPath = "fbloader.swf";
fbScriptPath = "fotobuzz.php";
fbShowNotes = true;
fbShowShadow = true
4/ modify the template.html of the theme you use:
after the line
<script type="text/javascript" src="scripts.js"></script>
add
<script type="text/javascript" src="fbIR.js"></script>
<style type="text/css" media="screen">
<!--
/* This hides the images before they are replaced */
.fbIR-hasFlash img.fotobuzz {
visibility: hidden;
}
.fbIR-flash {
visibility: visible !important;
margin: 0;
}
-->
</style>
5/ modify fotobuzz.php
replace
ALLOW_NEW_ANNOTATIONS = True;
with
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$ALLOW_NEW_ANNOTATIONS = USER_CAN_POST_COMMENTS?True:False;
and replace
$ALLOW_ONLY_ADD_ANNOTATIONS = False;
with
$ALLOW_ONLY_ADD_ANNOTATIONS = !(USER_IS_ADMIN)?True:False;
6/ Done!
The only troubleshoot i got is when you add two comments in a row on the same pic, FotoBuzz uses locks by creating a folder with the name of the pic and the ".lock" extension, and sometimes the lock tend to don't want to disappear..i think it's because of my website host (
www.free.fr), so if someone could try it on it's own server..
(if you got the same prob, just go in ftp in the album folder concerned and delete the lock manually )
Hope you'll like it
-matt-
--edit: corrected a cut & paste syntax error (";" missing
)