PDA

View Full Version : Delete All Messages in Inbox Mod [by Kae]


Kaeliah
04-02-2011, 02:30 AM
Delete All Messages in Inbox Mod
By Kaeliah


Modification TOS (http://www.mysidiaadoptables.com/forum/blog.php?cp=3)
**Note that there is no viewable credit required for this mod**

RoconzaArt (http://www.mysidiaadoptables.com/forum/showthread.php?t=2052) requested this mod and it was an easy enough one to do so here we are! This mod adds a link at the bottom of your inbox that allows you to delete ALL the messages in your inbox, even unread one so be careful!

Installing: Open messages.php and find this at about line 78:

$article_content = $article_content."<tr>
<td><b><a href='messages.php?act=read&id=".$nid."'>".$messagetitle."</a></b></td>
<td>".$fromuser."</td>
<td><center>".$status."</center></td>
<td><center>".$datesent."</center></td>
<td><center><a href='messages.php?act=delete&id=".$nid."'><img src='templates/icons/delete.gif' border=0></a></center></td>
</tr>";

$i++;
}

$article_content = $article_content."</table><br>

Add after(BUT BEFORE THE ";)



<a href='messages.php?act=deleteallinbox'><img src='templates/icons/delete.gif' border=0> Delete All</a><br><br>

Scroll down and find this at about line 212:

else if($act == "delete"){

// We are deleting a message...

$query = "DELETE FROM ".$prefix."messages WHERE touser='".$loggedinname."' and id='".$id."'";
runquery($query);

$article_title = $lang_delete_successful_t;
$article_content = $lang_delete_successful;

}

Add after:

else if($act == "deleteallinbox"){

$article_title = "Delete All Messages In Inbox";
$article_content = "Are you sure you want to delete all the messages in your inbox?<br><br>

<a href='messages.php?act=deleteallconfirm'>Confirm</a> - <a href='messages.php'>Nevermind</a>";

}
else if($act == "deleteallconfirm"){
$query = "DELETE FROM ".$prefix."messages WHERE touser='".$loggedinname."'";
runquery($query);

$article_title = $lang_delete_successful_t;
$article_content = $lang_delete_successful;

}


And that's it! Enjoy!