View Full Version : How to purge user info
emery
11th April 2006, 12:38 AM
Hi. I have an affiliate that I want to re-sign up. So I deleted him, and asked him to sign up again. But, he cannot, because it tells him that the user already exists.
Is there some file I need to purge or something, so he can sign up again?
thanks,
-Emery
SteveD
12th April 2006, 08:05 PM
Copy this script into your main Post Affiliate Pro directory and name it
undelete.php or whatever. Run this script and undelete deleted affililiates. Then remove this script from your main PAP directory.
<?php
require_once('settings/settings.php');
$link = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD) or die("Can't login to the DB!");
mysql_select_db(DB_DATABASE) or die("Unable to open DB!");
if (!empty($_REQUEST['submited'])) {
if (!empty($_REQUEST['userid'])) {
$userids = "'".implode("','", $_REQUEST['userid'])."'";
$query = "update wd_g_users set deleted=0 where userid in ($userids)";
mysql_query($query, $link) or die("DB query failed!");
}
}
$query = "select userid, username from wd_g_users where deleted=1";
$results = mysql_query($query, $link) or die("DB query failed!");
mysql_close($link);
?>
<html>
<head>
<title>Affiliate undelete</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
</head>
<body>
<h2>User undelete</h2>
Refresh (aff_undelete.php)
<form action="aff_undelete.php" method="POST">
<table border="1">
<tr>
<td align="left">ID</td>
<td align="left">USERNAME</td>
</tr>
<? while ($row = mysql_fetch_assoc($results)) { ?>
<tr>
<td><input type="checkbox" name="userid[]" value="<?=$row['userid']?>"><?=$row['userid']?></td>
<td><?=$row['username']?></td>
</tr>
<? } ?>
</tr>
</table>
<input type="hidden" name="submited" value="true">
<input type="submit" value="Undelete">
</form>
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.