forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: bitcloud on September 24, 2008, 12:18:40 pm

Title: bug: buddy_manage.php - deleted users showing as ghost buddies
Post by: bitcloud on September 24, 2008, 12:18:40 pm
Hi Stramm... others...

I have a lot of deleted users on my gallery. This means that there are some users who were "buddies" with others, but are now deleted.
In buddy_manage.php it shows up no username, just the text "offline" for where these users used to be.

I'm not sure if this bug has been addressed, but it should be a matter of changing a CPG db query somewhere to check if a user exists before returning a buddy result. (and potentially the delete user file should be updated for this mod)

Thanks in advance for any help on what to change to correct this
Title: Re: bug: buddy_manage.php - deleted users showing as ghost buddies
Post by: Stramm on September 24, 2008, 02:00:50 pm
hmm.. yes, the buddy table needs an update when a user gets deleted.
Title: Re: bug: buddy_manage.php - deleted users showing as ghost buddies
Post by: bitcloud on September 24, 2008, 03:26:17 pm
Thanks for the quick response...

in the mean time, can you think of which queries I should look toward modifying so that buddies only get called up if they're existing users?
Title: Re: bug: buddy_manage.php - deleted users showing as ghost buddies
Post by: Stramm on September 24, 2008, 03:41:03 pm
That's not the way I'm going to fix it. To clean the buddy table you either nedd to check each entry manually or write a lil script that'll do that for you.
Title: Re: bug: buddy_manage.php - deleted users showing as ghost buddies
Post by: bitcloud on September 25, 2008, 04:54:10 am
ok... I might do a hacky edit on the delete user file, and do what you say.. write a script to clean the buddy list..

Cheers for the advice :)
Title: Re: bug: buddy_manage.php - deleted users showing as ghost buddies
Post by: bitcloud on September 26, 2008, 12:46:34 am
Strangely enough I found these lines:

//Delete Notifications
//Cleanup buddy tables

In delete.php. Not sure if they are your mods or mine (probably yours)
I can't duplicate the orphaned buddy entries when deleting anymore, so I'm not sure how all these orphaned/deleted buddies came about.

Anyway, to clean up the buddy table (if anyone else experiences this), I plugged this into phpmyadmin:
Code: [Select]
DELETE FROM `cpg1410_buddy` where user_id not in (select user_id from `cpg1410_users`)
and:

Code: [Select]
DELETE FROM `cpg1410_buddy` where buddy_id not in (select user_id from `cpg1410_users`)(replacing cpg1410 with whatever your version)