Go Back   Pligg CMS Forum > Pligg Help > General Help

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-19-2008, 07:43 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,073
Thanks: 53
Thanked 25 Times in 23 Posts
If you want to delete also the votes of the spammer, use this code (inspired by rossooline, http://forums.pligg.com/general-help...ml#post52705):

Step 1: admin_users.php
Find the function called "yeskillspam" (around line 313) and follow it down to where it ends (around line 343) and insert the following code:
PHP Code:
//////////////////////////////////// NEW KILL SPAM //////////////////////////////////////////
        
if ($_GET["mode"] == "yeskillspam2"){ // killspam step 2
            
$user$db->get_row('SELECT * FROM ' table_users .' where user_login="'.$_GET["user"].'"');
            
            
canIChangeUser($user->user_level);
            
            if (
$user) {
                
                
$db->query('DELETE FROM `' table_users '` WHERE `user_id` = "'.$_GET["id"].'"');
                
$db->query('DELETE FROM `' table_links '` WHERE `link_author` = "'.$_GET["id"].'"');
                
$db->query('DELETE FROM `' table_comments '` WHERE `comment_user_id` = "'.$_GET["id"].'"');

//Delete the votes
$db->query('DELETE FROM `' table_votes '` WHERE `vote_user_id` = "'.$_GET["id"].'"');

                
                
// breadcrumbs and page title
                
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
                
$navwhere['link1'] = getmyurl('admin''');
                
$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_1');
                
$navwhere['link2'] = my_pligg_base "/admin_users.php";
                
$navwhere['text3'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_User_Disable_2');
                
$main_smarty->assign('navbar_where'$navwhere);
                
$main_smarty->assign('posttitle'" / " $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
                
                
// pagename
                
define('pagename''admin_users'); 
                
$main_smarty->assign('pagename'pagename);

                
header("Location: ".my_pligg_base."/admin_users.php");
                
                
            }
            else{
showmyerror('userdoesntexist');}
            
        }
/////////////////////////////////// END New KILL SPAM //////////////////////////////////// 
Reply With Quote
  #12 (permalink)  
Old 03-19-2008, 10:31 AM
New Pligger
Pligg Version: 9.9
Pligg Template: coolwater
 
Join Date: Feb 2007
Location: Atlanta, GA
Posts: 22
Thanks: 1
Thanked 5 Times in 5 Posts
Thumbs up

Here are the queries I have added to my "yeskillspam" section of admin_users.php. It fully removes the user from every trace of the database.

I replaced:

PHP Code:
$db->query('UPDATE `' table_users '` SET `user_pass` = "63205e60098a9758101eeff9df0912ccaaca6fca3e50cdce3" WHERE `user_login` = "'.$_GET["user"].'"');
$db->query('UPDATE `' table_users '` SET `user_email` = "blank@blank.com" WHERE `user_login` = "'.$_GET["user"].'"');
$db->query('UPDATE `' table_links '` SET `link_status` = "discard" WHERE `link_author` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_comments '` WHERE `comment_user_id` = "'.$_GET["id"].'"'); 
with:

PHP Code:
//New Code to Truly Kill the User
$db->query('DELETE FROM `' table_votes '` WHERE `vote_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_saved_links '` WHERE `saved_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_trackbacks '` WHERE `trackback_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_friends '` WHERE `friend_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_messages '` WHERE `sender` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_messages '` WHERE `receiver` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_pageviews '` WHERE `pv_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_comments '` WHERE `comment_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_links '` WHERE `link_author` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_users '` WHERE `user_id` = "'.$_GET["id"].'"'); 
I have tested this code both on a local installation and a live installation and have seen no issues after killspaming a user.
__________________
Pligg Site: www.NewsHeat.com
Slogan: Where The Campaign Trails Meet
Pligg Version: beta v9.9 (updated since 9.1)
Template: Modified "coolwater"
Other Sites: Cheesy Movie Night, Tranquil Aggression
Reply With Quote
The Following User Says Thank You to NewsHeatDotCom For This Useful Post:
  #13 (permalink)  
Old 03-20-2008, 08:40 AM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 917
Thanks: 171
Thanked 17 Times in 17 Posts
Nice work guys! This is all too cool and what do you know... a little common sense!

Great work! 100%
Reply With Quote
  #14 (permalink)  
Old 03-20-2008, 05:01 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,073
Thanks: 53
Thanked 25 Times in 23 Posts
Quote:
Originally Posted by NewsHeatDotCom View Post
PHP Code:
//New Code to Truly Kill the User
$db->query('DELETE FROM `' table_votes '` WHERE `vote_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_saved_links '` WHERE `saved_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_trackbacks '` WHERE `trackback_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_friends '` WHERE `friend_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_messages '` WHERE `sender` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_messages '` WHERE `receiver` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_pageviews '` WHERE `pv_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_comments '` WHERE `comment_user_id` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_links '` WHERE `link_author` = "'.$_GET["id"].'"');
$db->query('DELETE FROM `' table_users '` WHERE `user_id` = "'.$_GET["id"].'"'); 
I guess no one ever thought about this relations :) By the way: Does trackback work at your installation?

Furthermore, I would prefer to see the pageview information at the summary pages next to age, author and so on. By this, all relevant information would be in one spot. Do you see any change to realize it, at least IF this story has been visited?
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg 9.0 Unable to Disable or SpamKill User oddnews Bug Report 3 12-26-2006 12:02 PM


Search Engine Friendly URLs by vBSEO 3.2.0