kh99, I really appreciate the quick reply. That works like a charm. Post cache lifespan must be set to 0 for this to work, otherwise vbulletin caches the post contents and it isn't displayed correctly depending on the members login status.
Thank you for the tip, it looked simple for you, but I could barely call myself a hack so I didn't see the code in my head until you said it.
This is the code I used in the plugin, in case it may help anyone else:
Code:
$custom_bbcode = 'registered';
$this->tag_list['no_option'][$custom_bbcode] = array ();
$this->tag_list['no_option'][$custom_bbcode]['callback'] = 'handle_external';
$this->tag_list['no_option'][$custom_bbcode]['external_callback'] = 'handle_my_custom_bbcode';
if (!function_exists ('hide_message_for_registered_users')) {
function handle_my_custom_bbcode (&$theobj, &$value, &$option) {
if ($theobj->registry->userinfo['userid'])
return $value;
else
return "Unregistered members will see this";
}
}
I'm going to look at doing this based on usergroup ID next, and I'll try to figure that out myself... Unless someone else posts here with the php to do that first. I'm not sure which vbulletin variables I'd want to use, but I'll dig around a bit when I get a chance and post back once I figure that out also.