function GetRankName($arcrank) { global $arcArray; if(!is_array($arcArray)){ $dsql = new DedeSql(false); $dsql->SetQuery("Select * from #@__arcrank"); $dsql->Execute(); while($row = $dsql->GetObject()){ $arcArray[$row->rank]=$row->membername; } $dsql->Close(); } if(isset($arcArray[$arcrank])) return $arcArray[$arcrank]; else return "不限"; }
$bodytext = preg_replace("/#p#|#e#|副标题|分页标题/isU","",Html2Text($body)); if(strlen($bodytext) < $msize) continue; $des = trim(addslashes(cn_substr($bodytext,$dsize))); if(strlen($des)<3) $des = "-"; $dsql->ExecuteNoneQuery("Update $maintable set description='{$des}' where ID='{$row['ID']}';"); $dsql->ExecuteNoneQuery("Update #@__full_search set addinfos='{$des}' where aid='{$row['ID']}';"); } //返回进度信息 $startdd = $startdd + $pagesize; if($totalnum > $startdd){ $tjlen = ceil( ($startdd/$totalnum) * 100 ); $dvlen = $tjlen * 2; $tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>"; $tjsta .= "<br/>完成处理文档总数的:$tjlen %,继续执行任务..."; $nurl = "description_fetch_action.php?action=fetch&totalnum=$totalnum&startdd={$startdd}&pagesize=$pagesize&channel={$channel}&rpfield={$rpfield}&dsize={$dsize}&msize={$msize}&sid={$sid}&eid=$eid&addtable=".urlencode($addtable); $dsql->Close(); ShowMsg($tjsta,$nurl,0,500); exit(); }else{ $tjlen=100; $dsql->executenonequery("OPTIMIZE TABLE `#@__full_search`"); $dsql->executenonequery("OPTIMIZE TABLE `$maintable`"); $dsql->Close(); echo "完成所有任务!"; exit(); } }else{ $dsql->Close(); echo "完成所有任务!"; exit(); }
function checkUser($username,$userpwd) { //只允许用户名和密码用0-9,a-z,A-Z,'@','_','.','-'这些字符 $this->userName = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$username); $this->userPwd = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$userpwd); $pwd = substr(md5($this->userPwd),0,24); $dsql = new DedeSql(false); $dsql->SetQuery("Select * From #@__admin where userid='".$this->userName."' limit 0,1"); $dsql->Execute(); $row = $dsql->GetObject(); if(!isset($row->pwd)){ $dsql->Close(); return -1; } else if($pwd!=$row->pwd){ $dsql->Close(); return -2; } else{ $loginip = GetIP(); $this->userID = $row->ID; $this->userType = $row->usertype; $this->userChannel = $row->typeid; $this->userName = $row->uname; $groupSet = $dsql->GetOne("Select * From #@__admintype where rank='".$row->usertype."'"); $this->userPurview = $groupSet['purviews']; $dsql->SetQuery("update #@__admin set loginip='$loginip',logintime='".strftime("%Y-%m-%d %H:%M:%S",time())."' where ID='".$row->ID."'"); $dsql->ExecuteNoneQuery(); $dsql->Close(); return 1; } }
if (ereg("^edit___", $k)) { $v = ${$k}; } else { continue; } $k = ereg_replace("^edit___", "", $k); if (strlen($v) > 250) { showmsg("{$k} 太长,不能超过250字节", '-1'); exit; } $savesql->ExecuteNoneQuery("Update #@__config set `config_value`='{$v}' where `config_name`='{$k}' "); } $savesql->SetQuery("Select `config_name`,`config_value` From `#@__config` order by `id` asc"); $savesql->Execute(); if ($savesql->GetTotalRow() <= 0) { $savesql->Close(); ShowMsg("成功保存变量但从数据库读取所有数据时失败,无法更新配置文件!", "javascript:;"); exit; } @copy($configfile, $configfile_bak); $fp = @fopen($configfile, 'w'); @flock($fp, 3); @fwrite($fp, "<" . "?php\r\n") or die("配置文件'{$configfile}'不支持写入,本次操作无效!<a href='system_basic.php'>返回</a>"); while ($row = $savesql->GetArray()) { $row['value'] = str_replace("'", "\\'", $row['config_value']); fwrite($fp, "\${$row['config_name']} = '" . $row['config_value'] . "';\r\n"); } fwrite($fp, "?>"); fclose($fp); $message = "成功修改了系统配置文件config_base.php"; $logindate = getdatetimemk(time());
require_once(dirname(__FILE__)."/config.php"); CheckPurview('member_Pm'); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); if(!isset($folder)) $folder = ''; if(!isset($username)) $username = ''; if(!isset($keyword)) $keyword = ''; if(isset($dopost)){ $ID = ereg_replace("[^0-9]","",$ID); if($dopost=="del"&&!empty($ID)){ $db = new DedeSql(false); $db->ExecuteNoneQuery("DELETE FROM #@__pms WHERE pmid='$ID'"); $db->Close(); } } $whereSql = "WHERE folder='inbox' AND isadmin='0'"; if(!empty($folder)) $whereSql = "WHERE folder='$folder'"; $postuser = "******"; if($folder=="inbox"||$folder=='') $postuser = "******"; if(!empty($keyword)) $whereSql .= " AND (subject like '%".$keyword."%' OR message like '%".$keyword."%')"; if(!empty($username)) $whereSql .= " AND msgfrom like '%".$username."%'"; function GetFolders($me){ if($me=="track") return "发件箱";
function CheckUser($loginuser,$loginpwd) { if(!TestStringSafe($loginuser)||!TestStringSafe($loginpwd)) { ShowMsg("用户名或密码不合法!","-1"); exit(); } $loginuser = ereg_replace("[;%'\\\?\*\$]","",$loginuser); $dsql = new DedeSql(false); $row = $dsql->GetOne("Select ID,pwd From #@__member where userid='$loginuser' "); if(is_array($row)) //用户存在 { //密码错误 if($row['pwd'] != $loginpwd){ return -1; } else{ //成功登录 $dsql->ExecuteNoneQuery("update #@__member set logintime='".time()."',loginip='".GetIP()."' where ID='{$row['ID']}';"); $dsql->Close(); $this->PutLoginInfo($row['ID']); $this->FushCache(); return 1; } }else{ //用户不存在 return 0; } }
if(empty($emailfield)) $email = ''; else $email = addslashes($row[$emailfield]); if(empty($sexfield)) $sex = ''; else{ $sex = $row[$sexfield]; if($sex==$sexman) $sex = '男'; else if($sex==$sexwoman) $sex = '女'; else $sex = ''; } $ntime = time(); $inQuery = " INSERT INTO #@__member(userid,pwd,uname,sex,birthday,membertype,money, weight,height,job,province,city,myinfo,tel,oicq,email,homepage, jointime,joinip,logintime,loginip,showaddr,address) VALUES ('$userid','$pwd','$uname','$sex','0000-00-00','10','0', '0','0','','0','0','','','','$email','','$ntime','$loginip','$ntime','','0','');"; $rs = $dsql2->ExecuteNoneQuery($inQuery); if($rs) $c++; } $dsql->Close(); $dsql2->Close(); ShowMsg("成功导入 ".$c." 条数据!","javascript:;"); exit(); } ClearAllLink(); ?>