Mod Name / Version: Delete Users From Address Book Fix <br /> <br />
Description: This is a fix which will allow you to delete users from your address book when selecting them from the drop-down menu and clicking the delete button on the sendprivate.php page. <br /> <br />
Working Under: UBB.Threads 6.3 <br /> <br />
Mod Status: Finished <br /> <br />
Any pre-requisites: <br /> <br />
Author(s): Twisty <br /> <br />
Date: 09/23/04 <br /> <br />
Credits: <br /> <br />
Files Altered: sendmessage.php <br /> <br />
New Files: <br /> <br />
Database Altered: no <br /> <br />
Info/Instructions: <br /> <br />In sendmessage.php... <br /> <br />CHANGE THIS: <br /> <br />
// ------------------------------------------------------ <br />// If they selected delete the name from the address book <br /> if ($textdelete) { <br /> if ($AddressBook != $ubbt_lang['CHOOSE_ADD']) { <br /> $Deleted = addslashes($AddressBook); <br /> $query = " <br /> DELETE FROM {$config['tbprefix']}AddressBook <br /> WHERE Add_Owner = '{$user['U_Number']}' <br /> AND Add_Member = '$Deleted' <br /> "; <br /> $dbh -> do_query($query); <br /> } <br /> header("Location: {$config['phpurl']}/sendprivate.php?Cat=$Cat&PHPSESSID=$PHPSESSID"); <br /> exit(); <br /> } <br /> <br />TO THIS: <br /> <br />
// ------------------------------------------------------ <br />// If they selected delete the name from the address book <br /> if ($textdelete) { <br /> if ($AddressBook != $ubbt_lang['CHOOSE_ADD']) { <br /> $Deleted = addslashes($AddressBook); <br /> $query = " <br /> SELECT U_Number <br /> FROM {$config['tbprefix']}Users <br /> WHERE U_Username = '$Deleted' <br /> "; <br /> $sth = $dbh -> do_query($query); <br /> list ($Deletednumber) = $dbh -> fetch_array($sth); <br /> $dbh -> finish_sth($sth); <br /> $query = " <br /> DELETE FROM {$config['tbprefix']}AddressBook <br /> WHERE Add_Owner = '{$user['U_Number']}' <br /> AND Add_Member = '$Deletednumber' <br /> "; <br /> $dbh -> do_query($query); <br /> } <br /> header("Location: {$config['phpurl']}/sendprivate.php?Cat=$Cat&PHPSESSID=$PHPSESSID"); <br /> exit(); <br /> } <br /> <br />
Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /> <br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.