Spamkill? More like Spambruise

Register an Account
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 03-19-2008, 09:43 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
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, 12:31 PM
New Pligger
Pligg Version: 9.9
Pligg Template: coolwater
 
Join Date: Feb 2007
Location: Atlanta, GA
Posts: 11
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.
Reply With Quote
  #13 (permalink)  
Old 03-20-2008, 10:40 AM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 784
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, 07:01 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
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
  #15 (permalink)  
Old 02-16-2009, 07:27 AM
New Pligger
 
Join Date: Feb 2008
Posts: 19
Hello

i try to install this mod in Plig 1.0, but when i click "Yes", i get this message: The page you were looking for doesn't exist!
Reply With Quote
  #16 (permalink)  
Old 02-16-2009, 09:18 AM
New Pligger
Pligg Version: 9.9
Pligg Template: coolwater
 
Join Date: Feb 2007
Location: Atlanta, GA
Posts: 11
This mod is coded for Pligg 9.9.0 beta. It may no longer work in Pligg 1.0 due to database changes, or page structure changes. I have not verified this as I have not looked at the Pligg 1.0 code yet.
Reply With Quote
  #17 (permalink)  
Old 02-16-2009, 02:23 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
Adding some bits of this code to Pligg 1.0 RC2 so that it will.
Added the following to admin_users.php:
Code:
                    $db->query('DELETE FROM `' . table_votes . '` WHERE `vote_user_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_saved_links . '` WHERE `saved_user_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_trackbacks . '` WHERE `trackback_user_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_friends . '` WHERE `friend_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_messages . '` WHERE `sender` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_messages . '` WHERE `receiver` = "'.sanitize($_GET["id"], 3).'"');

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #18 (permalink)  
Old 02-17-2009, 11:09 AM
New Pligger
 
Join Date: Feb 2008
Posts: 19
sorry, i modify code in admin_users.php but still get erro

Here is the code i use:

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_votes . '` WHERE `vote_user_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_saved_links . '` WHERE `saved_user_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_trackbacks . '` WHERE `trackback_user_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_friends . '` WHERE `friend_id` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_messages . '` WHERE `sender` = "'.sanitize($_GET["id"], 3).'"');
                    $db->query('DELETE FROM `' . table_messages . '` WHERE `receiver` = "'.sanitize($_GET["id"], 3).'"');

                
                // 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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg 9.0 Unable to Disable or SpamKill User oddnews Questions and Comments 3 12-26-2006 02:02 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development