forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: imrich 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:
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.
-
I forgot to enter this, but couldn't edit my post:
File: .../include/functions.inc.php - Line: 248
edited by request
-
More hints,
the following from: http://forum.coppermine-gallery.net/index.php?topic=29153.msg135084#msg135084 seems to work around the critical error
a quick fix would be to look for
$result = $cpg_udb->get_comments($pid, $comment_sort_order);
in themes.inc.php and replace it with
$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
-
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
-
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).
-
nope ;)
please add the fix and continue setting up your gallery
Thanks for reporting your issue
-
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.
-
if you do not need avatars in comments... no
otherwise that should work (but untested)
in themes.inc.php find
//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
//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="";
-
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!
-
Thanks for reporting this... I'll nevertheless will have a look at that issue