vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Mass Deletion of Users... (https://vborg.vbsupport.ru/showthread.php?t=7306)

01-28-2001 12:13 AM

is this possible?
So you could delete all users with 0 or 0-3 etc posts...
i really need this..

01-28-2001 12:52 AM

Code:

<?

require("admin/config.php");

if($action=="") {

    print("<form action=\"delete.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"deleteusers\"><p>Delete users with less than <input type=\"text\" size=\"5\" name=\"numberposts\"> posts.</p><p><input type=\"submit\" value=\"DELETE USERS\"></form>");
}

if($action==deleteusers) {

    $query = mysql_query("DELETE from USER where POSTS < '$numberposts'");

    print("You have successfully deleted all users with less than $numberposts posts.")
}
?>

Put that into a file called delete.php and stick it in your forums directory. There is no error checking in it or anything like that, but it should do the basic thing you're looking for.

HTH, or at least sets you in the right direction.

-jim

01-28-2001 02:36 AM

thanks alot :)

01-28-2001 12:10 PM

it doesn't work..
i pu it in the /admin directory and changed
Code:

require("admin/config.php");
to
Code:

require("config.php");
does it matter anything what directory it's in?

01-28-2001 03:36 PM

Jim, you forgot to connect to MySQL. :)

[code]<?php

require("global.php");

if($action=="") {

print("<form action=\"delete.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"deleteusers\"><p>Delete users with less than <input type=\"text\" size=\"5\" name=\"numberposts\"> posts.</p><p><input type=\"submit\" value=\"DELETE USERS\"></form>");
}

if($action==deleteusers) {

$DB_site->query("DELETE FROM user WHERE posts < '$numberposts'");

print("You have successfully deleted all users with less than $numberposts posts.")
}
?>

01-28-2001 06:59 PM

Quote:

Originally posted by Ed Sullivan
Jim, you forgot to connect to MySQL. :)
Yeah I realized that - was just coming back to fix.

-jim

02-11-2001 10:16 AM

can you please post the whole text for delete.php ?!

PLEASE!!!!

02-11-2001 10:30 AM

this is the code:
Code:

<?php

require("global.php");

if($action=="") {

print("<form action=\"delete.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"deleteusers\"><p>Delete users with less than <input type=\"text\" size=\"5\" name=\"numberposts\"> posts.</p><p><input type=\"submit\" value=\"DELETE USERS\"></form>");
}

if($action==deleteusers) {

$DB_site->query("DELETE FROM user WHERE posts < '$numberposts'");

print("You have successfully deleted all users with less than $numberposts posts.")
}
?>


02-11-2001 10:56 AM

i've tried that but it doesn't work~~~~

02-11-2001 05:17 PM

The quick way:

Just run this query in PHPMyAdmin:

DELETE FROM user WHERE posts < 4

or whatever number of posts you like.

02-11-2001 06:12 PM

Do you realize that you're now also deleting members who just have registered?

02-11-2001 06:40 PM

its smarter do it by last time posted ;)

02-12-2001 01:31 PM

Then you should do it like this:

delete from user WHERE POSTS = 0 AND lastpost<UNIX_TIMESTAMP('2001-02-01')

or any other date in y-m-d format.

Instead of lastpost you could use lastvisit or lastactivity as well to not delete any silent readers.

03-25-2001 05:43 AM

Quote:

Originally posted by Fryzid
Then you should do it like this:

delete from user WHERE POSTS = 0 AND lastpost<UNIX_TIMESTAMP('2001-02-01')

or any other date in y-m-d format.

Instead of lastpost you could use lastvisit or lastactivity as well to not delete any silent readers.

how do i do that?? what's phpadvmin?

03-25-2001 07:52 AM

Quote:

Originally posted by CGiFORCE
is this possible?
So you could delete all users with 0 or 0-3 etc posts...
i really need this..

i made a fully working hack of this ages ago

http://vbulletin.com/forum/showthrea...threadid=10108

if you download it jsut put a reply to that thread


All times are GMT. The time now is 07:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01152 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete