vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Edit timeout: Is there a way to make it specific to a forum section or user group? (https://vborg.vbsupport.ru/showthread.php?t=207222)

Beretta1526 03-03-2009 02:07 PM

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!

.

1Unreal 03-03-2009 02:55 PM

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 :p

Lynne 03-03-2009 03:04 PM

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.)

Beretta1526 03-03-2009 03:20 PM

Quote:

Originally Posted by Lynne (Post 1759344)
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 (Post 1759344)
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?

.

Lynne 03-03-2009 03:59 PM

It's a plugin using the location I specified - fetch_foruminfo.

Beretta1526 03-03-2009 04:42 PM

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

.

Hornstar 03-11-2009 06:01 AM

can you post some steps or create a plugin and post it up to make this work for usergroups. thanks.

Dismounted 03-11-2009 06:17 AM

The above code checks usergroups... (I gotta get round to updating my modification, don't I? :p)

BoostedK20 02-05-2013 02:48 PM

What can I make this so I can set a user to a usergroup manually, and it expires 30 days later?

DivisionByZero 02-06-2013 12:38 AM

Quote:

Originally Posted by BoostedK20 (Post 2402091)
What can I make this so I can set a user to a usergroup manually, and it expires 30 days later?

huh?

BoostedK20 02-10-2013 10:00 PM

Quote:

Originally Posted by DivisionByZero (Post 2402282)
huh?

I want to assign a user a user rank icon, for a title that they received for winning a monthly contest. Once the month is over, that goes away. How can I do that without having to manually remove it?


All times are GMT. The time now is 04:59 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.01060 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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