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]   Go Down

Author Topic: [cpg1.4.x]: Critical Avatar / Comment Error - Bridged with Phpbb  (Read 11078 times)

0 Members and 1 Guest are viewing this topic.

WinterWulf

  • Coppermine newbie
  • Offline Offline
  • Posts: 6

Hello,
First I would like to thank Stramm for making such a lovely mod - just having the option to turn off all of the extra statistics and speed up my gallery is  enough to use it! But now, down to business:

Problem:
  • I get a critical error when I try to comment on a picture.
  • I get a critical error when I try to view a picture that has a comment.

What I use:
Workaround:
  • Disabling user avatars (Mini Thumbs Required)


DeBuging data:


On trying to comment"
Code: [Select]
While executing query "SELECT  AS avatar_url FROM `MySQL_Databasename`.users WHERE user_id='2'" on Resource id #16

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
 syntax to use near 'AS avatar_url FROM `MySQL_Databasename`.users WHERE user_id='2'' at line 1

On trying to view the same image I commented on with the same account:
Code: [Select]
While executing query "SELECT  AS avatar_url FROM `MySQL_Databasename`.users WHERE user_id='2'" on Resource id #16

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near 'AS avatar_url FROM `MySQL_Databasename`.users WHERE user_id='2'' at line 1


Additional Notes and Thoughts:


Mini Tabs enabled?Yes
Mini Tabs set to the same size as avatars in PhpBB?Yes
Any problems in the past with Stephen's Bridge, Coppermine or PhpBB?      No
PhpBB file for avatars:images/avatars/upload
PhpBB file for avatar galleryimages/avatars/gallery

I am thinking that coppermine is having a hard time finding the file with the avatars in it. It may be easyier (less coding) to make it one of coppermine's albums since PhpBB already has a form I can change the paths in. Another benifit would be allowing members to contribute to the usable avatar gallery. However, coppermine seems to store images in files based on their users not on which album they are in; thus this method may actualy take longer to implement.

Thank you very much for your time
« Last Edit: September 15, 2008, 08:26:54 am by Stramm »
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #1 on: August 23, 2008, 09:12:16 am »

phpbb 3.x isn't supported yet... there's no bridge file modded to work together with the modpack so as with each other not compatible bridge you'll get a fatal error. With some effort it shouldn't be a problem to adapt the bridge. In other threads I've written what you need to do. 

WinterWulf

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #2 on: August 23, 2008, 07:34:43 pm »

I spent about 4 hours yesterday searching around this forum and the PhpBB forum for a fix. I implemented a few simple changes (like re-loading some files) but they didn't help. However, 4 hours of searching does make one tired so it is quite possible that I missed something. I also didn't pay much attention to the threads about gallerys bridged with SMF (since I am using PhpBB); however those might be exactly what I am looking for since they seem to deal with changing paths.

*Takes out a large meat clever* I backed up my files again yesterday, and I have a bit of time today - I might as well hack up some code and see what happens. *Snaps on a surgeon's mask* Yes, I have done this opperation many times before, Mr.Code, with Java, Javascript, LSL and more- even some Ruby. Er, well, no I don't have any experiance with MySQL or Php or much with databases - yes, I am sure this is a good idea, Mr.Code! Yes, I do sort of know what I'm doing! *Takes out an anesthesia mask* Don't worry Mr.Code, if anything goes too horribly wrong, we can always undo it.


What will happen to Mr.Code? Will they make him stronger, faster and smarter than before, gentlemen? Will we find out that his surgeon is an artist, not a doctor, Jim? Will there be more corny plays on quotes? Tune in next time to find out!


P.S. even though they aren't tecnicaly compatible they do work rather well together (in my opinion, anyways).
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #3 on: August 23, 2008, 08:28:58 pm »

Basically you use an existing bridge file that you can find in the modpack package as example (phpbb 2.x or smf 1.x). That bridge file you compare to the one from th original package. You'll see that you just need to add a few lines of code. These depend on the database layout of your forum app. Here you need to get these (and the way the app manages the avatars and the pms). Now you can start modding the bridge file for your forum app.

WinterWulf

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #4 on: September 12, 2008, 10:19:05 pm »

Toke me a while to figure this all out, (my boss had extra work for me and for some reason I didn't understand exactly what Stramm ment) but I think I am on the verge of getting this to work! Unfortunatly, I have run into my dreaded nemisis, Mr.Syntax. Having only a vague understanding of how php works, I have run out of ideas on how to tweak my code; my sidekick, Mr.Internet, isn't in a very helpful mood, either (I can't seem to find any answers there). I will continue to search and tweak but if anyone here would like to fix my handy-(read:messy)work for me (and then let me know what I did wrong so I don't do it again) I would be greatful.


Code: [Select]
define('AVATAR_PATH', $BRIDGE['relative_path_to_config_file'].'/download/file.php?avatar='.$BRIDGE['avatar_path'].'/');

This ends up giving me this link:http://www.domain.com/phpbbfile/download/file.php?avatar=/1_9999999999.gif
Instead of this link:http://www.domain.com/phpbbfile/download/file.php?avatar=1_9999999999.gif
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #5 on: September 13, 2008, 09:09:53 am »

You've hardcoded the avatar path as it looks to me, so some stuff is not necessary. That not necessary code leads to the trailing slash you don't want to have.

-> try removing
Code: [Select]
.$BRIDGE['avatar_path'].'/'
$BRIDGE['avatar_path'] is a variable that the system reads from the database. That entry is added when running the bridgemanager. However the bridgemanager needs some modifications, too. I've of course only added them for the supported bridges. The solution is what you did (hardcoding) or you'll have to use a tool like phpmyadmin to add the path to the db and then just use $BRIDGE['avatar_path']

WinterWulf

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #6 on: September 14, 2008, 11:54:23 pm »

Ah, thank you- it works perfectly now!

For use with:
How to install:

1. Open the file phpbb3.inc.php in the bridge folder
2.
Code: [Select]
                  'avatar_url' => 'user_avatar'
   );

//mod define Avatar path
define('AVATAR_PATH', $BRIDGE['relative_path_to_config_file'].'/download/file.php?avatar=');
change the /download/file.php?avatar= to the file phpbb3.0.2 acesses to load avatars (minus the relative path at the begining and the #_##########.gif part at the end) (if you don't know what file this is, go to your phpbb forum and right click on any avatar you see then click "properties" to see where it is being loaded from. The path you see will look something like this:"http://www.domain.com/phpbbfile/download/file.php?avatar=[/u]1_9999999999.gif" the part you will use is in bold and underlined).

3. Add the code after this section of code:
Code: [Select]
// Table field names
$this->field = array(
  'username' => 'username', // name of 'username' field in users table
  'user_id' => 'user_id', // name of 'id' field in users table
  'password' => 'user_password', // name of 'password' field in users table
  'email' => 'user_email', // name of 'email' field in users table
  'regdate' => 'user_regdate', // name of 'registered' field in users table
  'active' => 'user_active', // is user account active?
  'lastvisit' => 'user_lastvisit', // name of 'location' field in users table
  'location' => 'user_from', // name of 'location' field in users table
  'website' => 'user_website', // name of 'website' field in users table
  'usertbl_group_id' => 'group_id', // name of 'group id' field in users table
but before this section:
Code: [Select]
// Pages to redirect to
$this->page = array(


the code you have edited (and surrondding portions) will look something like this after you are done:

Code: [Select]
// Table field names
$this->field = array(
  'username' => 'username', // name of 'username' field in users table
  'user_id' => 'user_id', // name of 'id' field in users table
  'password' => 'user_password', // name of 'password' field in users table
  'email' => 'user_email', // name of 'email' field in users table
  'regdate' => 'user_regdate', // name of 'registered' field in users table
  'active' => 'user_active', // is user account active?
  'lastvisit' => 'user_lastvisit', // name of 'location' field in users table
  'location' => 'user_from', // name of 'location' field in users table
  'website' => 'user_website', // name of 'website' field in users table
  'usertbl_group_id' => 'group_id', // name of 'group id' field in users table
                            'avatar_url' => 'user_avatar'
   );

//mod define Avatar path
define('AVATAR_PATH', $BRIDGE['relative_path_to_config_file'].'/download/file.php?avatar=');

// Pages to redirect to
$this->page = array(

Notes:
You may have to limit users to only using avatars they upload (no using images from other sites or a gallery) but I have not tested this. Also, if you change the avatar folder that phpbb uses later, you will have to update your bridge file.


Thanks agian for all your help on getting this little mod to work, Stramm!
Logged

WinterWulf

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #7 on: September 15, 2008, 06:06:38 am »

Quote
Thanks agian for all your help on getting this little mod to work, Stramm!
And by that, I mean the help with getting my tweak to your huge modpack to work, of course.
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #8 on: September 15, 2008, 08:26:28 am »

Thanks for your work. I'm sure that's very helpful for a lot of modpack users.

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: [cpg1.4.x]: Critical Avatar / Comment Error - Bridged with Phpbb
« Reply #9 on: September 20, 2008, 07:36:07 am »

Thanks a lot! It works also for me on my bridged gallery.
Elena
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.