
10-19-2006, 04:31 AM
|
 |
|
|
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Here's what I did on my site....
Quote:
I have it working for PHP on my board...
The problem is that posts are cached, meaning if you post it in style#1 as an administrator, it will be parsed and stored in the database (exactly what you saw for a given style). That condition no longer exists when you view it a second time. Kind of defeats the purpose of the templates, but oh well.
In the PHP bbcode template, there are comments you can use as reference points to alter the contents... Here is what I'm using:
PHP Code:
if (THIS_SCRIPT == 'showpost' or THIS_SCRIPT == 'showthread')
{
global $foruminfo;
if (
in_array($foruminfo['forumid'], array(1, 2, 3, 4, 5)) and
strpos($output, '<!-- php') !== false and
!is_member_of($vbulletin->userinfo, 5, 6, 10)
)
{
$pattern = '/<!-- php buffer start --><code>(.*?)<\/code><!-- php buffer end -->/s';
$output = preg_replace($pattern, '<span class="semihighlight">Only licensed users can view PHP code!</span>', $output);
}
}
It can probably be altered to run in the postbit factory, but I don't have time to mess around and get it as fast as possible. You'll have to alter the forumids, usergroupids, and also the replace text because that CSS class won't exist for you.
Using some common sense and copy pasting, you should be able to get it working for all of the templates (though you'll have to edit them).
- If anyone knows a better method let me know, because this isn't exactly an elegant work around.
|
|