Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Delete a post with only one button (in postbit) Details »»
Delete a post with only one button (in postbit)
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-24-2004 Last Update: Never Installs: 55
 
No support by the author.

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!

Images you can use for the delete button

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #82  
Old 05-17-2004, 02:38 PM
Wifey Wifey is offline
 
Join Date: Mar 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[high]* Wifey clicks install
[/high]

Thank you so much, it works perfectly
Reply With Quote
  #83  
Old 05-18-2004, 12:50 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

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!

Images you can use for the delete button
Awesome! Thanks!!
Reply With Quote
  #84  
Old 05-22-2004, 07:30 PM
Keyser S?ze's Avatar
Keyser S?ze Keyser S?ze is offline
 
Join Date: Apr 2002
Location: USA
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a suggestion, if ur going to make it with having a 1 for allowing it not to be deleted completely but hidden, why not make it "if 1 then" have a popup box to fill in any comments, i like my mods to put in why they are deleteing something

idea, would also prevent any accidental deleteing

if u want it to ask for confirmation before u delete do this,

Open up the postbit template and find
PHP Code:
<if condition="$post['editlink']">

Below, add:
PHP Code:
<form action="editpost.php" method="post" onSubmit="return confirm('Are you sure you want to delete this 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>
Reply With Quote
  #85  
Old 05-22-2004, 07:56 PM
Keyser S?ze's Avatar
Keyser S?ze Keyser S?ze is offline
 
Join Date: Apr 2002
Location: USA
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!

when i added this now i cant see it either, i need for me and all my little mods to be able to use quick delete, any help?
Reply With Quote
  #86  
Old 05-22-2004, 09:04 PM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IceMalee
a suggestion, if ur going to make it with having a 1 for allowing it not to be deleted completely but hidden, why not make it "if 1 then" have a popup box to fill in any comments, i like my mods to put in why they are deleteing something

idea, would also prevent any accidental deleteing

defeats the purpose of a "quick delete"
Reply With Quote
  #87  
Old 05-23-2004, 10:02 PM
Keyser S?ze's Avatar
Keyser S?ze Keyser S?ze is offline
 
Join Date: Apr 2002
Location: USA
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IceMalee
when i added this now i cant see it either, i need for me and all my little mods to be able to use quick delete, any help?

anyone know how to fix this?
Reply With Quote
  #88  
Old 05-30-2004, 05:36 AM
LeonHartHVA LeonHartHVA is offline
 
Join Date: Jul 2003
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i delete a post in a thread (page 3), when deleting done, it turn back page 1. I want it turn back the page store this post. Who can help me? Thanks much
Reply With Quote
  #89  
Old 06-09-2004, 10:20 AM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IceMalee
a suggestion, if ur going to make it with having a 1 for allowing it not to be deleted completely but hidden, why not make it "if 1 then" have a popup box to fill in any comments, i like my mods to put in why they are deleteing something
heheh, to make this "quick delete" more "complicated", I give the deletion an extra step, so you will be asked for reason:

add this where you want to have your delete icon located:

HTML Code:
 <span id="quickdelete_$post[postid]">
	<img src="$stylevar[imgdir_button]/delete.gif" alt="Quick Delete" border="0" />
	<script type="text/javascript"> vbmenu_register("quickdelete_$post[postid]", true); </script>
</span>
<div class="vbmenu_popup" id="quickdelete_$post[postid]_menu" style="display:none">
<form enctype="multipart/form-data" name="vbulletinform" style="display:inline;" action="editpost.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="deletepost" />
<input type="hidden" name="p" value="$post[postid]" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">
$vbphrase[delete_this_message]
</td>
</tr>
<tbody id="collapseobj_editpost_delete" style="$vbcollapse[collapseobj_editpost_delete]">
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
 
<div class="fieldset">
	<div>$vbphrase[delete_message_check_appropriate_option]</div>
	<if condition="$show['firstpostnote']">
	 <div>$vbphrase[deleting_message_deletion_of_thread]</div>
	</if>
</div>
 
<fieldset class="fieldset">
	<legend>$vbphrase[delete_options]</legend>
	<div style="padding:$stylevar[formspacer]px">
	 <div>
	 <label for="rb_del_leave"><input type="radio" name="deletepost" value="" id="rb_del_leave" tabindex="1" checked="checked" />$vbphrase[do_not_delete_message]</label>
	 </div>
	 <div>
	 <label for="rb_del_soft"><input type="radio" name="deletepost" value="delete" id="rb_del_soft" tabindex="1" />$vbphrase[delete_message]</label>
	 <if condition="$show['physicaldeleteoption'] AND $show['keepattachmentsoption']">(<label for="cb_keepattachments"><input type="checkbox" name="keepattachments" value="1" id="cb_keepattachments" tabindex="1" />$vbphrase[keep_attachments]</label>)</if>
	 </div>
	</div>
</fieldset>
 
<div class="smallfont">
	<div>$vbphrase[reason_for_deletion]:</div>
	<input type="text" class="bginput" name="reason" size="50" tabindex="1" title="$vbphrase[optional]" />
</div>
 
</div>
</div>
 
<div style="margin-top:$stylevar[cellpadding]px">
<input type="submit" class="button" value="$vbphrase[delete_this_message]" tabindex="1" accesskey="s"/>
</div>
 
</td>
</tr>
</tbody>
</table>
</form>
</div>

I would put is AFTER

HTML Code:
 <a href="$post[editlink]" onclick="return confirm_edit()"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
in postbit template.

credit goes to EvilLS1 for his Quick Edit hack!
Reply With Quote
  #90  
Old 06-10-2004, 12:54 AM
PhoenixBB PhoenixBB is offline
 
Join Date: May 2002
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I get it so that the button only shows up for those with permission to delete (on my forum admin/super mods and mods only in their own forum)? Members can't delete so I don't want them seeing this button, and it's also currently showing for unregistered posts.

Will this clash will the 'quick edit' hack?
Reply With Quote
  #91  
Old 06-10-2004, 03:29 AM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by PhoenixBB
How can I get it so that the button only shows up for those with permission to delete (on my forum admin/super mods and mods only in their own forum)? Members can't delete so I don't want them seeing this button, and it's also currently showing for unregistered posts.

Will this clash will the 'quick edit' hack?
I think if you put it into the right place, then the button ONLY display together with "edit" one, and the Edit button only shows up for those who can edit.

note. The code should be added ABOVE the </if> to close the checking for those who can edit.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12: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.04880 seconds
  • Memory Usage 2,361KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_html
  • (9)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete