Version: 1.00, by TECK
Developer Last Online: Nov 2023
Version: 2.2.x
Rating:
Released: 06-30-2002
Last Update: Never
Installs: 83
No support by the author.
This hack is an easy and cute one, of my 'Quick' series.
If you have permissions, it will allow you to [high]delete a post[/high] with the simple click of a button, while you view the thread. If there is only one post in the thread, the hack will delete the entire thread, instead.
Also the hack is designed to prevent accidental post deletion. A warning message will popup to confirm the message deletion.
I noticed a small problem when you are deleting posts. If you go to delete a post and canel out of it, the next post in the same thread you go to delete will have the very same thread id number. Any post you click on in that same thread and cancel out of will always have the same thread id. Is it supposed to work that way?
Originally posted by FireFly What?! Please delete that post, you are implying I created a hack that caused this confusiong when it's really vBulletin that separates java and script..
done. had no idea it was done by vB.
also... i listen to your suggestions chen related to the accidental deletion of the message. great idea you had on the previous thread and that's why i released v1.1 where i added the warning popup. let me know if you like the way i wrote the hack. i think my version is better then the other one (wich i didnt even know it existed, thanks Unknown553). read more here on my comments about this: https://vborg.vbsupport.ru/showthrea...065#post268065
<script language="JavaScript">
function confirmdelete() {
messagebox=confirm('You have chosen to delete Post $post[postid].\r\rClick OK to delete it, or Cancel to hide this prompt.');
if (messagebox==true) { window.location='editpost.php?s=$session[sessionhash]&action=deletethispost&postid='$post[postid]; }
else { }
}
</script>
with
PHP Code:
<script language="JavaScript">
var postid;
function confirmdelete(postid) {
messagebox=confirm('You have chosen to delete Post ' + postid + '.\r\rClick OK to delete it, or Cancel to hide this prompt.');
if (messagebox==true) { window.location='editpost.php?s=$session[sessionhash]&action=deletethispost&postid=' + postid; }
else { }
}
</script>
great job neo...
i added your fix to the file. except the variable define. you dont need it. thanks.
replace your old template with this one:
Code:
<script language="JavaScript">
function confirmdelete(postid) {
messagebox=confirm('You have chosen to delete Post '+postid+'.\r\rClick OK to delete it, or Cancel to hide this prompt.');
if (messagebox==true) { window.location='editpost.php?s=$session[sessionhash]&action=deletethispost&postid='+postid; }
else { }
}
</script>
<a href="javascript:confirmdelete($post[postid])"><img src="{ imagesfolder}/delete.gif" border="0" alt="Delete Message"></a>
dont forget to remove the space in front of 'imagesfolder}' and also the one between 'java' and 'script'.
Just checking before I install - don't want to sound retarded here, but the button/link does NOT show up for users who don't have permissions, correct? I only want my admins and mods to see this. Yes, my mods - I have a decent crew and I really want them to have this feature. I have a real problem on my forums with thread derailment - somebody will ask a question, next thing you know 4 or 5 post later it's totally off topic or people are flaming each other. I'm also going to install the post *nuked* hack, but this one will be useful as well.
Originally posted by ixian Just checking before I install - don't want to sound retarded here, but the button/link does NOT show up for users who don't have permissions, correct? I only want my admins and mods to see this. Yes, my mods - I have a decent crew and I really want them to have this feature. I have a real problem on my forums with thread derailment - somebody will ask a question, next thing you know 4 or 5 post later it's totally off topic or people are flaming each other. I'm also going to install the post *nuked* hack, but this one will be useful as well.
the button will show only to people who have perms to delete posts.