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]","完成用户资料修改,如果您修改了密码将自动登出!需重新进入论坛!");
}
}
}
?>
|