vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Mini Mods - Permission change - users can delete own threads with no replies (https://vborg.vbsupport.ru/showthread.php?t=259759)

MoMan 03-02-2011 10:00 PM

Permission change - users can delete own threads with no replies
 
1 Attachment(s)
I've seen people ask about this feature many times without getting a definitive answer, so I thought I'd chime in as I recently implemented this on my forum.

Question: Is it possible to allow members to delete their own threads if and only if they have no replies?

Answer: The stock vbulletin installation only allows you to specify whether or not users can delete their own threads, regardless of the number of replies. To change this, you can make a simple code modification.

The related usergroup permission is called "Can Delete Own Threads". If you would like to change this permission so that it limits users to deleting only threads with no replies, open ajax.php, editpost.php, and postings.php and find:

PHP Code:

$forumperms $vbulletin->bf_ugp_forumpermissions['candeletethread'

Replace with:

PHP Code:

(($forumperms $vbulletin->bf_ugp_forumpermissions['candeletethread']) AND $threadinfo['replycount'] == 0

Now, users will be able to delete their own threads if they have no replies! I have tested this on vB 3.8.7 using both the ajax and non-ajax editors. I suspect this will work with vB 3.x.x, as well as with 4.x, however. Enjoy!

Qima 03-04-2011 04:33 PM

thanks , for this modification


All times are GMT. The time now is 04:17 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.01448 seconds
  • Memory Usage 1,708KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete