📄 bbscode.php
字号:
$attachper && $message=preg_replace("/\[attachment=([0-9]+)\]/eis","upload('\\1')",$message,$db_cvtimes);
return $message;
}
function upload($aid){
global $attachments,$aids;
if($attachments[$aid]){
$aids[]=$aid;
return $attachments[$aid];
} else{
return "[attachment=$aid]";
}
}
function size($size,$code,$allowsize){
$allowsize && $size > $allowsize && $size = $allowsize;
return "<font size='$size'>$code</font>";
}
function cvurl($http,$url='',$name=''){
global $code_num,$code_htm;
$code_num++;
if(!$url){
$url="<a href='http://www.$http' target=_blank>www.$http</a>";
} elseif(!$name){
$url="<a href='$http$url' target=_blank>$http$url</a>";
} else{
$url="<a href='$http$url' target=_blank>$name</a>";
}
$code_htm[0][$code_num]=$url;
return "<\twind_code_$code_num\t>";
}
function nopic($url){
global $code_num,$code_htm,$imgpath,$stylepath;
$code_num++;
$code_htm[-1][$code_num]="<img src='$imgpath/$stylepath/file/img.gif' align='absbottom' border=0> <a target=_blank href='$url'>img: $url</a>";
return "<\twind_code_$code_num\t>";
}
function cvpic($url,$type='',$picwidth='',$picheight=''){
global $db_bbsurl,$picpath,$attachpath,$code_num,$code_htm;
$code_num++;
$lower_url=strtolower($url);
if(substr($lower_url,0,4)!='http')$url="$db_bbsurl/$url";
if(strpos($lower_url,'login')!==false && (strpos($lower_url,'action=quit')!==false || strpos($lower_url,'action-quit')!==false)){
$url=preg_replace('/login/i','log in',$url);
}
if($picwidth || $picheight){
$onload = "onload=\"";
$picwidth && $onload .= "if(this.width>'$picwidth')this.width='$picwidth';";
$picheight && $onload .= "if(this.height>'$picheight')this.height='$picheight';";
$onload .= "\"";
$code = "<img src='$url' border=0 onclick=\"if(this.width>=$picwidth) window.open('$url');\" $onload>";
} else{
$code = "<img src='$url' border=0 onclick=\"if(this.width>screen.width-461) window.open('$url');\">";
}
$code_htm[-1][$code_num]=$code;
if($type){
return $code;
} else{
return "<\twind_code_$code_num\t>";
}
}
function phpcode($code){
global $phpcode_htm,$codeid;
$code=str_replace("[attachment=","[attachment=",$code);
$codeid ++;
$phpcode_htm[$codeid]="<div style=\"font-size:9px;margin-left:5px\"><b>CODE:</b> [<a href=\"javascript:\" onclick=\"CopyCode(document.getElementById('code$codeid'));\">复制</a>]</div><div class=quote id='code$codeid'>$code</div>";
return "<\twind_phpcode_$codeid\t>";
}
function qoute($code){
global $code_num,$code_htm,$i_table;
$code_num++;
$code_htm[6][$code_num]="<div style=\"font-size:9px;margin-left:5px\"><b>QUOTE:</b></div><div class=quote>$code</div>";
return "<\twind_code_$code_num\t>";
}
function post($code){
global $SYSTEM,$postcode1,$postcode2,$attachper,$db,$tid,$fid,$winduid,$windid,$admincheck,$groupid,$tpc_author,$i_table;
global $code_num,$code_htm,$lang;
require_once GetLang('bbscode');
$code_num++;
$attachper=0;
$rs = $db->get_one("SELECT count(*) AS count FROM pw_posts WHERE tid='$tid' AND authorid='$winduid'");
if($rs['count']>0){
$havereply='yes';
}
if($admincheck==1 || $SYSTEM['viewhide'] || $havereply=='yes' || $tpc_author==$windid){
$attachper=1;
$code_htm[3][$code_num]=" $lang[bbcode_hide1]<br><div class=quote>{$code}</div>";
} else{
$code_htm[3][$code_num]="<br><br><div class=quote>$lang[bbcode_hide2]</div><br><br>";
}
return "<\twind_code_$code_num\t>";
}
function hiden($rvrc,$code){
global $hidecode1,$hidecode2,$hidecode3,$db,$groupid,$attachper,$userrvrc,$i_table;
global $code_num,$code_htm,$lang;
require_once GetLang('bbscode');
$code_num++;
$attachper=0;
if($groupid!='guest'){
global $admincheck,$userrvrc,$userpath,$windid,$tpc_author,$SYSTEM;
$rvrc=trim(intval(stripslashes($rvrc)));
if($windid!=$tpc_author && $userrvrc<$rvrc && $admincheck!=1 && !$SYSTEM['viewhide']){
$code="<div class=quote>{$lang[bbcode_encode1]}{$rvrc}</div>";
} else {
$attachper=1;
$code=" {$lang[bbcode_encode2]}<br><div class=quote>{$code}</div>";
}
} else{
$code=$lang['bbcode_encode3'];
}
$code_htm[4][$code_num]=$code;
return "<\twind_code_$code_num\t>";
}
function sell($moneycost,$code){
global $SYSTEM,$admincheck,$attachper,$windid,$tpc_author,$tpc_buy,$fid,$tid,$pid,$i_table,$manager,$groupid,$code_num,$code_htm,$lang,$db_credits,$db_bbsurl;
list($db_moneyname,,,,,)=explode("\t",$db_credits);
require_once GetLang('bbscode');
$code_num++;
$sellcheck=$attachper=0;
$moneycost = (int)$moneycost;
if($moneycost < 0){
$moneycost = 0;
}elseif ($moneycost > 1000){
$moneycost = 1000;
}elseif ($moneycost && !ereg("^[0-9]{0,}$",$moneycost)){
$moneycost = 0;
}
$userarray=explode(',',$tpc_buy);
foreach($userarray as $value){
if($value){
$count++;
$buyers.="<OPTION value=>".$value."</OPTION>";
}
}
!$count && $count=0;
if ($groupid!='guest'&& ($SYSTEM['viewhide'] || $admincheck || $tpc_author==$windid || ($userarray && @in_array($windid,$userarray)))){
$sellcheck=1;
}
$attachper=$sellcheck;
$bbcode_sell_info=str_replace(array('$moneycost','$db_moneyname','$count'),array($moneycost,$db_moneyname,$count),$lang['bbcode_sell_info']);
if($groupid!='guest' && $sellcheck==1){
$printcode=" <span class='bold'><font color='red'>{$bbcode_sell_info}</font></span><select name='buyers'><OPTION value=''>{$lang[bbcode_sell_buy]}</OPTION>$buyers</select><br><div class=quote>$code</div>";
}else{
$printcode="<br><span class='bold'><font color='red'>{$bbcode_sell_info}</font></span><select name='buyers'><OPTION value=''>{$lang[bbcode_sell_buy]}</OPTION><OPTION value=>-----------</OPTION>$buyers</select><input type='button' value='{$lang[bbcode_sell_submit]}' style='color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1' onclick=location.href='$db_bbsurl/job.php?action=buytopic&tid=$tid'><br><br><font color=red>{$lang[bbcode_sell_notice]}</font><br>";
}
$code_htm[5][$code_num]=$printcode;
return "<\twind_code_$code_num\t>";
}
function showfacedesign($usericon){
$user_a=explode('|',$usericon);
if (strpos($usericon,'<')!==false || empty($user_a[0]) && empty($user_a[1])){
return '<br><br>';
}
global $imgpath;
if ($user_a[1]){
if(!ereg("^http",$user_a[1])){
$user_a[1]="$imgpath/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>";
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -