Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-23-2010, 06:41 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Code to delete a post

In an old thread I found a link to the vb 3.0.x mod:
https://vborg.vbsupport.ru/showthread.php?t=60704

which has the following code to 'quick soft delete' a thread with a 'remove' button:

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>
The problem iwhen I try this on 3.8.x I get a message saying:
"Your submission could not be processed because a security token was missing."

I'm guessing the code to delete a message has changed- but I've searched through every thread with 'delete post' in the title and haven't found any means to do this for 3.8.x but it's obviously doable. Any ideas?

Thanks.

--------------- Added [DATE]1274643978[/DATE] at [TIME]1274643978[/TIME] ---------------

Nevermind, I found it... it was missing:
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />

--------------- Added [DATE]1274646564[/DATE] at [TIME]1274646564[/TIME] ---------------

OK, I still need help... apparently the code above is for a real/permanent delete, I need to change it to a 'soft' delete. I searched again but no luck.

--------------- Added [DATE]1274648406[/DATE] at [TIME]1274648406[/TIME] ---------------

OK.. so I guess this is a bigger issue then I thought it would be, maybe impossible... I see if a non-admin/super-mod uses the code above it does default to a soft delete which is fine... but I thought if displayed this code for any user, in this case for the thread starter only, I could allow any thread starter to delete any posts within their own thread... on an old forum I used to visit this was called 'troll control' - there currently is no mod or template edit to allow this for vb 3.7 or 3.8... the last vb version to have a working mod for this seems to be 3.0 but I *know* I've used this on a newer board... maybe 3.5? Anyway the point is even though i can get this code to display only for the thread owner pressing the button yields an error- I do not have permission to access this page because I don't have permission to delete a tread... I thought by giving them this code I was giving permission but apparently not. Does anyone know if there's a way around this? I want a thread owner to be able to delete (soft delete) any post in their own thread.

Thanks.
Reply With Quote
Reply


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 09:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02597 seconds
  • Memory Usage 2,199KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete