  BBCODE  .     .

:
[sub][/sub] -  ,   <sub>;
[sup][/sup] -  ,   <su>;
[*] -   <li/>;
[hr] -  ;
[offtop][/offtop] -  ;
[color=][/color] -  ,    ;
[hide][/hide] -      ;

[ghide][/ghide] -    ,      ;

       incfiles/func.php

[php]
	//     tags()
	$var = preg_replace('#\[color=([\#a-zA-Z0-9]{20})\](.*?)\[/color\]#si', '<span style="color:\1">\2</span>', $var);
    $var = preg_replace('#\[sub\](.*?)\[/sub\]#si', '<span style="vertical-align:sub">\1</span>', $var);
    $var = preg_replace('#\[sup\](.*?)\[/sup\]#si', '<span style="vertical-align:super">\1</span>', $var);
    $var = preg_replace('#\[offtop\](.*?)\[/offtop\]#si', '<div style="color:#ccc;margin:1px;padding:2px;border:1px dashed #ccc">\1</div>', $var);
    $var = preg_replace_callback('#\[hide\](.*?)\[/hide\]#si', 'bbHide', $var);
    $var = preg_replace_callback('#\[ghide\](.*?)\[/ghide\]#si', 'bbGHide', $var);
    $var = preg_replace('#\[\*\]#si', '<li/>', $var);
    $var = preg_replace('#\[hr\]#si', '<hr style="margin:2px;border:0;border-bottom:1px dashed #aaa"/>', $var);
[/php]

[php]
	//    notags(),   
	$var = strtr($var, array('[green]' => '', '[/green]' => '', '[red]' => '', '[/red]' => '', '[blue]' => '', '[/blue]' => '', '[b]' => '', '[/b]' => '', '[i]' => '', '[/i]' => '', '[u]' => '', '[/u]' => '', '[s]' => '', '[/s]' => '',
    '[c]' => '', '[/c]' => '', '[*]' => '', '[hr]' => ''));
    $var = preg_replace('{\[color=(?:.+?)\](.*?)\[/color\]}si','\1',$var);
	$var = preg_replace('{\[sub\](.*?)\[/sub\]}si','(sub:\1)',$var);
    $var = preg_replace('{\[sup\](.*?)\[/sup\]}si','(sup:\1)',$var);
    $var = preg_replace('{\[offtop\](.*?)\[/offtop\]}si','(\1)',$var);
    $var = preg_replace('{\[hide\](.*?)\[/hide\]}si','',$var);
    $var = preg_replace('{\[ghide=(.*?)\](.*?)\[/ghide\]}si','',$var);
[/php]

[php]
//    tags()  
function w_gHide($gh){
	// gHide valid finction by SunRise
	//     
	global $user_id, $rights;
	if(preg_match('#\[ghide=(.*?)\](.*?)\[\/ghide\]#si',$gh))
	{
	    if($rights>=3)
	    {
            return $gh;
	    }
	    else
	    {
	    	return '[ !]';
	  	}
	}
	elseif(preg_match('#\[ghide\](.*?)\[\/ghide\]#si',$gh))
	{
		return preg_replace('#\[ghide\](.*?)\[\/ghide\]#si', '[ghide=' . $user_id . ']\1[/ghide]', $gh);
	}
	else
	{
		return $gh;
	}
}

function e_gHide($gh){
	// gHide valid finction by SunRise
	//       
	global $user_id, $rights;
	if(preg_match('#\[ghide=(.*?)\](.*?)\[\/ghide\]#si',$gh))
	{
	    if($rights>=3)
	    {
            return preg_replace('#\[ghide=(.*?)\](.*?)\[\/ghide\]#si', '[ghide=\1]\2[/ghide]', $gh);
	    }
	    else
	    {
	    	return preg_replace('#\[ghide=(?:.*?)\](.*?)\[\/ghide\]#si', '[ghide]\1[/ghide]', $gh);
	  	}
	}
	else
	{
		return $gh;
	}
}

function bbHide($hide) {
	// Hide finction by SunRise
	global $user_id;
	if(!$user_id)
	{
		return '<div style="background:#EAF1F4;border:1px solid #84BEE6;color:#2383A3;margin:2px;padding:2px"> !     .</div>';
	}
	else
	{
		return '<div style="background:#EAF1F4;border:1px solid #84BEE6;color:#2383A3;margin:2px;padding:2px">' . $hide[1] . '</div>';
	}
}

function bbGHide($ghide) {
	// gHide function by SunRise
	global $user_id, $rights;
 	if($user_id && $user_id == $ghide[1] || $rights>=3)
	{
		return '<div style="background:#FFDFD7;border:1px solid #CF3603;color:#B62703;margin:2px;padding:2px">' . $ghide[2] . '</div>';
	}
	else
	{
		return '<div style="background:#FFDFD7;border:1px solid #CF3603;color:#B62703;margin:2px;padding:2px"> !        .</div>';
	}
}
[/php]

 2     gHide .
1. w_gHide() -         .
2. e_gHide() -              .

         

//  SunRise www.XSCLUB.ru
//          ;)