whoami24
02-08-2010, 10:32 PM
Hi,
I'm trying to do the exact same thing inlinemod.php does in v4 (permanently ban users, move them to "Banned Users" group and prune all of their posts & threads) but as SQL query so that I can manually insert the userid's.
REPLACE INTO userban
(userban.userid, userban.usergroupid, userban.displaygroupid, userban.usertitle, userban.customtitle, userban.adminid, userban.bandate, userban.liftdate, userban.reason)
SELECT userid AS userid, usergroupid AS usergroupid, displaygroupid AS displaygroupid, usertitle AS usertitle, customtitle AS customtitle, 1 AS adminid, 1265328000 AS bandate, 0 AS liftdate, 'Spam' AS reason FROM user WHERE userid IN(___USERID___);
UPDATE user SET usergroupid = 8 WHERE userid IN(___USERID___);
DELETE FROM post WHERE userid IN (___USERID___);
DELETE FROM thread WHERE postuserid IN (___USERID___);
Should that work fine or did I miss something here?
I'm trying to do the exact same thing inlinemod.php does in v4 (permanently ban users, move them to "Banned Users" group and prune all of their posts & threads) but as SQL query so that I can manually insert the userid's.
REPLACE INTO userban
(userban.userid, userban.usergroupid, userban.displaygroupid, userban.usertitle, userban.customtitle, userban.adminid, userban.bandate, userban.liftdate, userban.reason)
SELECT userid AS userid, usergroupid AS usergroupid, displaygroupid AS displaygroupid, usertitle AS usertitle, customtitle AS customtitle, 1 AS adminid, 1265328000 AS bandate, 0 AS liftdate, 'Spam' AS reason FROM user WHERE userid IN(___USERID___);
UPDATE user SET usergroupid = 8 WHERE userid IN(___USERID___);
DELETE FROM post WHERE userid IN (___USERID___);
DELETE FROM thread WHERE postuserid IN (___USERID___);
Should that work fine or did I miss something here?