Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Stramm ModPack and 1414  (Read 9681 times)

0 Members and 1 Guest are viewing this topic.

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Stramm ModPack and 1414
« on: December 03, 2007, 09:44:43 am »

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);

Code: [Select]
    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?
Logged

Nibbler

  • Guest
Re: Stramm ModPack and 1414
« Reply #1 on: December 03, 2007, 09:59:48 am »

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

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #2 on: December 03, 2007, 10:24:21 am »

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);
Code: [Select]
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."'");
Logged

Nibbler

  • Guest
Re: Stramm ModPack and 1414
« Reply #3 on: December 03, 2007, 10:50:31 am »

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.
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #4 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. 
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
Code: [Select]
                                $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
Code: [Select]
$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
Code: [Select]
(no code)
1414 Stramm
Code: [Select]
        define('AVATAR_URL', $row['avatar_url']);

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

1414 Stramm
Code: [Select]
                                                                                {$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
Code: [Select]
(no code)
1414 Stramm
Code: [Select]

// 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;
}
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #5 on: December 03, 2007, 05:48:53 pm »

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
Code: [Select]
                                $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
Code: [Select]
$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 ".
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Stramm ModPack and 1414
« Reply #6 on: December 03, 2007, 05:58:20 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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #7 on: December 03, 2007, 06:17:59 pm »

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
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Stramm ModPack and 1414
« Reply #8 on: December 03, 2007, 07:05:44 pm »

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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #9 on: December 03, 2007, 07:24:43 pm »

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

Code: [Select]
$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?
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Stramm ModPack and 1414
« Reply #10 on: December 03, 2007, 07:28:45 pm »

enable debug mode and post the actual error message

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #11 on: December 04, 2007, 07:31:57 am »

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

Code: [Select]
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
Logged

Nibbler

  • Guest
Re: Stramm ModPack and 1414
« Reply #12 on: December 04, 2007, 09:24:33 am »

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.
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1414
« Reply #13 on: December 04, 2007, 05:37:27 pm »

will do.
thanks for sticking with me through this
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Stramm ModPack and 1416
« Reply #14 on: March 06, 2008, 10:35:56 am »

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.
Code: [Select]
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.
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Stramm ModPack and 1414
« Reply #15 on: March 06, 2008, 08:08:48 pm »

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.
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.