coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Halfhidden on May 22, 2008, 11:25:18 PM

Title: Cannot edit comments
Post by: Halfhidden on May 22, 2008, 11:25:18 PM
I had to move our coppermine site to a dedicated server and whilst we were at that we converted the back end PHPBB3 forum to SMF. all when well.... ish but we have noticed that when a comment is posted beneath a picture the user cannot edit any longer. The link is visible and in all intent and purposes the user goes through the process of the edit, but when they click ok the changes are ignored. The only option is to delete the comment and re type it..... any ideas?

Regards,
Steff
Title: Re: Cannot edit comments
Post by: Halfhidden on May 22, 2008, 11:37:05 PM
I've created a test account with limited rights:
User name: The bin pirate
Password: 123456
Gallery: www.picturepenzance.co.uk

Hope this helps?
Title: Re: Cannot edit comments
Post by: Nibbler on May 23, 2008, 12:22:53 AM
Please attach your db_input.php.
Title: Re: Cannot edit comments
Post by: Halfhidden on May 23, 2008, 12:26:17 AM
OK here it is....
Title: Re: Cannot edit comments
Post by: Nibbler on May 23, 2008, 12:30:35 AM
The comment update code in that file is all wrong. Use a clean copy or review the validity of your changes.
Title: Re: Cannot edit comments
Post by: Halfhidden on May 23, 2008, 12:33:38 AM
Ok, I'll use a clean copy.... Thanks for your help :)
Regards,
Steff
Title: Re: Cannot edit comments
Post by: Halfhidden on May 23, 2008, 12:55:53 AM
Just completed winmerge and the db_input.php is unchanged from Stramm mod pack. So the db_imput.php on my site is the same as the one in Stramm's mod pack. I guess I'll loose the mod (or part of it) if I replace db_imput with a native from 1.4.18?
I suppose I should study the differences between the modded version and the un modded version

Regards,
Steff
Title: Re: Cannot edit comments
Post by: Nibbler on May 23, 2008, 01:07:42 AM
This is the modpack:


        if (GALLERY_ADMIN_MODE) {
            $update = cpg_db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body', msg_author='$msg_author' WHERE msg_id='$msg_id'");
        } elseif (USER_ID) {
            $update = cpg_db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body' WHERE msg_id='$msg_id' AND author_id ='" . USER_ID . "' LIMIT 1");
        } else {
            $update = cpg_db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body' WHERE msg_id='$msg_id' AND author_md5_id ='{$USER['ID']}' AND author_id = '0' LIMIT 1");
        }


Which is fine.

This is what you attached:


        if (GALLERY_ADMIN_MODE) {
            $moderator_group = $_POST['moderator_group'];
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', moderator_group='$moderator_group' WHERE aid='$aid' LIMIT 1";
        } else {
            $update = cpg_db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body' WHERE msg_id='$msg_id' AND author_md5_id ='{$USER['ID']}' AND author_id = '0' LIMIT 1");
        }


Which is nonsense.
Title: Re: Cannot edit comments
Post by: Halfhidden on May 23, 2008, 01:48:36 AM
I agree it's nonsense... I only have a couple of mods that alter db_input.php  so I'll check to see what has happened. I've since downloaded the Stramm mod and you are correct the db_input.php is coded as it should..... I am puzzled because I've not done any changes that involves this file of late. And it's only recently (today) that this problem appeared.
Still the point is that I'm running a corrupt php file and I'll upload a fresh.
thanks for your help again.
Regards,
Steff