Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2015, 09:48 PM
XYZ500 XYZ500 is offline
 
Join Date: Aug 2014
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to allow users to edit their posts for limited time after posting?

How to allow users to edit their posts for limited time after posting?

Also, is it possible to have different times for different categories?

For example,
I want the users to be allowed to edit their posts for 60 minutes after posting in the Introduction forum. And for 30 minutes in the General chat lounge forum. And so on. Different time allowed for different categories/forums.

Is this possible to do?
Reply With Quote
  #2  
Old 03-07-2015, 11:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NOT TESTED, but probably a plugin at the global_bootstrap_complete with something like this:

PHP Code:
if (THIS_SCRIPT == 'editpost')  

    global 
$foruminfo$vbulletin
    if (
$foruminfo['forumid']==xx)   
    { 
        
$vbulletin->options['edittimelimit'] = yy
    } 

change xx and yy to whatever you want. You can have as many if statements as you want within there.
Reply With Quote
  #3  
Old 03-08-2015, 03:01 PM
XYZ500 XYZ500 is offline
 
Join Date: Aug 2014
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
NOT TESTED, but probably a plugin at the global_bootstrap_complete with something like this:

PHP Code:
if (THIS_SCRIPT == 'editpost')  

    global 
$foruminfo$vbulletin
    if (
$foruminfo['forumid']==xx)   
    { 
        
$vbulletin->options['edittimelimit'] = yy
    } 

change xx and yy to whatever you want. You can have as many if statements as you want within there.
I can't use this to set different edit times for different categories, can I?
Reply With Quote
  #4  
Old 03-08-2015, 05:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ECZ View Post
I can't use this to set different edit times for different categories, can I?
No, but maybe this will work:
Code:
if (isset($foruminfo))
{  
    global $vbulletin, $foruminfo;
    $edittimes =array(c1=>t1, c2=>t2...);
    $parents = array_intersect(explode(',',$foruminfo['parentlist']), array_keys($edittimes));
    if (($parent = reset($parents)) !== FALSE)
    {
        $vbulletin->options['edittimelimit'] = $edittimes[$parent];
    }  
}

where you'd change c1, c2, etc to the category ids, and t1, t2, etc to the corresponding times in minutes.

I haven't test it except to see that there aren't any typos. I changed the 'if' condition because it looks like edittimelimit is used in some other places.
Reply With Quote
  #5  
Old 03-08-2015, 06:06 PM
XYZ500 XYZ500 is offline
 
Join Date: Aug 2014
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
No, but maybe this will work:
Code:
if (isset($foruminfo))
{  
    global $vbulletin, $foruminfo;
    $edittimes =array(c1=>t1, c2=>t2...);
    $parents = array_intersect(explode(',',$foruminfo['parentlist']), array_keys($edittimes));
    if (($parent = reset($parents)) !== FALSE)
    {
        $vbulletin->options['edittimelimit'] = $edittimes[$parent];
    }  
}

where you'd change c1, c2, etc to the category ids, and t1, t2, etc to the corresponding times in minutes.

I haven't test it except to see that there aren't any typos. I changed the 'if' condition because it looks like edittimelimit is used in some other places.
How to find the category IDs?

https://vborg.vbsupport.ru/forumdisplay.php?f=251
Is the category ID for this 251?

https://vborg.vbsupport.ru/forumdisplay.php?f=250
Is this category ID for this 250?
Reply With Quote
  #6  
Old 03-08-2015, 06:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ECZ View Post
How to find the category IDs?

https://vborg.vbsupport.ru/forumdisplay.php?f=251
Is the category ID for this 251?

https://vborg.vbsupport.ru/forumdisplay.php?f=250
Is this category ID for this 250?
Right. And I believe you can include individual forums as well.
Reply With Quote
  #7  
Old 03-08-2015, 07:19 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just out of curiosity, are you using "forum" and "category" to mean the same thing? If so then what Lynne posted would have worked. But when you asked about categories I thought you wanted to be able to set the time for a category and all child forums.
Reply With Quote
  #8  
Old 03-12-2015, 12:32 PM
Bill Stuntz Bill Stuntz is offline
 
Join Date: Feb 2015
Location: Columbus, OH
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this what you're looking for under CP..Settings..Options? Or is this some add-in on our MB?
Attached Images
File Type: png edit.png (51.0 KB, 0 views)
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 01:39 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.03826 seconds
  • Memory Usage 2,259KB
  • Queries Executed 12 (?)
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
  • (2)bbcode_code
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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_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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete