vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Quick Delete Post (https://vborg.vbsupport.ru/showthread.php?t=40523)

TECK 06-30-2002 10:00 PM

Quick Delete Post
 
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.

ESTIMATED INSTALL TIME: 4 minutes
REQUESTED BY: (nobody)
TESTED IN VERSION: 2.2.6

[high]RELATED HACKS[/high]
Quick Reply Box (with Close/Open thread switch)
Quick Close/Open Thread (with reason)

[HIGH]HACK UPDATES[/HIGH]
Version 1.1
------------------------------------
Changes:
- added deletion warning message



You like this hack? Please click on the [high]Install[/high] button.
To download the latest version of this hack, click below:

TECK 07-01-2002 06:03 PM

A screenshot...
Refresh the browser window to see the new look.

TECK 07-01-2002 06:06 PM

The hack can be also customized to have it as a link, instead of an image. Instructions are included in the hack file.

Velocd 07-01-2002 06:31 PM

Nice, and very useful :)

zachb 07-01-2002 06:59 PM

I love it!

*clicks install button*

Chris M 07-01-2002 07:16 PM

Great!

Satan

MrLister 07-01-2002 07:21 PM

Great, thank you!

Unknown553 07-01-2002 07:58 PM

Uhhh, this hack already exists.... https://vborg.vbsupport.ru/showthrea...threadid=30933

TECK 07-01-2002 08:11 PM

Unknown553, did you look at the code? is not the same hack.
my hack will delete the post and also the thread. the hack you listed above will delete the post but will leave the thread active, wich will make it look like that (if you have only one post in it):

TECK 07-01-2002 09:29 PM

Version 1.1 released. A popup warning message was added to prevent accidental post deletion.
For those who installed the hack, simply replace the template with the new one.

Boofo 07-01-2002 09:41 PM

How can I make it for Admins only or admin 1? And there's no way to get the confirm delete with a text link?

Quote:

Originally posted by Nakkid
Unknown553, did you look at the code? is not the same hack.
my hack will delete the post and also the thread. the hack you listed above will delete the post but will leave the thread active, wich will make it look like that (if you have only one post in it):


TECK 07-01-2002 09:49 PM

question 1. in the hack file, replace:
Code:

if (ismoderator($thread[forumid],"candeleteposts")) {
with:
Code:

if ($bbuserinfo['usergroupid']==6) {
question 2. did you read the entire hack file?

Boofo 07-01-2002 09:58 PM

Answer 1. Thank you. :)

Answer 2. Yes, I did, but is says to replace the stuff in the postbit delete template with the text link struff.

Quote:

Originally posted by Nakkid
question 1. in the hack file, replace:
Code:

if (ismoderator($thread[forumid],"candeleteposts")) {
with:
Code:

if ($bbuserinfo['usergroupid']==6) {
question 2. did you read the entire hack file?


TECK 07-01-2002 09:59 PM

so do this. :)

Boofo 07-01-2002 10:04 PM

That's what I did and it does not warn me before I delete a post. :)

Quote:

Originally posted by Nakkid
so do this. :)

TECK 07-01-2002 10:11 PM

you didnt read the hack file properly. let me quote from it:
Quote:

You can also use this as a link, instead of an image. Place the $post[delete] variable whereever you want in the postbit template and edit the 'postbit_deletepost' link to look, for example, like:

Boofo 07-01-2002 10:29 PM

Yeah, I figured that out finally. Maybe you ought to have it be a little less confusing. Like saying that you need to replace the template contents with: and then just do the code again with the new link info in it. Or say something like change the link LINE in the above script to. I'm not a total idiot, so if I got confused, how many others will get confused also? And next time, instead of a "So do it", a little how to would have avoided repeated messages like this.

Quote:

Originally posted by Nakkid
you didnt read the hack file properly. let me quote from it:

Boofo 07-01-2002 10:37 PM

I get no warning at all on deletion. It just goes ahead and deletes the message. Here is the code I have in the postbit_deletepost template:

Code:

<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>
<smallfont><a href="editpost.php?s=$session[sessionhash]&action=deletethispost&postid=$post[postid]">Delete Post</a></smallfont>


Unknown553 07-01-2002 10:40 PM

Quote:

Originally posted by Nakkid
Unknown553, did you look at the code? is not the same hack.
my hack will delete the post and also the thread. the hack you listed above will delete the post but will leave the thread active, wich will make it look like that (if you have only one post in it):

Ahh ok. Just making sure :)

TECK 07-01-2002 10:44 PM

boofo, the link should look like that:
Code:

<a href="javascript:confirmdelete()">Delete Message</a>
remove the space between [high]java[/high] and [high]script[/high]

also, related to:
Quote:

Originally posted by Boofo
Yeah, I figured that out finally. Maybe you ought to have it be a little less confusing. Like saying that you need to replace the template contents with: and then just do the code again with the new link info in it. Or say something like change the link LINE in the above script to. I'm not a total idiot, so if I got confused, how many others will get confused also? And next time, instead of a "So do it", a little how to would have avoided repeated messages like this.
there is no need for me to do this. first you will learn from it, while you hack the files and second, as you stated yourself, is clearly marked, nothing confusing. it says 'replace the link'. sorry if you felt offended but my intention was to make you understand that is important to read well the hack file before you post.

i would like to know if other collegues, from vB.org, find it confusing. i always try to make my hack files as clear as possible.
post here and let me know please if the information included is clear. thanks.

Sinecure 07-02-2002 12:01 AM

This hack installed perfectly, just as I wanted. The instructions were as clear as day, I'm not exactly sure where you went wrong Bofo, his instructions seemed more then clear to me?

Regardless, great hack Nakkid :)

Boofo 07-02-2002 12:12 AM

This is not the code you said to put in the text link in the file I downloaded. There was no java script in the text link itself at all. That's where I got confused. Now it makes more sense when you show it to me. :)

Quote:

Originally posted by Nakkid
boofo, the link should look like that:
Code:

<a href="javascript:confirmdelete()">Delete Message</a>
grrrr.. firefly's hacks snooping arround... :)
remove the space between [high]java[/high] and [high]script[/high]



TECK 07-02-2002 12:16 AM

np boofo. :)
is all clear now? let me know if there is something else you are not sure and i will tell you how to do it.
all the best,
floren.

Boofo 07-02-2002 12:19 AM

Nakkid,

Here is the code you had in the original file that you said I need to put in if it was a text link.

Code:

<smallfont><a href="editpost.php?s=$session[sessionhash]&action=deletethispost&postid=$post[postid]">Delete Post</a></smallfont>
That doesn't look any where near what you have in it now for this replacement. You changed it.

Code:

<a href="java script:confirmdelete()">Delete Message</a>
That is what was confusing me. Your instructions were wrong.
So, I guess I DID read ther instructions right the first time, huh?

Quote:

This hack installed perfectly, just as I wanted. The instructions were as clear as day, I'm not exactly sure where you went wrong Bofo, his instructions seemed more then clear to me?
Sinecure,

You must have gotten the updated file then. :)

TECK 07-02-2002 12:21 AM

i understand now where was the prob. everytime you download again a file at vB.org, you must clear before the chache, orelse it will download the same old file.

Boofo 07-02-2002 12:32 AM

The file I downloaded the first time was also called 1.1. You had added the javascript code but not changed the text link in it yet. The new file with the text link changed is the same version number. My cache was cleared the first time for the file becasue I had not downloaded it before. So, I don't need anything else explained. All I needed was the right file in the first place, which is there now. You changed that text link after my message that it didn't work, huh? :)

Quote:

Originally posted by Nakkid
i understand now where was the prob. everytime you download again a file at vB.org, you must clear before the chache, orelse it will download the same old file.

TECK 07-02-2002 12:35 AM

nope. i did not change it. why would i do this?
boofo, i always check my hacks properly and test them before i release them. also i always read the info properly just to make sure people get it right.

rest assured that if i would do this, forget to update a little piece of info, i will mention it here. so people know.
i use the auto-change function in my editor.. so it changes automatically everything in the command i enter. so when i highlighted the link, it replace it twice. and i never used in both files <smallfont>.

i send you a pm telling you to delete the irelevant posts you made here, to cleanup the thread. is up to you if you want to do this. acusing people that they do stuff like the one you posted above, wont get you far... at least not with me. thanks for the "cool" post.

let me know if you have any other problems with the hack.
regards,
floren.

Admin 07-02-2002 07:43 AM

Quote:

Originally posted by Nakkid
grrrr.. firefly's hacks snooping arround... :)
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..

Sinecure 07-02-2002 07:49 AM

Ummm, regardless, great hack nakkid.
I think I'm going to apply the modification so that only I can see this, or only administrators for that matter. I just don't want mods accidently deleting threads.

Boofo 07-02-2002 10:59 AM

Nakkid,

The smallfont part was the part I added to your original code when I put it in the postbit _deletepost. You didn't have the smallfont tags in your original code. When I quoted it, I quoted it from the template file since I already had it open replacing the code with the NEW code in your UPDATED hack file. When I get to the day I find myself not being able to read and understand a hack so small and simple, then I'll hang up the old board and call it quits. I've installed too many hacks by now to make that kind of mistake every time. Give me a little more credit than that.

It really doesn't matter anyway, Floren. I installed that hack, got the right code for it now and it works great. What bothers me is your defence stance over something that a hundred other hack writers have done a thousand times before and never had a problem dealing with. I'm glad to see that we have at least one perfect hack writer here. I was starting to get worried. ;)

Boofo 07-02-2002 11:42 AM

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? :)

TECK 07-02-2002 06:19 PM

Quote:

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

your comments made in the another hack version:
https://vborg.vbsupport.ru/showthrea...916#post189916

Chris M 07-02-2002 07:00 PM

Nakkid...

The instructions were perfectly clear:)

Satan

Neo 07-03-2002 03:04 AM

Mini Fix.

Replace
PHP Code:

<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


and then replace
PHP Code:

<a href="javascript:confirmdelete()">Delete Message</a

with

PHP Code:

<a href="javascript:confirmdelete('$post[postid]')">Delete Message</a

The popup should work fine now if any of you had problem with it.

TECK 07-03-2002 04:17 AM

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'.

ixian 07-03-2002 06:39 AM

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.

Boofo 07-03-2002 06:49 AM

Thanks, Neo! That fixed the message id problem. Works great! :)

TECK 07-03-2002 06:11 PM

Quote:

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.

globalwin 07-07-2002 12:27 PM

Everything went well install, but I have a few other things install also, when I click the delete post and confirm it, it takes me to the edit post :(

TECK 07-07-2002 02:44 PM

check your code changes.


All times are GMT. The time now is 02:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01582 seconds
  • Memory Usage 1,850KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (4)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete