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)

Wifey 05-17-2004 02:38 PM

[high]* Wifey clicks install
[/high]

Thank you so much, it works perfectly :)

RichieBoy67 05-18-2004 12:50 AM

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! :D

Images you can use for the delete button
https://vborg.vbsupport.ru/attachmen...id=17837&stc=1

Awesome! Thanks!!

Keyser S?ze 05-22-2004 07:30 PM

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>

Keyser S?ze 05-22-2004 07:56 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!


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?

ImportPassion 05-22-2004 09:04 PM

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"

Keyser S?ze 05-23-2004 10:02 PM

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?

LeonHartHVA 05-30-2004 05:36 AM

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

mtha 06-09-2004 10:20 AM

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!

PhoenixBB 06-10-2004 12:54 AM

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?

mtha 06-10-2004 03:29 AM

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.


All times are GMT. The time now is 11:22 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.01267 seconds
  • Memory Usage 1,787KB
  • 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
  • (2)bbcode_html_printable
  • (5)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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