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: critical error, when using Modpack with SMF 1.1.1  (Read 6436 times)

0 Members and 1 Guest are viewing this topic.

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
critical error, when using Modpack with SMF 1.1.1
« on: January 15, 2007, 12:39:41 am »

This is a fresh install of coppermine

I have coppermine (1.4.10) with modpack 1.4.10 v1 (stable)

Using SMF 1.1.1

Coppermine is bridged with SMF.

All was working ok with coppermine so then I installed the modpack.

SMF and Coppermine are in the same database (In case this is a clue).

I have watermark turned on.

When clicking on a thumbnail to bring up intermediate picture I receive this error:

Code: [Select]
While executing query "SELECT c.msg_id, c.msg_author, c.msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, c.author_id, c.author_md5_id, c.msg_raw_ip, c.msg_hdr_ip, c.pid, u.avatar AS avatar_url FROM cpg1410_comments AS c LEFT JOIN `richbono_smf`.smf_members AS u ON c.author_id=u.ID_MEMBER WHERE pid='16' ORDER BY c.msg_id ASC" on Resource id #25

mySQL error: No database selected

If I disable the bridge then this error does not occur.

I'll PM stramm with URL and test account details.
Logged

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #1 on: January 15, 2007, 12:45:53 am »

I forgot to enter this, but couldn't edit my post:


File: .../include/functions.inc.php - Line: 248

edited by request
« Last Edit: January 15, 2007, 03:26:06 pm by Stramm »
Logged

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #2 on: January 15, 2007, 12:53:16 am »

More hints,

the following from: http://forum.coppermine-gallery.net/index.php?topic=29153.msg135084#msg135084 seems to work around the critical error

Quote
a quick fix would be to look for

Code: [Select]
$result = $cpg_udb->get_comments($pid, $comment_sort_order);
in themes.inc.php and replace it with

Code: [Select]
    $result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");


Seems to solve the critical error
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #3 on: January 15, 2007, 04:30:07 pm »

yes, I know. That piece of code has been implemented into the modpack since version 1.4.8 and CPG should auto detect if tables can be joined. Strange thing is, that it should be possible in your setup (smf and cpg tables in the same db). However the error message proves different. If you add mentioned code, you basically disable joins for that query and use the slower but failproof method.

The next days I'm going to install SMF/ CPG the way you did and see if I can reproduce that error (I doubt cause I have an older version running that way, and phpbb too). But we'll see

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #4 on: January 15, 2007, 05:20:11 pm »

Thanks so much for looking into this.

Do you still need my system setup to reproduce this error?  If not, I'd like to install the workaround code (as shown) until you get back to me so I can continue to work on some other issues (like xp_publish.php login feature not working).
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #5 on: January 15, 2007, 05:30:31 pm »

nope ;)
please add the fix and continue setting up your gallery

Thanks for reporting your issue

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #6 on: January 15, 2007, 05:32:01 pm »

Will I need any of the other 'fixes' from this :http://forum.coppermine-gallery.net/index.php?topic=29153.msg135084#msg135084

Thanks again for your time. Let me know if I need to do anything else to help you.
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #7 on: January 15, 2007, 05:39:25 pm »

if you do not need avatars in comments... no
otherwise that should work (but untested)
in themes.inc.php find

Code: [Select]
//check joins
if($cpg_udb->can_join()){
if ($CONFIG['enable_avatar']){
        ($row['avatar_url'] != "") ? $avatar_url= "<img src='".AVATAR_PATH.$row["avatar_url"]."' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
}
else $avatar_url="";
} else { // only used when tables can't be joined... then we need to query for the avatar URL -> function get_avatar
if ($CONFIG['enable_avatar']){
$result2 = $cpg_udb->get_avatar($row['author_id']);
$avatar_url= preg_replace('/\/\//','/',AVATAR_PATH.$result2["avatar_url"]);
        ($result2['avatar_url'] != "") ? $avatar_url= "<img src='".$avatar_url."' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
}
else $avatar_url="";
}
and replace with
Code: [Select]
//check joins
if ($CONFIG['enable_avatar']){
$result2 = $cpg_udb->get_avatar($row['author_id']);
$avatar_url= preg_replace('/\/\//','/',AVATAR_PATH.$result2["avatar_url"]);
        ($result2['avatar_url'] != "") ? $avatar_url= "<img src='".$avatar_url."' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
}
else $avatar_url="";

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #8 on: January 16, 2007, 08:12:13 pm »

Stramm,

I don't know if you're going to believe this or not.

Since my site was new, I decided to clean up my install a bit by changing to a separate database for SMF and Coppermine.

So I reinstalled all of coppermine from the start, creating a new database (deleting the tables which were in the smf database). Then re-installing your modpack.

I don't know if I should say "I'm happy to report" or not, but this problem now does NOT exist. So it appears to be caused by something when Coppermine and SMF share the same database.  I can't explain why, but I thought I should report this to you.

These are 'hot off the press' results, so I'm going to continue testing with your modpack features and be sure that this problem doesn't crop up again.

Thanks again for your help and for providing / supporting your modpack!
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: critical error, when using Modpack with SMF 1.1.1
« Reply #9 on: January 16, 2007, 08:53:09 pm »

Thanks for reporting this... I'll nevertheless will have a look at that issue
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.