forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Comments => Topic started by: nol33t on December 18, 2004, 03:36:18 am

Title: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 03:36:18 am
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=-513

The 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  :P

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
Code: [Select]
            $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

Code: [Select]
            $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

Code: [Select]
  fbViewletPath = "fbloader.swf";
  fbScriptPath = "fotobuzz.php";
  fbShowNotes = true;
  fbShowShadow = true

4/ modify the template.html of the theme you use:

after the line
Code: [Select]
<script type="text/javascript" src="scripts.js"></script>
   
add
Code: [Select]
<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
Code: [Select]
ALLOW_NEW_ANNOTATIONS = True;
with
Code: [Select]
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$ALLOW_NEW_ANNOTATIONS = USER_CAN_POST_COMMENTS?True:False;

and replace
Code: [Select]
$ALLOW_ONLY_ADD_ANNOTATIONS = False;
with
Code: [Select]
$ALLOW_ONLY_ADD_ANNOTATIONS = !(USER_IS_ADMIN)?True:False;

6/ Done!  :D

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  ::))
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Casper on December 18, 2004, 11:49:19 am
In the example you give, all I see is the comment, no picture.

Edit, it works in IE, but not firefox for me.  No pic.
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Tarique Sani on December 18, 2004, 11:55:00 am
same here no pic in Mozilla / Firefox
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 01:18:21 pm
 ??? Funny cause i tested it with Firefox (Final Release) THEN adapated for IE, and pictures shows up here..(i just cleaned the history , cache etc..and still ok)

--edit: nicer screenshot ;)
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Casper on December 18, 2004, 01:20:22 pm
My firefox is also 1.0 (not the pr)
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 01:26:10 pm
all right can i pm you i'd like a screenshot of how it looks on your comp cause it works for me with firefox so there's no way it doesn't work for other  ;D
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: -chicobra- on December 18, 2004, 01:49:17 pm
hello dudes,
works perfectly using firefox 0.9.3

think I'm gonna set it up for my site, look's wicked !!!  ::)
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Casper on December 18, 2004, 03:31:19 pm
No pm please.

here's my screenshot.  Firefox 1.0 release. 

note, the egg timer is caused by my screen capture program.  The browser had finished loading.
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 04:03:16 pm
Funny...we are using the same browser and we got differents results??

Casper, could you try to go on the "basic" demo page of fotobuzz, to see if the prob come from your browser ( like the flash plugin too old or somethin of that kind ), or from my integration into CPG?

http://2entwine.com/fotobuzz/demo/

thanx
matt
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Casper on December 18, 2004, 05:25:04 pm
Not my browser, I see that site fine;
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 05:44:42 pm
...all right...but if it's not a difference between our two Firefox browsers...how is it that it's working fine for me and -chicobra-, but not for you and Tarique?
ok i keep investigating.. ;)
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 06:00:39 pm
 i've changed something in the template & css file, could you try again?
and if it's still not showing up i'm open to any suggestions..
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Casper on December 18, 2004, 06:06:10 pm
Works fine now  ;)

looks good btw.
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 06:18:47 pm
Coool!! ;D

I've updated the first post with the corrects steps to install the hack ( no need of editing the style.css anymore )

matt
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Tranz on December 18, 2004, 06:25:42 pm
I can see the photo as shown in nol33t's screenshot. It did look like Casper's screenshot for a few seconds so I thought it wasn't going to work. But it eventually did. So I guess it's some plug-in or something blocking it because it's flash? I'm using FF 1.0 final release.

It also worked in IE6

WinXP SP2.

Awesome mod.(http://tu2.net/forums/images/smiles/icon_thumbs_up.gif)
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on December 18, 2004, 06:45:25 pm
So I guess it's some plug-in or something blocking it because it's flash? I'm using FF 1.0 final release.
It was more because i'm pretty bad with css  ;D

Quote
Awesome mod.(http://www.tu2.net/forums/images/smiles/icon_thumbs_up.gif)
thanx, like it a lot too :)
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: n704fn on February 10, 2005, 05:21:58 am
Hi,

thanks for the mod.  I made all the changes, but I'm getting this error- "Error: Unable to load FotoBuzz data from fotobuzz.php".  One question I had was where exactly to add the lines to scripts.js -  is it at the very end of the file, or before the { ?  I've tried both ways with no difference.

Thanks for any help,

N704FN
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on February 10, 2005, 09:47:18 am
Hi,
I did a quick check on your website...didn't find all of the files needed.
did you put thoses ones too? :

atomparser.inc
fbjfif.inc
fotobuzzxml.inc
utility.inc

-matt-
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: n704fn on February 10, 2005, 06:13:29 pm
Hi Matt,

yeah, I restored the original files last night after I couldn't get it to work properly.  I have all the changes back in place now if you have a chance to check it out.

Thanks

Mark

EDIT:  Just talked to the wife at work and she is only seeing the regular images- none of the fotobuzz stuff appears.
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on February 10, 2005, 06:28:38 pm
Mark
i sent you a pm about the ".inc" files that i don't see at your coppermine root directory,

and it looks like you didn't do step 3/ (4 lines to add in script.js ), or maybe you add them somewhere else?

-matt-
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on February 10, 2005, 06:46:43 pm
when i go to http://www.thisisyoursite.com/cpg132/atomparser.inc --> page cannot be found

as well as with utility.inc, fbjfif.inc and fotobuzzxml.inc

You sure you installed those files?
-matt-
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: nol33t on February 10, 2005, 09:45:09 pm
after some pm with n704fn: those ".inc" files are php files, if you run a windows server, make sure the ".inc" extension is handled as the ".php" one
don't know much about windows server configuration, but here is a link that could help: http://www.visualwin.com/PHP/

-matt-
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: jimge on August 09, 2005, 09:05:24 pm
Has anyone succeed to implement FotoBuzz (Viewlet 0.2) to CPG 1.4?

I manage to add successfully until I tried to modify fotobuzz.php for user rights.
Only solution for me seems to be allow commenting for all visitors  ???

BR,
jimge
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Joachim Müller on August 09, 2005, 11:45:56 pm
cpg1.4.x goes unsupported...
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: reallove on June 28, 2006, 06:12:06 pm
Since coppermine 1.4.x is now stable,can someone re-write the steps for this hack to work on 1.4.8 ?
In displayimage.php I can't find any of the lines told to modify for example...
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: beingjenn on September 18, 2006, 11:39:01 pm
I've managed to get this working (to the person above me; instead of editing displayimage.php you need to edit themes.inc.php, which is located in the /include folder), but only to a certain point.
The photo shows up. The flash shows up. I can click the button to add the comment, and then type out the comment. But it won't save. A blank note bubble with an alt of "..." pops up for a second, then disappears.

I have done all of the file editing, and as far as I know everything is chmodded properly.

Does anyone have any suggestions?
Title: Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
Post by: Joachim Müller on September 19, 2006, 08:40:33 am
instead of editing displayimage.php you need to edit themes.inc.php, which is located in the /include folder)
No, that's entirely wrong. You msutn't edit themes.inc.php, under no circumstances. Edit themes/yourtheme/theme.php instead. If the code that you're trying to modify doesn't exist in that file, copy the corresponding section from themes/sample/theme.php first.
However, this thread is clearly labelled to be for cpg1.3.x - you mustn't ask porting questions here, see Don't ask for other versions (http://forum.coppermine-gallery.net/index.php?topic=24540.0).
The user who originally posted this hack hasn't been around for months, so there is little use in trying to get support here. Support for cpg1.3.x is running out soon anyway. Locking this thread now.