原贴:http://bbs.cn0797.cn/read.php?tid=417
离线(黑白)演示:http://bbs.cn0797.cn/read.php?tid=422
头像自动变换色彩(在线为彩色,离线为黑白)这个是为PW的。或许哪个高手可以参照这个代码修改一下改为DZ的。
期待中……
在线为彩色
离线为黑白
查找
require/bbscode.php
里面的
CODE:
function showfacedesign($usericon){
$user_a=explode('|',$usericon);
if (strpos($usericon,'<')!==false || empty($user_a[0]) && empty($user_a[1])){
return '<br><br>';
}
global $imgpath,$attachpath,$attachdir,$db_ftpweb;
if ($user_a[1]){
if(!ereg("^http",$user_a[1])){
if($db_ftpweb && !file_exists($attachdir.'/upload/'.$user_a[1])){
$user_a[1] = $db_ftpweb.'/upload/'.$user_a[1];
}else{
$user_a[1] = $attachpath.'/upload/'.$user_a[1];
}
}
if($user_a[2] && $user_a[3]){
return "<img src=\"$user_a[1]\" width=\"$user_a[2]\" height=\"$user_a[3]\" border=\"0\" />";
}else{
return "<img src=\"$user_a[1]\" border=\"0\" />";
}
} else {
return "<img src=\"$imgpath/face/$user_a[0]\" border=\"0\" />";
}
}
[Copy to clipboard]
替换为
CODE:
function showfacedesign($usericon){
$user_a=explode('|',$usericon);
if (strpos($usericon,'<')!==false || empty($user_a[0]) && empty($user_a[1])){
return '<br><br>';
}
global $imgpath,$attachpath,$attachdir,$db_ftpweb;
if ($user_a[1]){
if(!ereg("^http",$user_a[1])){
if($db_ftpweb && !file_exists($attachdir.'/upload/'.$user_a[1])){
$user_a[1] = $db_ftpweb.'/upload/'.$user_a[1];
}else{
$user_a[1] = $attachpath.'/upload/'.$user_a[1];
}
}
if($user_a[2] && $user_a[3]){
return "<img src=\"$user_a[1]\" width=\"$user_a[2]\" height=\"$user_a[3]\" border=\"0\" ";
}else{
return "<img src=\"$user_a[1]\" border=\"0\" ";
}
} else {
return "<img src=\"$imgpath/face/$user_a[0]\" border=\"0\" ";
}
}
[Copy to clipboard]
模板里的read.htm
查找$read[face]
替换为
CODE:
<!--
EOT;
if($read[face]=='<br><br>'){print <<<EOT
-->
$read[face]
<!--
EOT;
}elseif($db_showonline && $read[thisvisit]+$db_onlinetime*1.5>$timestamp){print <<<EOT
-->
$read[face] alt="该用户目前在线">
<!--
EOT;
}elseif($db_showonline){print <<<EOT
-->
$read[face] alt="该用户目前不在线" style='filter: Gray;'>
<!--
EOT;
}print <<<EOT
-->
[Copy to clipboard] |