Hi, I was wondering if it was possible to have more than one prefix for members to choose from, and also if there was some way to make the prefixes work when you click through from a category. Though the latter is more pressing than the former.
You will need to add functions similar to those ones for the categories (in the plugin):
/**
* Add prefix to discussion name in single discussion view
(vanilla/controllers/class.discussioncontroller.php)
*/
public function DiscussionController_BeforeDiscussionRender_Handler(&$Sender) {
if($Sender->Discussion->Prefixed == 1)
$Sender->Discussion->Name = C('Plugins.DiscussionPrefix.Prefix').' '.$Sender->Discussion->Name;
}
/**
* Add prefix to each discussion name in list view
*/
public function DiscussionsController_BeforeDiscussionName_Handler(&$Sender) {
if($Sender->EventArguments['Discussion']->Prefixed == 1)
$Sender->EventArguments['Discussion']->Name = ('Plugins.DiscussionPrefix.Prefix').' '.$Sender->EventArguments['Discussion']->Name;
}
Answers
Can you explain the latter further then? As much details and examples as you can, please :-)
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •This is what I mean, the prefix will show up just fine on the /discussions page, like so:
But if you look at the topics in their individual categories, there is no prefix
It doesn't matter which theme I use, it just doesn't work that way for some reason?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •You will need to add functions similar to those ones for the categories (in the plugin):
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Thanks, I'll have a look at that, I guess.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •