Jake Bunce
Well-known member
(in response to this thread)
First enable this option:
Admin CP -> Home -> Options -> Threads, Discussions and Conversations -> Automatically Adjust Case of Discussion Titles
Now we can edit the code to apply this restriction to a specific group only. Edit this file:
library/XenForo/DataWriter/Discussion.php
Add the red code. Change the blue part to specify the user_group_id that cannot shout:
First enable this option:
Admin CP -> Home -> Options -> Threads, Discussions and Conversations -> Automatically Adjust Case of Discussion Titles
Now we can edit the code to apply this restriction to a specific group only. Edit this file:
library/XenForo/DataWriter/Discussion.php
Add the red code. Change the blue part to specify the user_group_id that cannot shout:
Rich (BB code):
/**
* Verifies that the discussion title is valid
*
* @param string
*
* @return boolean
*/
public function _verifyTitle(&$title)
{
/* ONLY ENFORCE NO SHOUTING FOR ONE GROUP */
$visitor = XenForo_Visitor::getInstance();
$noShout = $visitor->isMemberOf(11, true);
if (!$noShout)
{
return true;
}
/* ONLY ENFORCE NO SHOUTING FOR ONE GROUP */
// TODO: send these to callbacks to allow hookability?
switch ($this->getOption(self::OPTION_ADJUST_TITLE_CASE))
{
case 'ucfirst': // sentence case
$title = utf8_ucfirst(utf8_strtolower($title));
break;
case 'ucwords': // title case
$title = utf8_ucwords(utf8_strtolower($title));
break;
}
return true;
}