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


All times are GMT. The time now is 06:28 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.01330 seconds
  • Memory Usage 1,755KB
  • 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
  • (7)bbcode_php_printable
  • (2)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
  • (10)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