The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Message Edit Time Limit in Social Group Discussions
Similarly to post editing time limit option it would be great if social group discussions would offer an option to limit edit time of a message to certain period only.
It seams there is only option to allow or disallow message editing by usergroup (Can manage own messages [Yes][No]) which is not good enough. Does anyone could help with writing the plugin for that? I'm not sure were to start. I would like to limit poster to 30 minutes to edit his/her messages within social group discussions. Of course the ability of Admin to edit all messages anytime should stay intact. I would be grateful for any help/ideas. |
#2
|
|||
|
|||
Well, you could make the "Edit" control go away by creating a plugin using hook group_messagebit_display_complete and setting $message['edit'] to false. I guess strictly speaking that doesn't stop someone from editing the message, but someone would have to be really desperate to figure out how to do it without having the control. (Or you could just use a second plugin to guard against that).
Anyway, you could do something like this: Code:
if ($message['edit']) { if ((TIMENOW - $message['dateline']) > (60 * 30)) $message['edit'] = false; } but that doesn't account for admins being able to edit forever. It's easy enough to check if the current user is an admin, but what you really want is to know if they have permission to edit that discussion and that message. (The code that figures that out is in includes/class_groupmessage.php, in class vB_Group_Bit_Message, if that helps). |
#3
|
||||
|
||||
Thank you Kevin. Once again your suggestions were crucial to achieve the target.
Yup, that was great start and gave me the whole idea how to use the dateline info, now all stuff works like a charm! And this plug itself is also helpful. I'm sure you've already got loads of good karma for helping here! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|