Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2009, 02:07 PM
Beretta1526 Beretta1526 is offline
 
Join Date: Mar 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Edit timeout: Is there a way to make it specific to a forum section or user group?

As far as I can tell, the edit button time limit is controlled only in one place, and is a global setting only. I have ours set to 12 hours, and this is the way that it's been since the start. I would like to be able to allow certain member groups and/or certain forum sections (or subsections) to edit their posts for a longer period of time without giving them moderator permissions.

Examples:

1) I want to keep my 12-hour edit time limit for all users, but allow any user to edit their post in a particular section either indefinitely or for a time period other than the global 12-hour limit I have set for elsewhere.

2) I have a user group that I would like to allow them to be able to edit their posts for a longer period of time than the 12-hour limit. It would be OK if this were only for a specific user group and in a specific forum section or sub-section. It does not need to be a global setting for this group.

I am not wild about making a member a moderator for a section, as it would allow them to edit/delete others' posts. I only want to expand the time that they may edit their posts.

Thanks!

.
Reply With Quote
  #2  
Old 03-03-2009, 02:55 PM
1Unreal 1Unreal is offline
 
Join Date: Jul 2008
Location: London
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Theres a variable called $post[edit_time] so you could do something like
HTML Code:
<if condition="is_member_of($vbulletin->userinfo, X,X,X)">
<if condition="$post[edit_date] !< 12">
Edit post link
</if>
</if>
I highly doubt that will work because $post[edit_date] will not be in the format I posted, you will have to look into it more. But that is the general jist there...I hope Ive helped a bit even if it is a bit rudimentary
Reply With Quote
  #3  
Old 03-03-2009, 03:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think that will work because the php will verify whether the user is allowed to edit the post and will give him a no permission.

Plugin - fetch_foruminfo:
PHP Code:
if ($forumid == '69')
{
    
$vbulletin->options['edittimelimit'] = '60';

That one works on my forum. Edit to suit your own needs (adding usergroup, etc.)
Reply With Quote
  #4  
Old 03-03-2009, 03:20 PM
Beretta1526 Beretta1526 is offline
 
Join Date: Mar 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I don't think that will work because the php will verify whether the user is allowed to edit the post and will give him a no permission.
Yes, that is the issue I had run into.

Quote:
Originally Posted by Lynne View Post
Plugin - fetch_foruminfo:
PHP Code:
if ($forumid == '69')
{
    
$vbulletin->options['edittimelimit'] = '60';

That one works on my forum. Edit to suit your own needs (adding usergroup, etc.)
Is the plugin named above required, or do I insert that code into xxx template?

.
Reply With Quote
  #5  
Old 03-03-2009, 03:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's a plugin using the location I specified - fetch_foruminfo.
Reply With Quote
  #6  
Old 03-03-2009, 04:42 PM
Beretta1526 Beretta1526 is offline
 
Join Date: Mar 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Many thanks. I'll give that a shot tonight...

.

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

OK, I actually modified my search terms and found more info that you had suggested elsewhere regarding specific user groups rather than forum ID's. Many thanks, as THAT worked like a charm. I added a usergroup called EDITOR and added a test user to that usergroup (as a secondary group) and set the timeout to 0 (zero, to make it indefinite). That worked really well.

Now I want to get sorta complicated with this, but I want to grant these users the ability to edit indefinitely (or extended limit) in only particular forums. I would imagine that this would require nesting of two conditionals in the plugins, no?

My question is, would I do two separate plugins and make them read in a specific order on the fetch_foruminfo hook, or would I nest them in the same plugin like below?


PHP Code:
if (($forumid == 'NN') AND (is_member_of($vbulletin->userinfox,y,z)))
{
    
$vbulletin->options['edittimelimit'] = 'XX';

[S]I just don't want to create an unstable condition by "testing" this out on the forum while it's live...[/S]
EDIT: I got adventurous and tried it. It appears to be working the way I have it specified above. It allows that in a specific forum, a specific member group may edit either a different specified time or indefinitely. WOOT! A specific example would be to have a special subsection in a Classifieds forum section that is specifically for dealers. If a dealer posts in the dealer subsection, they may edit their posts to reflect a change in pricing or availability. Any other member won't have the ability, unless they are a mod/admin.

THANK YOU!!!

.
Reply With Quote
  #7  
Old 03-11-2009, 06:01 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can you post some steps or create a plugin and post it up to make this work for usergroups. thanks.
Reply With Quote
  #8  
Old 03-11-2009, 06:17 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The above code checks usergroups... (I gotta get round to updating my modification, don't I? )
Reply With Quote
  #9  
Old 02-05-2013, 02:48 PM
BoostedK20 BoostedK20 is offline
 
Join Date: Mar 2011
Location: NY
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What can I make this so I can set a user to a usergroup manually, and it expires 30 days later?
Reply With Quote
  #10  
Old 02-06-2013, 12:38 AM
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Location: South Bend, Indiana
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BoostedK20 View Post
What can I make this so I can set a user to a usergroup manually, and it expires 30 days later?
huh?
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:39 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.06075 seconds
  • Memory Usage 2,262KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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