Stramm ModPack and 1414 Stramm ModPack and 1414
 

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]

Main Menu

Stramm ModPack and 1414

Started by Gephri, December 03, 2007, 09:44:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gephri

I'm getting an error message when I try to view comments for an image.

It reads:
"Fatal error: Call to undefined method phpbb2018_udb::get_comments() in /home/students/public_html/gallery/include/themes.inc.php on line 2457"

The line in error is below... $result = $cpg_udb->get_comments($pid, $comment_sort_order);

    if ($CONFIG['comments_sort_descending'] == 1) {
        $comment_sort_order = 'DESC';
    } else {
        $comment_sort_order = 'ASC';
    }
    //$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, avatar_url FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");

$result = $cpg_udb->get_comments($pid, $comment_sort_order);

    while ($row = mysql_fetch_array($result)) {
        $user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
        $comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo : '';


Any idea why the error?

Nibbler

Did you upload the new bridge/udb_base.inc.php from the modpack?

Gephri

Nibbler - I confirmed the bridge/udb_base.inc.php is the latest version and reran update.php.

I can now see comments box - but when I try to post a comment I get:
"Fatal error: Call to undefined method phpbb2018_udb::get_auto_subscribe_comment() in /home/students/public_html/gallery/db_input.php on line 175"

which points me to the following line:
$auto_subscribe_comment = $cpg_udb->get_auto_subscribe_comment($user_id);
if ($CONFIG['enable_user_notification'])
{
$auto_subscribe_comment = $cpg_udb->get_auto_subscribe_comment($user_id);
if ($auto_subscribe_comment['auto_subscribe_comment'])
{
$result2 = cpg_db_query("SELECT 1 FROM {$CONFIG['TABLE_NOTIFY']} WHERE user_id='".(USER_ID)."' AND picture_id='".$pid."'");

Nibbler

Make sure get_auto_subscribe_comment is defined in udb_base.inc.php. If it isn't then you don't have the right version.

Gephri

You're right.  Am using the latest 1414 version of udb_base.inc.php and it does not have get_auto_subscribe_comment. 
But when I overwrite it with with yours I get a page that says - with no explanation... "Fatal error :"

I've done a code comparison with WinMerge and here are the differences between 1414 and 1414 Stramm versions - perhaps you could tell me what is locking up:
1414
                                $sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, ug.{$f['usertbl_group_id']} AS group_id ".
                                           "FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
                                           "WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
                        } else {
                                $sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['usertbl_group_id']}+100 AS group_id ".

1414Starmm
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['avatar_url']} AS avatar_url, u.{$f['notify']} AS notify, u.{$f['auto_subscribe_post']} AS auto_subscribe_post, u.{$f['auto_subscribe_comment']} AS auto_subscribe_comment, ug.{$f['usertbl_group_id']} AS group_id ".
                                           "FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
                                           "WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
                        } else {
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['avatar_url']} AS avatar_url, u.{$f['notify']} AS notify, u.{$f['auto_subscribe_post']} AS auto_subscribe_post, u.{$f['auto_subscribe_comment']} AS auto_subscribe_comment, u.{$f['usertbl_group_id']}+100 AS group_id ".


1414
(no code)

1414 Stramm
        define('AVATAR_URL', $row['avatar_url']);


1414
                                                                                {$this->field['website']} AS user_website


1414 Stramm
                                                                                {$this->field['website']} AS user_website,
{$this->field['user_id']} AS user_id,
{$this->field['notify']} AS notify,
{$this->field['avatar_url']} AS avatar_url


1414
(no code)

1414 Stramm


// Get buddy info
function get_buddy_infos($view,$sql2)
{
        global $CONFIG;
if ($this->can_join_tables) {
if($view=="1") $sql = "SELECT id, buddy_block, buddy_id, since, u.{$this->field['username']} as buddy_name, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_BUDDY']} as b LEFT JOIN {$this->usertable} as u on b.buddy_id=u.{$this->field['user_id']} WHERE b.user_id=".(USER_ID)." AND buddy_block='YES' ";
if($view=="2") $sql = "SELECT id, since, u.{$this->field['username']} as buddy_name, buddy_from as buddy_id, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_BUDDY_REQ']} as b LEFT JOIN {$this->usertable} as u on b.buddy_from=u.{$this->field['user_id']} WHERE b.buddy_to=".(USER_ID)." ";
if($view=="3") $sql = "SELECT id, since, u.{$this->field['username']} as buddy_name, buddy_to as buddy_id, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_BUDDY_REQ']} as b LEFT JOIN {$this->usertable} as u on b.buddy_to=u.{$this->field['user_id']} WHERE b.buddy_from=".(USER_ID)." ";
if($view=="0") $sql = "SELECT id, buddy_ok, buddy_block, buddy_id, since, u.{$this->field['avatar_url']} AS avatar_url, u.{$this->field['username']} as buddy_name FROM {$CONFIG['TABLE_BUDDY']} as b LEFT JOIN {$this->usertable} as u on b.buddy_id=u.{$this->field['user_id']} WHERE buddy_ok='YES' AND b.user_id = ".(USER_ID)." ";
$sql .= $sql2;

$result = cpg_db_query($sql, $this->link_id);

return $result;
} else {
if($view=="1") $sql = "SELECT id, buddy_block, buddy_id, since FROM {$CONFIG['TABLE_BUDDY']} WHERE user_id=".(USER_ID)." AND buddy_block='YES' ";
if($view=="2") $sql = "SELECT id, since, buddy_from as buddy_id FROM {$CONFIG['TABLE_BUDDY_REQ']} WHERE buddy_to=".(USER_ID)." ";
if($view=="3") $sql = "SELECT id, since, buddy_to as buddy_id FROM {$CONFIG['TABLE_BUDDY_REQ']} WHERE buddy_from=".(USER_ID)." ";
if($view=="0") $sql = "SELECT id, buddy_ok, buddy_block, buddy_id, since FROM {$CONFIG['TABLE_BUDDY']} WHERE buddy_ok='YES' AND user_id = ".(USER_ID)." "; $sql .= $sql2;

$result = cpg_db_query($sql);
return $result;

}
}


function get_auto_subscribe_comment($uid)
{
$sql = "SELECT *, {$this->field['auto_subscribe_comment']} AS auto_subscribe_comment FROM {$this->usertable} WHERE {$this->field['user_id']} = '$uid'";

$result = cpg_db_query($sql, $this->link_id);
$user_data = mysql_fetch_array($result);
mysql_free_result($result);

return $user_data;
}
function get_auto_subscribe_post($uid)
{
$sql = "SELECT *, {$this->field['auto_subscribe_post']} AS auto_subscribe_post FROM {$this->usertable} WHERE {$this->field['user_id']} = '$uid'";

$result = cpg_db_query($sql, $this->link_id);
$user_data = mysql_fetch_array($result);
mysql_free_result($result);

return $user_data;
}

function get_notify_info($pid)
{
global $CONFIG;
if ($this->can_join_tables) {
$sql = "SELECT n.user_id, n.mail_sent, u.{$this->field['email']}, u.{$this->field['username']}, p.owner_id, p.owner_name, p.title, p.filename ".
" FROM {$CONFIG['TABLE_NOTIFY']} AS n INNER JOIN {$this->usertable} AS u ON n.user_id=u.{$this->field['user_id']} ".
" INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.picture_id=p.pid WHERE n.picture_id=".$pid;

$result = cpg_db_query($sql, $this->link_id);
return $result;
} else { //no join -> we do not get the username + email  and if needed we need to get it later on in another query
$sql = "SELECT n.user_id, n.mail_sent, p.owner_id, p.owner_name, p.title, p.filename ".
" FROM {$CONFIG['TABLE_NOTIFY']} AS n ".
" INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.picture_id=p.pid WHERE n.picture_id=".$pid;

$result = cpg_db_query($sql);
return $result;
}
}

function get_notify_email($id)
{
$sql = "SELECT u.{$this->field['email']}, u.{$this->field['username']} FROM {$this->usertable} AS u WHERE {$this->field['user_id']} = '$id'";

$result = cpg_db_query($sql, $this->link_id);
$user_data = mysql_fetch_array($result);
mysql_free_result($result);

return $user_data;
}

function get_comments($pid, $comment_sort_order)
{
global $CONFIG;
if ($this->can_join_tables) {
$sql = "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.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_COMMENTS']} AS c LEFT JOIN {$this->usertable} AS u ON c.author_id=u.{$this->field['user_id']} WHERE pid='$pid' ORDER BY c.msg_id $comment_sort_order";

$result = cpg_db_query($sql, $this->link_id);
return $result;
} else { //no join -> we do not get the avatar URL and if needed we need to get it later on in another query
$sql = "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 FROM {$CONFIG['TABLE_COMMENTS']} AS c WHERE pid='$pid' ORDER BY c.msg_id $comment_sort_order";

$result = cpg_db_query($sql);
return $result;
}
}

function get_avatar($id)
{
global $CONFIG;
$sql = "SELECT {$this->field['avatar_url']} AS avatar_url FROM {$this->usertable} WHERE {$this->field['user_id']}='$id'";
$result = cpg_db_query($sql, $this->link_id);
$user_data = mysql_fetch_array($result);
mysql_free_result($result);

return $user_data;
}

function get_user_avatar($id)
{
global $CONFIG;
$sql = "SELECT {$this->field['avatar_url']} AS avatar_url, {$this->field['username']} as buddy_name FROM {$this->usertable} WHERE {$this->field['user_id']}='$id'";
$result = cpg_db_query($sql, $this->link_id);
$user_data = mysql_fetch_array($result);
mysql_free_result($result);

return $user_data;
}

function can_join(){
if ($this->can_join_tables) {
return true;
} else {
return false;
}
}

function udb_info(){
return $this->field;
}

Gephri

Disregard my message above.
Here's the latest.
I've narrowed down the code that locks up when installed.
udb_base.inc.php
when the following 1414 code
                                $sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, ug.{$f['usertbl_group_id']} AS group_id ".
                                           "FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
                                           "WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
                        } else {
                                $sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['usertbl_group_id']}+100 AS group_id ".


is replaced with the 1414Stramm code
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['avatar_url']} AS avatar_url, u.{$f['notify']} AS notify, u.{$f['auto_subscribe_post']} AS auto_subscribe_post, u.{$f['auto_subscribe_comment']} AS auto_subscribe_comment, ug.{$f['usertbl_group_id']} AS group_id ".
                                           "FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
                                           "WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
                        } else {
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['avatar_url']} AS avatar_url, u.{$f['notify']} AS notify, u.{$f['auto_subscribe_post']} AS auto_subscribe_post, u.{$f['auto_subscribe_comment']} AS auto_subscribe_comment, u.{$f['usertbl_group_id']}+100 AS group_id ".

Stramm

Quote from: Gephri on December 03, 2007, 05:26:41 PM
You're right.  Am using the latest 1414 version of udb_base.inc.php and it does not have get_auto_subscribe_comment.

it has... just check the code block you posted above. If you use the modpack, then you're not supposed to replace some files with 'unmodded' files from other sources. That way it can't work cause of missing functions / methods.

Gephri

Yes Stramm, the udb_base.inc.php file slipped through by not being upgraded with the ModPack.
It is now in updated except, as noted in my previous message, for the code

$sql = "SELECT u.{$f['user_id']} AS id,....

Any ideas

Stramm

I've downloaded the modpack 1.4.14 v1 from my site and checked udb_base.inc.php... it's exactly the one it should be.

Maybe redownload a fresh version and upload to your server again

Gephri

I've redownloaded the mod and still get the same Fatal Error from the following code in udb_base.inc.php


$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['avatar_url']} AS avatar_url, u.{$f['notify']} AS notify, u.{$f['auto_subscribe_post']} AS auto_subscribe_post, u.{$f['auto_subscribe_comment']} AS auto_subscribe_comment, ug.{$f['usertbl_group_id']} AS group_id ".
                                           "FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
                                           "WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
                        } else {
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['avatar_url']} AS avatar_url, u.{$f['notify']} AS notify, u.{$f['auto_subscribe_post']} AS auto_subscribe_post, u.{$f['auto_subscribe_comment']} AS auto_subscribe_comment, u.{$f['usertbl_group_id']}+100 AS group_id ".


Can you point me towards where this code could be conflicting with code (or linking to other code) in another page... maybe?

Stramm

enable debug mode and post the actual error message

Gephri

Thanks Stramm, here's the error message that pops on db_input.php in Debug Mode after posting a comment

While executing query "SELECT *,  AS auto_subscribe_comment FROM `students_playground`.sspg_users WHERE user_id = '2'" on 0

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 auto_subscribe_comment FROM `students_playground`.sspg_users WHERE user_id = ' at line 1


File: /home/students/public_html/gallery/include/functions.inc.php - Line: 247

Let me know if you want the really long Debug Info file and or Dispaly PHP info

Nibbler

Make sure you uploaded the new copy of phpbb2018.inc.php. In fact make sure you uploaded the new copy of all the files since that seems to be your main issue here.

Gephri

will do.
thanks for sticking with me through this

Gephri

Unable to submit comments any longer.  My CPG is config's so members-only can make comments.  When logged in, a member can type into the comment field for a pic - but after hitting enter it triggers the following code for the db_input.php page.
if (defined('DB_INPUT_PHP')) $lang_db_input_php = array(
  'empty_name_or_com' => 'You need to type your name and a comment',


My comment coding on db_input.php is exactly like the CPG current version along with the Stramm v1.4.16

what could be triggering this inability to post comments, please.

Stramm

Please start a new thread for new questions... make sure you do not forget to post a link to your gallery and, if needed, a login.