vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to allow users to edit their posts for limited time after posting? (https://vborg.vbsupport.ru/showthread.php?t=317675)

XYZ500 03-07-2015 09:48 PM

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?

Lynne 03-07-2015 11:25 PM

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.

XYZ500 03-08-2015 03:01 PM

Quote:

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

kh99 03-08-2015 05:17 PM

Quote:

Originally Posted by ECZ (Post 2539862)
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.

XYZ500 03-08-2015 06:06 PM

Quote:

Originally Posted by kh99 (Post 2539879)
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?

kh99 03-08-2015 06:07 PM

Quote:

Originally Posted by ECZ (Post 2539888)
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.

kh99 03-08-2015 07:19 PM

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.

Bill Stuntz 03-12-2015 12:32 PM

1 Attachment(s)
Is this what you're looking for under CP..Settings..Options? Or is this some add-in on our MB?


All times are GMT. The time now is 10:54 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.00991 seconds
  • Memory Usage 1,740KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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