vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Delete a post with only one button (in postbit) (https://vborg.vbsupport.ru/showthread.php?t=60704)

Gary King 01-24-2004 10:00 PM

Delete a post with only one button (in postbit)
 
This is a really easy hack to install and use, and it allows you to delete any post with only one click, instead of going through the editing process and then selecting delete, and then confirming, etc.

NOTE: Do you want to use an image instead of a button? Click here!

NOTE: You cannot use a link to replace the button because the code requires you to submit a form, and using a link will make a huge security risk where people can delete posts as they wish!

Instructions

Open up the postbit template and find
PHP Code:

            <if condition="$post['editlink']"

Below, add:
PHP Code:

                <form action="editpost.php" method="post">
                    <
input type="hidden" name="s" value="$session[sessionhash]/>
                    <
input type="hidden" name="p" value="$post[postid]/>
                    <
input type="hidden" name="do" value="deletepost" />
                    
                    <
input type="submit" name="deletepost" value="<if condition="$deletebutton">delete<else />remove</if>" id="rb_del_soft" tabindex="1" class="button" />
                    
                </
form

Open includes/functions_showthread.php and find:
PHP Code:

    // hide users in Coventry from non-staff members 

Above, add:
PHP Code:

    $deletebutton 1// set to 1 to only hide the post, or 0 to permanently delete the post 

Done! :D

Images you can use for the delete button
https://vborg.vbsupport.ru/external/2004/05/2.jpg

!!!cyr0n_k0r 01-25-2004 02:30 AM

woohoo.! thanks.

Allan 01-25-2004 08:06 AM

Thank You Gary :)

Boofo 01-25-2004 08:52 AM

Gary, if you try to delete the first post in a thread, it goes to a blank white page and nothing happens. You need to fix this so the delete button won't show up if it is the first post in a thread. ;)

hoahongtim 01-25-2004 12:09 PM

good mod ! thanks a lot !

M.C. 01-25-2004 12:42 PM

work perfect to me even in first post in thread...

just small additions i`d love to see (that was in the same hack for vb2.x.x):
- any chance to add small nitification pop-up window to submit delete (just in case that i pushed right button :devious: )
- how can i change that to image or just text link?

Alone Wolf 01-25-2004 02:31 PM

but when I used this hack. I got a small problem! it is member's number posts. One member has 25 posts, and when I delete a thread which has 3 posts of him. His number post has only 22.

How can I prevent decreasing number post when I delete a thread or a post?

Gary King 01-25-2004 02:37 PM

Quote:

Originally Posted by M.C.
work perfect to me even in first post in thread...

just small additions i`d love to see (that was in the same hack for vb2.x.x):
- any chance to add small nitification pop-up window to submit delete (just in case that i pushed right button :devious: )
- how can i change that to image or just text link?

To change to an image, change
PHP Code:

<input type="submit" name="deletepost" value="<if condition="$deletebutton">delete<else />remove</if>" id="rb_del_soft" tabindex="1" class="button" /> 

to
PHP Code:

<input type="hidden" name="deletepost" value="<if condition="$deletebutton">delete<else />remove</if>" /> 

Then, add this below that:
PHP Code:

<input type="image" name="submit" src="image.jpg" /> 

Replace image.jpg with the path to your image.

Link14716 01-25-2004 02:43 PM

Quote:

Originally Posted by Alone Wolf
but when I used this hack. I got a small problem! it is member's number posts. One member has 25 posts, and when I delete a thread which has 3 posts of him. His number post has only 22.

How can I prevent decreasing number post when I delete a thread or a post?

That's a whole 'nother hack.

MGM 01-25-2004 02:55 PM

very nice!

kinda like the Quick Delete Post hack for vB2

/me clicks Install

MGM out

Gary King 01-25-2004 03:03 PM

Quote:

Originally Posted by MetalGearMaster
very nice!

kinda like the Quick Delete Post hack for vB2

[high]* MetalGearMaster clicks Install
[/high]

MGM out

To be honest (and to let everyone know) I wasn't aware there was one for vB 2, so I didn't take ANY code from there ;) :rolleyes:

MGM 01-25-2004 03:12 PM

lol, I wasn't saying you were, don't take my post the wrong way :P

besides, that hack never worked for me for some reason anyways ;)

MGM out

Gary King 01-25-2004 03:14 PM

Quote:

Originally Posted by MetalGearMaster
lol, I wasn't saying you were, don't take my post the wrong way :P

besides, that hack never worked for me for some reason anyways ;)

MGM out

Nah I knew you weren't saying I did, but I was letting everyone else know (in general) that I didn't :p

Okiewan 01-26-2004 03:57 AM

I allow 2 of my usergroups to delete their posts... they can delete their posts, but I assume the "manage" ability isn't there (that would be the best scenario).

Any way to limit this (icon visible) to Admins/Supermods only?

Boofo 01-26-2004 04:03 AM

Gary, are you going to fix the first post in the thread problem?

Zachery 01-26-2004 05:00 AM

Quote:

Originally Posted by Boofo
Gary, are you going to fix the first post in the thread problem?

another hack that shows how lazy everyone really is

gmarik 01-26-2004 06:20 AM

Make it a .txt file, ok?!

deathemperor 01-26-2004 07:24 AM

I thought vb must have make this default, deleting a post is a very common action, have to go to editpost and check delete button is too much to delete a post.

Okiewan 01-26-2004 11:33 AM

Convenience does not necessarily equate to laziness!

Zachery 01-26-2004 11:53 AM

Quote:

Originally Posted by Okiewan
Convenience does not necessarily equate to laziness!

yes it does

Okiewan 01-26-2004 11:59 AM

Hummm... Okay.

Gary King 01-26-2004 12:41 PM

Quote:

Originally Posted by Okiewan
I allow 2 of my usergroups to delete their posts... they can delete their posts, but I assume the "manage" ability isn't there (that would be the best scenario).

Any way to limit this (icon visible) to Admins/Supermods only?

Add the following above the new code in postbit template:
PHP Code:

<if condition="$bbuserinfo['usergroupid'] == 5 or $bbuserinfo['usergroupid'] == 6"

and then </if> at the end of the newly added code in postbit template.

Done!

Gary King 01-26-2004 12:49 PM

Quote:

Originally Posted by Faranth
another hack that shows how lazy everyone really is

I thought it was fixed already, someone reported it was. Well, hmph I'll do it right now then :)

Gary King 01-26-2004 12:50 PM

Quote:

Originally Posted by gmarik
Make it a .txt file, ok?!

How come..? It should be simple enough to see just like this :)

Gary King 01-26-2004 12:51 PM

Quote:

Originally Posted by Gary W
I thought it was fixed already, someone reported it was. Well, hmph I'll do it right now then :)

Yeah looks fine to me I just tested, with $deletebutton as 1 and 0.

Okiewan 01-26-2004 12:53 PM

Great! Thanks Gary.

M.C. 01-26-2004 12:59 PM

thanks! any chanse for second modification (pop-up nitification window)?

Gary King 01-26-2004 01:10 PM

Quote:

Originally Posted by M.C.
thanks! any chanse for second modification (pop-up nitification window)?

How about adding a checkbox next to the button instead, so it's still all on one page? You have to check the checkbox and click on the button to delete?

M.C. 01-26-2004 01:52 PM

fine it`s better, to protect from misstake, couse i made options to Physically Remove Message delete...

Thanks!

zajako 01-26-2004 07:53 PM

Quote:

Originally Posted by Gary W
This is a really easy hack to install and use, and it allows you to delete any post with only one click, instead of going through the editing process and then selecting delete, and then confirming, etc.

Instructions

Open up the postbit template and find
PHP Code:

            <if condition="$post['editlink']"

Below, add:
PHP Code:

                <form action="editpost.php" method="post">
                    <
input type="hidden" name="s" value="$session[sessionhash]/>
                    <
input type="hidden" name="p" value="$post[postid]/>
                    <
input type="hidden" name="do" value="deletepost" />
                    
                    <
input type="submit" name="deletepost" value="<if condition="$deletebutton">delete<else />remove</if>" id="rb_del_soft" tabindex="1" class="button" />
                    
                </
form

Open includes/functions_showthread.php and find:
PHP Code:

    // hide users in Coventry from non-staff members 

Above, add:
PHP Code:

    $deletebutton 1// set to 1 to only hide the post, or 0 to permanently delete the post 

Done! :D

well done :)

Gary King 01-26-2004 08:59 PM

Quote:

Originally Posted by zajako
well done :)

Thanks it means a lot from a programmer like you :D

PET 02-11-2004 09:35 PM

don't forghet...that if you use old POSTBIT style you need to make modifications to postbit_legacy !

PET 02-11-2004 09:48 PM

Quote:

Originally Posted by Gary W
Add the following above the new code in postbit template:
PHP Code:

<if condition="$bbuserinfo['usergroupid'] == 5 or $bbuserinfo['usergroupid'] == 6"

and then </if> at the end of the newly added code in postbit template.

Done!

it isn't working !

Boofo 02-14-2004 07:34 PM

This hack doesn't even work right. Try deleting the first post in a thread and see what happens. Another half finished hack. ;)

Gary King 02-14-2004 07:50 PM

Quote:

Originally Posted by Boofo
This hack doesn't even work right. Try deleting the first post in a thread and see what happens. Another half finished hack. ;)

That's strange because as I said before, it works fine for me. What exactly doesn't work right?

Boofo 02-14-2004 08:07 PM

Like I said earlier in the thread. When you try and delete the first post in a thread. ;)

Gary King 02-14-2004 08:10 PM

Quote:

Originally Posted by Boofo
Like I said earlier in the thread. When you try and delete the first post in a thread. ;)

And as I said too, it works fine :)

Boofo 02-14-2004 08:29 PM

Not for the first post, it doesn't. It works fine for other posts but not the first post in a thread.

Gary King 02-14-2004 08:30 PM

Quote:

Originally Posted by Boofo
Not for the first post, it doesn't. It works fine for other posts but not the first post in a thread.

Okay well then I'll need confirmation from someone else as well then, because it works fine for me on an unhacked RC 3 :)

MischiefThought 02-23-2004 02:40 PM

This doesnt work for RC 4?


All times are GMT. The time now is 04:47 PM.

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.01548 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
  • (13)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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