Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )  (Read 40780 times)

0 Members and 1 Guest are viewing this topic.

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics

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  ::))
« Last Edit: February 14, 2005, 06:26:29 am by GauGau »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #1 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #2 on: December 18, 2004, 11:55:00 am »

same here no pic in Mozilla / Firefox
Logged
SANIsoft PHP applications for E Biz

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #3 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 ;)
« Last Edit: December 18, 2004, 04:24:36 pm by nol33t »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #4 on: December 18, 2004, 01:20:22 pm »

My firefox is also 1.0 (not the pr)
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #5 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

-chicobra-

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #6 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 !!!  ::)
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #7 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #8 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

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #9 on: December 18, 2004, 05:25:04 pm »

Not my browser, I see that site fine;
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #10 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.. ;)

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #11 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..

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #12 on: December 18, 2004, 06:06:10 pm »

Works fine now  ;)

looks good btw.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #13 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

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #14 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)
« Last Edit: October 31, 2005, 08:40:29 am by TranzNDance »
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #15 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 :)

n704fn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #16 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
Logged
(http://www.thechouinards.com/cfetch/cfig_random.php)

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #17 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-

n704fn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #18 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.
« Last Edit: February 10, 2005, 06:34:30 pm by n704fn »
Logged
(http://www.thechouinards.com/cfetch/cfig_random.php)

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [HACK] Integrating FotoBuzz into CPG ( put Comments ON the pictures )
« Reply #19 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-
Pages: [1] 2   Go Up
 

Page created in 0.146 seconds with 20 queries.