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.

PhoenixBB 06-10-2004 08:03 AM

Quote:

Originally Posted by mtha
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.

But this isn't a button for editing, it's for deleting. My members can edit, they cannot delete. If they click the normal edit button they don't get the delete option, but they have the 'quick delete' button there. Sure they'll get no permission when they click it, but I figure it'd be better to hide it.

The code is in the right place.

I think I'll probably be able to try and figure it out from the code on the quick edit hack.

mtha 06-11-2004 04:10 AM

Quote:

Originally Posted by PhoenixBB
But this isn't a button for editing, it's for deleting. My members can edit, they cannot delete. If they click the normal edit button they don't get the delete option, but they have the 'quick delete' button there. Sure they'll get no permission when they click it, but I figure it'd be better to hide it.

The code is in the right place.

I think I'll probably be able to try and figure it out from the code on the quick edit hack.

:) sorry, I let my members to delete their posts, so I didnt think of this.

There're two way you can do it:

- Try to figure out how to get the value of $show['deletepostoption'] then you <if condition="$show['deletepostoption']">
- or use condition where usergroup=6 (admin) or user is moderator something around the delete part.

PhoenixBB 06-11-2004 12:40 PM

Quote:

Originally Posted by mtha
:) sorry, I let my members to delete their posts, so I didnt think of this.

There're two way you can do it:

- Try to figure out how to get the value of $show['deletepostoption'] then you <if condition="$show['deletepostoption']">
- or use condition where usergroup=6 (admin) or user is moderator something around the delete part.

Thanks, I'll give it a shot. :)

SIINSI 08-08-2004 07:27 PM

I just noticed that too.... I don't allow users to delete. How can I get rid of the images to those withut permissions?

TIA

Miguel

AnhTuanCool 08-09-2004 01:34 AM

Small problem, the browser doesn't redirect to the previous page that contain the deleted post. That would be hard for some hundred pages thread. :(

Any idea?

Blam Forumz 08-18-2004 08:59 PM

/me installs & clicks teh button

the wiz 09-28-2004 12:46 PM

Installed. :)

cnczone 01-24-2005 02:29 PM

great hack

Dys 01-30-2005 06:44 AM

Not sure why but no matter what, its a soft delete... even if I change the line in the functions_showthreads 1 or 0 jut does soft delete.

am I really the only one who noticed this? or did I just miss an entire step?

interfx 02-12-2005 09:11 PM

Does this work on 3.0.6?

Installed it, works great...

calvinnguyen 02-24-2005 01:22 AM

this is great! thanks Gary

grief 06-04-2005 02:50 AM

Quote:

Originally Posted by Gary King
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.

might wanna add align="middle" border="0" to that line aswell so the button lines up with the edit and quote buttons

[high]* grief clicks install[/high]

stan111 09-18-2005 01:00 AM

i got it working perfectly but somehow when i want it to show the picture i got the X because i dont know wat folder on the Root i should put the image in
thanks in advance
btw: if you use v3.0.7, u should edit your postbit legacy also in order to get it work

thanks a lot

Alphawolf83 11-16-2005 10:25 AM

*clicks install*

Thanks for this hack. A useful addition would be to give access to this button to only those moderators who can moderate in the forum. Otherwise the button would have been shown in all forums so that moderators can delete in every forum => they would have permissions like super-moderators.

To do this I added:
PHP Code:

<if condition="can_moderate($forum['forumid'])">
...
</if> 

Sorry for the terrible english :-)


All times are GMT. The time now is 07: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.01514 seconds
  • Memory Usage 1,846KB
  • 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
  • (9)bbcode_php_printable
  • (10)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
  • (24)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