djdungcuty
Active Member
+Tên mod: BBCode 7 màu cho JohnCMS
+Tác giả: Lê Tiến Dũng
+Hướng dẫn:
B1. Mở incfiles/bbcode.php tìm:
Thêm bên dưới:
Tiếp tục dán code sau lên trên đoạn vừa tìm:
Xong nhé! Cách dùng: [7mau]Nội dung[/7mau]
Nguồn:
+Tác giả: Lê Tiến Dũng
+Hướng dẫn:
B1. Mở incfiles/bbcode.php tìm:
PHP:
function tags($var = '') {
PHP:
$var= preg_replace(array ('#\[7mau\](.*?)\[\/7mau\]#se'), array ("''.rainbow('$1').''"), str_replace("]\n", "]", $var));
Tiếp tục dán code sau lên trên đoạn vừa tìm:
PHP:
function rainbow($text) {
$text = trim(stripslashes($text));
$result="";
$font=0;
$turn=0;
while(
$font<=strlen($text)){ $font_color = mb_substr($text,$font,1,'UTF-8');
$font++;
if($turn==0){ $turn=1; $result.= "<FONT color=\"#ff00ff\">".$font_color."</FONT>"; }
else if($turn==1){ $turn=2; $result.= "<FONT color=\"#ff00cc\">".$font_color."</FONT>"; }
else if($turn==2){ $turn=3; $result.= "<FONT color=\"#ff0099\">".$font_color."</FONT>"; }
else if($turn==3){$turn=4; $result.= "<FONT color=\"#ff0066\">".$font_color."</FONT>"; }
else if($turn==4){$turn=5; $result.= "<FONT color=\"#ff0033\">".$font_color."</FONT>"; }
else if($turn==5){$turn=6; $result.= "<FONT color=\"#ff0000\">".$font_color."</FONT>"; }
else if($turn==6){$turn=7; $result.= "<FONT color=\"#ff3300\">".$font_color."</FONT>"; }
else if($turn==7){$turn=8; $result.= "<FONT color=\"#ff6600\">".$font_color."</FONT>"; }
else if($turn==8){$turn=9; $result.= "<FONT color=\"#ff9900\">".$font_color."</FONT>"; }
else if($turn==9){$turn=10; $result.= "<FONT color=\"#ffcc00\">".$font_color."</FONT>"; }
else if($turn==10){$turn=11; $result.= "<FONT color=\"#ffff00\">".$font_color."</FONT>"; }
else if($turn==11){$turn=12; $result.= "<FONT color=\"#ccff00\">".$font_color."</FONT>"; }
else if($turn==12){$turn=13; $result.= "<FONT color=\"#99ff00\">".$font_color."</FONT>"; }
else if($turn==13){$turn=14; $result .= "<FONT color=\"#66ff00\">".$font_color."</FONT>"; }
else if($turn==14){$turn=15; $result .= "<FONT color=\"#33ff00\">".$font_color."</FONT>"; }
else if($turn==15){$turn=16; $result .= "<FONT color=\"#00ff00\">".$font_color."</FONT>"; }
else if($turn==16){$turn=17; $result .= "<FONT color=\"#00ff33\">".$font_color."</FONT>"; }
else if($turn==17){$turn=18; $result .= "<FONT color=\"#00ff66\">".$font_color."</FONT>"; }
else if($turn==18){$turn=19; $result .= "<FONT color=\"#00ff99\">".$font_color."</FONT>"; }
else if($turn==19){$turn=20; $result .= "<FONT color=\"#00ffcc\">".$font_color."</FONT>"; }
else if($turn==20){$turn=21; $result .= "<FONT color=\"#00ffff\">".$font_color."</FONT>"; }
else if($turn==21){$turn=22; $result .= "<FONT color=\"#00ccff\">".$font_color."</FONT>"; }
else if($turn==22){$turn=23; $result .= "<FONT color=\"#0099ff\">".$font_color."</FONT>"; }
else if($turn==23){$turn=24; $result .= "<FONT color=\"#0066ff\">".$font_color."</FONT>"; }
else if($turn==24){$turn=25; $result .= "<FONT color=\"#0033ff\">".$font_color."</FONT>"; }
else if($turn==25){$turn=26; $result .= "<FONT color=\"#0000ff\">".$font_color."</FONT>"; }
else if($turn==26){$turn=27; $result .= "<FONT color=\"#3300ff\">".$font_color."</FONT>"; }
else if($turn==27){$turn=28; $result .= "<FONT color=\"#6600ff\">".$font_color."</FONT>"; }
else if($turn==28){$turn=29; $result .= "<FONT color=\"#9900ff\">".$font_color."</FONT>"; }
else if($turn==29){$turn=0; $result .= "<FONT color=\"#cc00ff\">".$font_color."</FONT>"; }
}
$result = html_entity_decode($result ,ENT_QUOTES,'UTF-8');
return $result;
}
Xong nhé! Cách dùng: [7mau]Nội dung[/7mau]
Nguồn:
HTML:
http://nhanhnao.mobi