Quote:
Originally Posted by Dismounted
Yes, but he wants it in a specific thread.
|
yes exactally. Is there a way to put some template stuff like that in a post if you are a moderator?
--------------- Added at 12:32 ---------------
I made this quick hack to use a [usersonly] bb code tag for this. It just goes like this:
PHP Code:
/***********************************************************
This is Andrews section for a custom [usersonly] bb code tag
************************************************************/
if (false !== strpos($post['pagetext'], '[usersonly]') && false !== strpos($post['pagetext'], '[/usersonly]'))
{
session_start();
if (!empty($_SESSION['user']['user']['logged_in']))
{
$post['pagetext'] = str_replace('[usersonly]', '', $post['pagetext']);
$post['pagetext'] = str_replace('[/usersonly]', '', $post['pagetext']);
}
else
{
$post['pagetext'] = preg_replace('#\[usersonly\](.*)\[/usersonly\]#', '*You must be logged in to view this*', $post['pagetext']);
}
$post['pagetext_html'] = '';
}
/***********************************************************
End Andrews section for a custom [usersonly] bb code tag
************************************************************/
And I put that in the appropriate places for viewing in hybrid mode, threaded, and regular. Is there an easier way to do this or not because this hack seams like a bit too much.