detecti41258
|
分享:
▲
▼
好! 要有膽量,現在公佈我的繁體中文論壇程式編碼。 我不知道為什麼會變空白? global.php 複製程式
<?php
$t_array=explode(' ',microtime());
$P_S_T=$t_array[0]+$t_array[1];
error_reporting(0);
define('R_P','./');
set_magic_quotes_runtime(0);
unset($_ENV,$HTTP_ENV_VARS,$_REQUEST,$HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_POST_FILES,$HTTP_COOKIE_VARS);
if(!get_magic_quotes_gpc()){
Add_S($_POST);
Add_S($_GET);
Add_S($_COOKIE);
}
if(!ini_get('register_globals')){
@extract($_COOKIE,EXTR_SKIP);
@extract($_FILES,EXTR_SKIP);
}
foreach($_POST as $_key=>$_value){
$_POST[$_key]=str_replace('$','$',$_POST[$_key]);
!ereg("^\_",$_key) && $$_key=$_POST[$_key];
}
foreach($_GET as $_key=>$_value){
$_GET[$_key]=str_replace('$','$',$_GET[$_key]);
!ereg("^\_",$_key) && $$_key=$_GET[$_key];
}
if(!($REQUEST_URI=$_SERVER['REQUEST_URI'])){
$REQUEST_URI=$_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
}
if($_SERVER['HTTP_CLIENT_IP']){
$onlineip=$_SERVER['HTTP_CLIENT_IP'];
}elseif($_SERVER['HTTP_X_FORWARDED_FOR']){
$onlineip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$onlineip=$_SERVER['REMOTE_ADDR'];
}
$onlineip =substrs($onlineip,16);
$wind_version="1.3.6";
$db_olsize=96;
require_once(R_P.'data/bbscache/config.php');
require_once(R_P.'data/bbscache/dbset.php');
require_once(R_P.'data/sql_config.php');
$db_obstart==1 ? ob_start('ob_gzhandler') : ob_start();
$db_http!='N' ? $imgpath=$db_http:$imgpath='./'.$picpath;
if ($db_bbsifopen==0){
if (!$_COOKIE['windadminid'] || $_COOKIE['windadminid']!=$manager){
Showmsg($db_whybbsclose,1,2);
}
}
$timestamp=time();
if($db_cvtime!=0) $timestamp+=$db_cvtime*60;
$cookietime = $timestamp+31536000;
$td=floor($timestamp/3600);
$t=getdate($timestamp);
$tdtime=$td*3600-$t['hours']*3600;
$addontime=0;
$onbbstime=$timestamp-$lastvisit;
if($onbbstime<3600 && $db_ifonlinetime){
$addontime=1;
}
/*
* you can select styles with skin or cookie setting
*/
$_COOKIE['skinco'] && empty($skin) && $skin=$_COOKIE['skinco'];
$runfc='N'
if($timestamp-$lastvisit>$db_onlinetime || ($fid && $fid!=$_COOKIE['lastfid'])||($_COOKIE['lastfid']!='' && $wind_in=='hm')){
$runfc='Y'
Cookie('lastfid',$fid);
require_once("./require/userglobal.php");
}
require_once('./require/db_'.$database.'.php');
$db = & new DB($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$winduid=$_COOKIE['winduid'];//Add_S
$windpwd=$_COOKIE['windpwd'];
if($winduid && strlen($windpwd)>=16){
$winddb=User_info();
$groupid=$winddb['groupid'];
$userrvrc=floor($winddb['rvrc']/10);
$windid=$winddb['username'];
} else{
$groupid='guest'unset($winddb);$windid=''$winduid=''
}
Ipban();
if ($db_refreshtime!=0){
if($REQUEST_URI==$_COOKIE['lastpath'] && $onbbstime<$db_refreshtime){
Showmsg("論壇設置:刷新不要快於{$db_refreshtime}秒");
}
Cookie('lastpath',$REQUEST_URI);
}
Cookie('lastvisit',$timestamp);
if(isset($_COOKIE['pwdcheck']) && $groupid=='guest') Cookie('pwdcheck','',0);
if($groupid=='-1'){
$groupid=$winddb['memberid'];
}
if($groupid!='guest'){
if(file_exists(R_P."data/groupdb/group_$groupid.php")){
require_once(R_P."data/groupdb/group_$groupid.php");
}else{
require_once(R_P."data/groupdb/group_1.php");
}
} else{
require_once(R_P."data/groupdb/group_2.php");
}
if($db_ads && (is_numeric($u) || ($a && strlen($a)<16))){
require_once('./require/userads.php');
}
function Add_S(&$array){
if(!get_magic_quotes_gpc()){
foreach($array as $key=>$value){
if(!is_array($value)){
$array[$key]=addslashes($value);
}else{
Add_S($array[$key]);
}
}
}
}
function Char_cv($msg){
$msg = str_replace('&','&',$msg);
$msg = str_replace(' ',' ',$msg);
//if(strpos($msg," ")===false){
// $msg = str_replace('&','&',$msg);/*對技術論壇有效*/
//}
$msg = str_replace('"','"',$msg);
$msg = str_replace("'",''',$msg);
$msg = str_replace("\t"," ",$msg);
$msg = str_replace("<","<",$msg);
$msg = str_replace(">",">",$msg);
$msg = str_replace("\r","",$msg);
$msg = str_replace(" "," ",$msg);#編輯格式時比較有效
return $msg;
}
function Showmsg($msg_info,$url='',$time=1){
@extract($GLOBALS, EXTR_SKIP);
global $stylepath,$tablewidth,$mtablewidth,$tplpath,$runfc;
$runfc=''
require_once("./header.php");
$msg_guide=headguide("論壇提示");
include PrintEot('showmsg');
exit;
}
function Cookie($ck_Var,$ck_Value,$ck_Time='F'){
global $cookietime,$db_ckpath,$db_ckdomain;
if($ck_Time=='F') $ck_Time = $cookietime;
setCookie($ck_Var,$ck_Value,$ck_Time,$db_ckpath,$db_ckdomain);
}
function Ipban(){
global $db_ipban,$windid,$onlineip,$imgpath,$stylepath;
if($db_ipban){
$baniparray=explode(",",$db_ipban);
foreach($baniparray as $banip){
if(!$banip)continue;
$banip=trim($banip);
if(strpos($onlineip,$banip)!==false){
Showmsg("您的IP被禁止,不能進去論壇");
}
}
}
}
function readover($filename,$method="rb"){
if($handle=@fopen($filename,$method)){
flock($handle,LOCK_SH);
$filedata=fread($handle,filesize($filename));
fclose($handle);
}
return $filedata;
}
function writeover($filename,$data,$method="rb+",$iflock=1){
touch($filename);
$handle=fopen($filename,$method);
if($iflock){
flock($handle,LOCK_EX);
}
fputs($handle,$data);
if($method=="rb+") ftruncate($handle,strlen($data));
fclose($handle);
}
function openfile($filename){
$filedata=readover($filename);
$filedata=str_replace("\n","\n<:wind:>",$filedata);
$filedb=explode("<:wind:>",$filedata);
$count=count($filedb);
if($filedb[$count-1]==''||$filedb[$count-1]=="\r"){unset($filedb[$count-1]);}
if(empty($filedb)){$filedb[0]="";}
return $filedb;
}
function PrintEot($template,$EXT="htm"){
global $tplpath;
if(!$template) $template=N;
file_exists("./template/$tplpath/$template.$EXT")?$path="./template/$tplpath/$template.$EXT":$path="./template/wind/$template.$EXT";
return $path;
}
function Update_ol(){
global $runfc;
if($runfc=='Y'){
global $windid,$ol_offset,$winduid;
if($windid!=''){
$alt_offset=addonlinefile($ol_offset,$winduid);
}else{
$alt_offset=addguestfile($ol_offset);
}
if($alt_offset!=$ol_offset)Cookie('ol_offset',$alt_offset,0);
$runfc=''
}
}
function footer(){
global $db,$db_obstart,$db_footertime,$P_S_T,$mtablewidth,$footbg,$db_ceoconnect,$wind_version,$imgpath;
Update_ol();
if($db){
$qn=$db->query_num;
}
$db_obstart==1 ? $ft_gzip="Gzip enabled":$ft_gzip="Gzip disabled";
if ($db_footertime==1){
$t_array=explode(' ',microtime());
$totaltime=number_format(($t_array[0]+$t_array[1]-$P_S_T),6);
$wind_spend="Processed in $totaltime second(s),query:$qn";
}
include PrintEot('footer');
flush;
exit;
}
function headguide($guidename=array(),$guide=''){
global $db_bbsname,$imgpath,$stylepath,$tablewidth,$fid,$jinhua;
$homepic = "<img src='$imgpath/$stylepath/index/home.gif' align=absbottom>";/*為導航的圖片檔案*/
$headguide="<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center><tr><td align=left>$homepic <span class=bold><a href='index.php'>$db_bbsname </a>";
if(is_array($guidename)){
foreach($guidename as $key=>$value){
if($key){
$headguide.=$value ? " -> <a href='$value'>$key</a>" : " -> $key";
}
}
} else{
$headguide.=" -> ".$guidename;
}
$headguide.="</span></td><td align=right><span class=bold>$guide</span></td></tr><tr><td height=5></td></tr></table><br>";
return $headguide;
}
function refreshto($URL,$content,$statime=1){
extract($GLOBALS, EXTR_SKIP);
if($db_ifjump && $statime>0){
ob_end_clean();
global $tplpath;/*模版目錄變量*/
$db_obstart==1 ? ob_start('ob_gzhandler') : ob_start();
$db_http!='N' ? $imgpath=$db_http:$imgpath=$picpath;
if (empty($skin)) $skin=$db_defaultstyle;
if(file_exists(R_P."data/style/$skin.php") && strpos($skin,'..')===false){
include_once(R_P."data/style/$skin.php");
}else{
include_once(R_P."data/style/wind.php");
}
@require PrintEot('css');
@require PrintEot('refreshto');
exit;
} else{
header("Location: $URL");
}
}
function dtchange($user,$wwz,$postn,$money){
global $db;
$user=='guest'||$db->update("UPDATE pw_members SET postnum=postnum+'$postn',rvrc=rvrc+'$wwz',money=money+'$money' WHERE username='$user'");
}
function User_info(){
global $db,$timestamp,$db_onlinetime,$winduid,$windpwd,$addontime,$onbbstime,$onlineip,$db_ipcheck;
$detail =$db->get_one("SELECT uid,username,email,groupid,memberid,regdate,postnum,rvrc,money,thisvisit,lastpost,todaypost,yz,attach,onlineip,newpm FROM pw_members WHERE uid='$winduid' AND password='$windpwd'");
if(strpos($detail['onlineip'],$onlineip)===false){
$iparray=explode(".",$onlineip);
if(strpos($detail['onlineip'],$iparray[0].'.'.$iparray[1])===false) $loginout='Y'
}
if(!$detail || ($loginout=='Y' && $db_ipcheck==1)){
require_once('./require/checkpass.php');
Loginout();
$detail['groupid']='guest'
}else{
$timestamp-$detail['thisvisit']>$db_onlinetime ? $ct="lastvisit=thisvisit,thisvisit='$timestamp'" : $cg=''
if($addontime==1){
$oltime=$detail['onlinetime']+$onbbstime;
$co="onlinetime='$oltime'";
$ct && $co=','.$co;
}else{
$co=''
}
if($ct || $co){
$db->update("UPDATE pw_members SET $ct $co WHERE uid='$winduid' AND password='$windpwd'");
}
}
return $detail;
}
function substrs($content,$length) {
if(strlen($content)>$length){
$num=0;
for($i=0;$i<$length-3;$i++) {
if(ord($content[$i])>127)$num++;
}
$num%2==1 ? $content=substr($content,0,$length-4):$content=substr($content,0,$length-3);
$content.=' ..'
}
return $content;
}
function getmemberid($nums){
global $db,$lneed;
arsort($lneed);
$gid=array_pop(array_flip($lneed));
reset($lneed);
foreach($lneed as $key=>$lowneed){
if($nums>=$lowneed){
$gid=$key;
break;
}
}
return $gid;
}
function get_date($timestamp,$cvtime=0,$timeformat='Y-m-d H:i'){
//$db_timeformat
return date($timeformat,$timestamp+$cvtime);
}
//論壇銀行function--start HACK BY GUBO1474
function getmoneygroup($money = 0 ){
global $banksettings,$bankgroup;
if (!$banksettings['groups'] or !$bankgroup){
return "保密";
}else{
foreach($bankgroup as $group) {
if ($money >= $group['min'] && $money< $group['max'])
return $group['name'];
}
}
}
function submitcheck($var, $allowget = 0) {
if($var) {
global $HTTP_SERVER_VARS;
$referer = parse_url($HTTP_SERVER_VARS['HTTP_REFERER']);
$checkserver =$referer['port']?$referer['host'].":".$referer['port']:$referer['host'];
if($allowget || (!$allowget && $HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST' && $checkserver == $HTTP_SERVER_VARS['HTTP_HOST'])) {
return $var;
} else {
Showmsg('undefined_action');
}
} else {
return FALSE;
}
}
//論壇銀行function--end HACK BY GUBO1474
?> lin_uploadface.php 複製程式
<?php
//會員頭像上傳程序(2004-5-31) by yangtou,參考了lilin寫的Face upload for ofstar程序
require './global.php'
require './header.php'
$facesize=50000;
$facewidth=150;
$faceheight=200;
$customfacepath="customface";
$forumpath=dirname($_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI']:$_SERVER['PHP_SELF']);
if ($forumpath=='\\' or $forumpath=='/') $forumpath=''
$forumpath .='/'
$fullpath="[url]http://".$_SERVER[/url]['HTTP_HOST'].$forumpath;
$msg_guide=headguide('上傳頭像','用戶資料');
$username=$windid;
$windid=rawurlencode($windid);
if ($groupid=='guest')
{
$msg_guide=headguide('你正處在論壇的會員資料','用戶資料');
$msg_info='對不起!!,你還沒有登入或注冊,不能查看會員資料!!'
include PrintEot('showmsg');
}
else
{
if($action == "uploadface")
{
$filename_info = explode('.',$_FILES[uploadFile][name]);
$fileext = $filename_info[count($filename_info)-1];
$name=$timestamp.".".$fileext;
$uploadFile = $_FILES[uploadFile][tmp_name];
$size = $_FILES[uploadFile][size];
$type=$_FILES[uploadFile]['type'];
list($tmp_type,$tmp_type_detail)=explode("/",$type);
if("image"==$tmp_type)
{
$tmp=GetImageSize($uploadFile);
if (($tmp[0]>=$facewidth)||($tmp[1]>=$faceheight))
{
refreshto( $GLOBALS["PHP_SELF"]."?username=&windid&dir_icon=$dir_icon","您好,圖片的長度要小於".$facewidth.",寬度要小於".$faceheight.",請多看一遍注意事項,謝謝!5秒鐘後自動跳轉到前一頁",5);
exit;
}
}
else
{
refreshto( $GLOBALS["PHP_SELF"]."?username=&windid&dir_icon=$dir_icon","您好,仔細多看注意事項,檔案類型不符合!5秒鐘後自動跳轉到前一頁",5);
exit;
}
if ($size>=$facesize)
{
refreshto( $GLOBALS["PHP_SELF"]."?username=&windid&dir_icon=$dir_icon","您好,仔細多看注意事項,文件文件超過".$facesize."啦!5秒鐘後自動跳轉到前一頁",5);
exit;
}
move_uploaded_file($uploadFile,"./$customfacepath/$part$name");
if( $_FILES[uploadFile][error] == "0")
{
echo "頭像上傳完成。";
}
else if( $_FILES[uploadFile][error] == "1")
{
echo "上傳的檔案超過了 php.ini 中 upload_max_filesize 限制的容量。";
}
else if( $_FILES[uploadFile][error] == "2")
{
echo "上傳檔案的大小超過了 HTML 表單中 MAX_FILE_SIZE 限制的容量。";
}
else if( $_FILES[uploadFile][error] == "3")
{
echo "檔案只有部分上傳。";
}
else if( $_FILES[uploadFile][error] == "4")
{
echo "沒有檔案上傳。";
}
$icon=addslashes("|$fullpath$customfacepath/$part$name|$tmp[0]|$tmp[1]");
//echo "UPDATE pw_members SET icon='$icon' WHERE username='$username'";
$db->update("UPDATE pw_members SET icon='$icon' WHERE username='$username'");
$face =$fullpath."/$customfacepath/".$part."".$name;
}
include PrintEot('lin_uploadface');
}
?> profile.php 複製程式
<?php
require_once('./global.php');
require_once('./require/bbscode.php');
include_once(R_P.'data/bbscache/level.php');
//require './require/windxiu.php'//插件形象
if ($groupid=='guest'){
Showmsg('您還沒有登入或註冊,無法查看用戶資料');
}
if (empty($action)) $action='modify'
if ($action=='show'){
if($uid){
$sql="uid='$uid'";
} else{
$sql="username='$username'";
}
$userdb = $db->get_one("SELECT * FROM pw_members WHERE $sql");
//$credit=$db->query("SELECT m.value,c.name,c.description FROM pw_membercredit m LEFT JOIN pw_credits c ON c.cid=m.cid WHERE uid='$userdb[uid]'");
if(!$userdb) {
Showmsg('狀態:發生錯誤,您所指定的用戶不存在');
} else{
$userdb['rvrc']=floor($userdb['rvrc']/10);
}
if ($userdb['site'] && strpos($userdb['site'],"://")==false){
$userdb['site']="[url]http://$userdb[/url][site]";
}
if($userdb['groupid']=='-1'){
$systitle=''
} else{
$systitle=$ltitle[$userdb['groupid']];
}
isset($ltitle[$userdb['memberid']]) && $memtitle=$ltitle[$userdb['memberid']];
require_once('./header.php');
$msg_guide=headguide('用戶資料');
/*
*插件形象
*/
/*if($$userdb['xuni']==1)
$usericon=getwindxiu($userdb['username'],$postxuni,140,226);
else
{
if ($userdb['icon']=="")
$usericon="<img src=\"$imgpath/face/0.gif\" width=%70>";
else*/
$usericon=showfacedesign($userdb['icon']);
//}
$ifinbbs=($userdb['thisvisit']+$db_onlinetime*1.5>$timestamp ? "在線" : "離線");
$rawauthor=rawurlencode($userdb['username']);
if ($userdb['publicmail']==1){
$sendemail="<a href=sendemail.php?username=$rawauthor>$userdb[email]</a>";
} else{
$sendemail="<a href=sendemail.php?username=$rawauthor>給{$userdb['username']}發郵件</a>";
if($windid==$manager)
$sendemail.="( $userdb[email] )";
}
$logininfo=explode('|',$userdb['onlineip']);
$lasttime=date("Y-m-d",$userdb['lastvisit']);
$posttime ? $posttime=date("Y-m-d",$userdb['lastpost']) : $posttime="x";
if(!$userdb['todaypost']||$userdb['lastpost']<$tdtime) $userdb['todaypost']=0;
$averagepost=floor($userdb['postnum']/(ceil(($timestamp-$userdb['regdate'])/(3600*24))));
$show_regdate=date("Y-m-d",$userdb['regdate']);
if($userdb['gender']==1){
$usersex="男";
} elseif($userdb['gender']==2){
$usersex="女";
} elseif($userdb['gender']=='none'){
$usersex="不公佈";
}
if(!$userdb['bday'])$userdb['bday']="未寫";
$tempsign=convert($userdb['signature'],$db_windpic,2);
$tempintroduce=$userdb['introduce'];
if($userdb['honor']) $honorlevel="<tr><td class=f_one>頭銜:</td><td class=f_one>$userdb[honor]</td></tr>";
if($userdb['onlinetime'] && $db_ifonlinetime) {
$useronlinetime=floor($userdb['onlinetime']/3600);
$printonlinetime="<tr><td class=f_one>在線時間:</td><td class=f_one>$useronlinetime 小時</td></tr>";
}
require_once(PrintEot('showuserdb'));footer();
}
if ($action=="modify"){
$userdb = $db->get_one("SELECT * FROM pw_members WHERE uid=$winddb[uid]");
if (empty($_POST['step'])){
require_once('./header.php');
$msg_guide=headguide("用戶資料");
if($userdb['publicmail']) $ifchecked="checked";
$fp=opendir(R_P."data/style/");
if(!empty($_COOKIE['skinco'])){
$selected[$skinco]='selected'
} else{
$selected[$db_defaultstyle]='selected'
}
/**/
while ($skinfile=readdir($fp)){
if (eregi("\.php$",$skinfile)) {
$skinfile=str_replace(".php","",$skinfile);
$choseskin.="<option value=$skinfile $selected[$skinfile]>$skinfile</option>";
}
}
closedir($fp);
//*/
/*
$query=$db->query("SELECT name FROM pw_styles");
while(@extract($db->fetch_array($query))){
$choseskin.="<option value=$name $selected[$name]>$name</option>";
}
//*/
if($db_signwindcode){
$windcode="<br><a href='faq.php?faqjob=3#1'> Wind Code 開啟</a>";
if ($db_signwindcode){
$db_windpic['pic'] ? $windcode.="<br> [img] - 開啟" : $windcode.="<br> [img] - 關閉";
$db_windpic['flash'] ? $windcode.="<br> [flash] - 開啟" : $windcode.="<br> [flash] - 關閉";
}
} else{
$windcode="<br><a href='faq.php?faqjob=3#1'>Wind Code</a>關閉";
}
$iconarray=explode('|',$userdb['icon']);
if(!$gp_allowportait){
$portait="<br> <span class=bold>自定義頭像:</span>- 您所處的用戶組無權限";
} else{
$portait="<br> <span class=bold>自定義頭像:</span>- 被管理員開啟";
$portait2="<br>圖片網址︰<input name=proownportait[0] value='$iconarray[1]' type=text size=35 >輸入完整的 URL 路徑。<input type=button value=上傳頭像 onclick=window.location=('lin_uploadface.php?username=$windid')><br>圖像寬度︰<input name=proownportait[1] value='$iconarray[2]' type=text size=2 maxlength=3 >必須是 0 -- 150 之間的一個整數。<br>圖像高度︰<input name=proownportait[2] value='$iconarray[3]' type=text size=2 maxlength=3 >必須是 0 -- 200 之間的一個整數。</td></tr>";
}
$sexselect[$userdb['gender']]="selected";
$getbirthday = explode("-",$userdb['bday']);
$yearslect[(int)$getbirthday[0]]="selected";
$monthslect[(int)$getbirthday[1]]="selected";
$dayslect[(int)$getbirthday[2]]="selected";
//$userdb['introduce']=str_replace('<br />',"\n",$userdb['introduce']);
//$userdb['signature']=str_replace('<br />',"\n",$userdb['signature']);
if(ereg("^http",$picpath)){
$picpath=basename($picpath);//如果您將圖片路徑更名為其他伺服器上的圖片,請務必保持圖片目錄同名,否則出錯不在程序bug 之內
if(!file_exists($picpath))
$imgpatherror="--圖片路徑發生錯誤,請到後台更正您的圖片路徑為與您論壇圖片保存的目錄";
}
$img=@opendir("$picpath/face");
if(!$iconarray[0])$iconarray[0]='none.gif'
$iconselect=$iconarray[0];
while ($imagearray=@readdir($img)){
if ($imagearray!="." && $imagearray!=".." && $imagearray!="" && $imagearray!="none.gif"){
if ($imagearray==$iconarray[0])
$imgselect.= "<option selected value='$imagearray'>$imagearray</option>";
else
$imgselect.="<option value='$imagearray'>$imagearray</option>";
}
}
@closedir($img);
$userdb['receivemail']?$email_open='checked':$email_close='checked'
require_once(PrintEot('profile'));footer();
} elseif($_POST['step']==2){
$check=1;
if (!empty($propwd)||$userdb['email']!=$proemail){
if($propwd && $windid==$manager){
showmsg("開創人密碼請到控制台修改");
}
$oldpwd=md5($oldpwd);
if(strlen($userdb['password'])==16){
$oldpwd=substr($oldpwd,8,16);/*支持 16 位 md5截取密碼*/
}
if($userdb['password']!=$oldpwd){
Showmsg("密碼驗證失敗");
}
}
$userdb['yahoo']=Char_cv($proyahoo);
$userdb['msn']=Char_cv($promsn);
$userdb['email']=$proemail;
$userdb['oicq']=$prooicq;
$userdb['icq']=$proicq;
$userdb['site']=$prohomepage;
$userdb['gender']=$progender;
$userdb['location']=$profrom;
$userdb['signature']=$prosign;
$userdb['introduce']=$prointroduce;
if (!empty($propwd)){
$propwd!=$check_pwd && showmsg('兩次輸入密碼不一致,請重先輸入');
$userdb['password']=$propwd;
$userdb['password']=str_replace("\t","",$userdb['password']);
$userdb['password']=str_replace("\r","",$userdb['password']);
$userdb['password']=str_replace("\n","",$userdb['password']);
$userdb['password']=md5($userdb['password']);
}
$userdb['publicmail'] =$propublicemail;
$userdb['receivemail']=$proreceivemail;
if($gp_allowportait && !empty($proownportait[0])){
$proownportait[0]=Char_cv($proownportait[0]);
if(strtolower(substr($proownportait[0],0,4))!='http'){
$msg_info="自定義頭像URL必須以 http 開頭"; $check=0;
}
if (strrpos($proownportait[0],'|')!==false) {
$msg_info="自定義頭像不可包含此字符'|',請使用正常URL"; $check=0;
}
if (!ereg("^[0-9]{2,3}$",$proownportait[1]) || !ereg("^[0-9]{2,3}$",$proownportait[2]) || $proownportait[1]>150 || $proownportait[1]<0 || $proownportait[2]>200 ||$proownportait[2]<0) {$msg_info="您自定義的圖片必須在(0-150)*(0-200)的大小範圍裡"; $check=0;}
}
$userdb['icon']=$proicon.'|'.$proownportait[0].'|'.(int)$proownportait[1].'|'.(int)$proownportait[2];
if (strrpos($userdb['password'],"|")!==false || strrpos($userdb['password'],"<")!==false || strrpos($userdb['password'],">")!==false){
$msg_info="密碼包含不可接受字符,請使用英文和數字";
$check=0;
}
if (!ereg("^[-a-zA-Z0-9_\.]+\@([0-9A-Za-z][0-9A-Za-z-]+\.)+[A-Za-z]{2,5}$",$userdb['email'])) {
$msg_info="信箱不符合檢查標準,請確認沒有錯誤";
$check=0;
}
if (!ereg("^[0-9]{0,}$",$userdb['oicq'])){
$msg_info="OICQ號碼不正確";
$check=0;
}
if (!ereg("^[0-9]{0,}$",$userdb['icq'])){
$msg_info="ICQ號碼不正確";
$check=0;
}
if (strlen($userdb['signature'])>$gp_signnum && $gp_signnum!=0){
$msg_info="簽名不可超過 $gp_signnum 字節";
$check=0;
}
if (strlen($userdb['introduce'])>500){
$msg_info="自我簡介不可超過500";
$check=0;
}
if(@include_once(R_P."data/bbscache/wordsfb.php")){
if($wordsfb){
while (list($key,$value)=each($wordsfb)){
if (strpos($userdb['signature'],$key) != false){
$msg_info="簽名可能有非法言論或是法*功內容";
$check=0;
}
}
}
}
if(!empty($proyear)||!empty($proyear)||!empty($proyear)){
$userdb['bday']=$proyear."-".$promonth."-".$proday;
}
$userdb['site'] =Char_cv($userdb['site']);
$userdb['introduce']=Char_cv($userdb['introduce']);
$userdb['signature']=Char_cv($userdb['signature']);
$userdb['location'] =Char_cv($userdb['location']);
$lxsign=convert($userdb['signature'],$db_windpic,2);
if($lxsign==$userdb['signature']){
$userdb['signchange']=1;
} else{
$userdb['signchange']=2;
}
if($gp_allowhonor) {
$prohonor=Char_cv($prohonor);
}
if ($check==0){
Showmsg($msg_info);
} else{
$db->update("UPDATE pw_members SET password ='$userdb[password]',email='$userdb[email]',honor='$prohonor',publicmail='$userdb[publicmail]',icon='$userdb[icon]',gender='$userdb[gender]',signature='$userdb[signature]',introduce='$userdb[introduce]',oicq='$userdb[oicq]',icq='$userdb[icq]',yahoo='$userdb[yahoo]',msn='$userdb[msn]',site='$userdb[site]',location='$userdb[location]',bday='$userdb[bday]',receivemail='$userdb[receivemail]',signchange='$userdb[signchange]' WHERE uid='$winduid'");
if(($_COOKIE['skinco'] || $tpskin!=$db_defaultstyle) && $tpskin !=$_COOKIE['skinco']){//$tpskin風格
Cookie('skinco',$tpskin);
refreshto('index.php','狀態:風格設定完成');
}
refreshto("profile.php?action=show&uid=$winddb[uid]","完成用戶資料修改,如果您修改了密碼將自動登出!需重新進入論壇!");
}
}
}
?>
|