本文整理汇总了PHP中RepPostVar函数的典型用法代码示例。如果您正苦于以下问题:PHP RepPostVar函数的具体用法?PHP RepPostVar怎么用?PHP RepPostVar使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RepPostVar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EditSearchLoadTb
function EditSearchLoadTb($add, $userid, $username)
{
global $empire, $dbtbpre;
$lid = (int) $add['lid'];
$tbname = RepPostVar($add['tbname']);
$titlefield = RepPostVar($add['titlefield']);
$infotextfield = RepPostVar($add['infotextfield']);
$smalltextfield = RepPostVar($add['smalltextfield']);
$loadnum = (int) $add['loadnum'];
if (!$tbname || !$titlefield || !$infotextfield || !$smalltextfield || !$loadnum) {
printerror("EmptySearchLoadTb", "history.go(-1)");
}
//操作权限
CheckLevel($userid, $username, $classid, "searchall");
if ($tbname != $add['oldtbname']) {
//表是否存在
$tbnum = $empire->gettotal("select count(*) as total from {$dbtbpre}enewssearchall_load where tbname='{$tbname}' and lid<>{$lid} limit 1");
if ($tbnum) {
printerror("ReSearchLoadTb", "history.go(-1)");
}
}
$sql = $empire->query("update {$dbtbpre}enewssearchall_load set tbname='{$tbname}',titlefield='{$titlefield}',infotextfield='{$infotextfield}',smalltextfield='{$smalltextfield}',loadnum='{$loadnum}' where lid='{$lid}'");
GetSearchAllTb();
if ($sql) {
//操作日志
insert_dolog("lid=" . $lid . "&tbname=" . $tbname);
printerror("EditSearchLoadTbSuccess", "ListSearchLoadTb.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例2: AddGbook
function AddGbook($add)
{
global $empire, $dbtbpre, $level_r, $public_r;
//验证IP
eCheckAccessDoIp('gbook');
CheckCanPostUrl();
//验证来源
$bid = (int) getcvar('gbookbid');
if (empty($bid)) {
$bid = intval($add[bid]);
}
$name = RepPostStr(trim($add[name]));
$email = RepPostStr($add[email]);
$call = RepPostStr($add[call]);
$lytext = RepPostStr($add[lytext]);
if (empty($bid) || empty($name) || empty($email) || !trim($lytext)) {
printerror("EmptyGbookname", "history.go(-1)", 1);
}
if (!chemail($email)) {
printerror("EmailFail", "history.go(-1)", 1);
}
//验证码
$keyvname = 'checkgbookkey';
if ($public_r['gbkey_ok']) {
ecmsCheckShowKey($keyvname, $add['key'], 1);
}
$lasttime = getcvar('lastgbooktime');
if ($lasttime) {
if (time() - $lasttime < $public_r['regbooktime']) {
printerror("GbOutTime", "", 1);
}
}
//版面是否存在
$br = $empire->fetch1("select bid,checked,groupid from {$dbtbpre}enewsgbookclass where bid='{$bid}';");
if (empty($br[bid])) {
printerror("EmptyGbook", "history.go(-1)", 1);
}
//权限
if ($br['groupid']) {
$user = islogin();
if ($level_r[$br[groupid]][level] > $level_r[$user[groupid]][level]) {
printerror("HaveNotEnLevel", "history.go(-1)", 1);
}
}
$lytime = date("Y-m-d H:i:s");
$ip = egetip();
$userid = (int) getcvar('mluserid');
$username = RepPostVar(getcvar('mlusername'));
$sql = $empire->query("insert into {$dbtbpre}enewsgbook(name,email,`call`,lytime,lytext,retext,bid,ip,checked,userid,username) values('{$name}','{$email}','{$call}','{$lytime}','{$lytext}','','{$bid}','{$ip}','{$br['checked']}','{$userid}','{$username}');");
ecmsEmptyShowKey($keyvname);
//清空验证码
if ($sql) {
esetcookie("lastgbooktime", time(), time() + 3600 * 24);
//设置最后发表时间
$reurl = DoingReturnUrl("../tool/gbook/?bid={$bid}", $add['ecmsfrom']);
printerror("AddGbookSuccess", $reurl, 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例3: EditPubVar
function EditPubVar($add, $userid, $username)
{
global $empire, $dbtbpre;
$add[varid] = (int) $add['varid'];
$add[myvar] = RepPostVar($add[myvar]);
if (!$add[varid] || !$add[myvar] || !$add[varname]) {
printerror("EmptyPubVar", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "pubvar");
if ($add[myvar] != $add[oldmyvar]) {
$num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewspubvar where myvar='{$add['myvar']}' and varid<>{$add['varid']} limit 1");
if ($num) {
printerror("RePubVar", "history.go(-1)");
}
}
$add[varvalue] = AddAddsData(RepPhpAspJspcode($add[varvalue]));
$classid = (int) $add[classid];
$tocache = (int) $add[tocache];
$add[myorder] = (int) $add[myorder];
$sql = $empire->query("update {$dbtbpre}enewspubvar set myvar='{$add['myvar']}',varname='{$add['varname']}',varvalue='" . $add[varvalue] . "',varsay='{$add['varsay']}',myorder='{$add['myorder']}',classid='{$classid}',tocache='{$tocache}' where varid='{$add['varid']}'");
if ($tocache || $add['oldtocache']) {
GetConfig();
}
if ($sql) {
//操作日志
insert_dolog("varid=" . $add[varid] . "<br>var=" . $add[myvar]);
printerror("EditPubVarSuccess", "ListPubVar.php?classid={$add['cid']}" . hReturnEcmsHashStrHref2(0));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例4: EditSp
function EditSp($add, $userid, $username)
{
global $empire, $dbtbpre;
$add['varname'] = RepPostVar($add['varname']);
$spid = (int) $add[spid];
if (!$spid || !$add[spname] || !$add[varname]) {
printerror("EmptySp", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "sp");
$num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewssp where varname='{$add['varname']}' and spid<>{$spid} limit 1");
if ($num) {
printerror("HaveSp", "history.go(-1)");
}
$add[sptype] = (int) $add[sptype];
$add[cid] = (int) $add[cid];
$add[classid] = (int) $add[classid];
$add[tempid] = (int) $add[tempid];
$add[maxnum] = (int) $add[maxnum];
$sptime = time();
$groupid = ReturnSpGroup($add[groupid]);
$userclass = ReturnSpGroup($add[userclass]);
$username = ',' . $add[username] . ',';
$add[isclose] = (int) $add[isclose];
$add[cladd] = (int) $add[cladd];
$sql = $empire->query("update {$dbtbpre}enewssp set spname='{$add['spname']}',varname='{$add['varname']}',sppic='{$add['sppic']}',spsay='{$add['spsay']}',sptype='{$add['sptype']}',cid='{$add['cid']}',classid='{$add['classid']}',tempid='{$add['tempid']}',maxnum='{$add['maxnum']}',groupid='{$groupid}',userclass='{$userclass}',username='{$username}',isclose='{$add['isclose']}',cladd='{$add['cladd']}' where spid='{$spid}'");
if ($sql) {
//操作日志
insert_dolog("spid=" . $spid . "<br>spname=" . $add[spname]);
printerror("EditSpSuccess", "ListSp.php?cid={$add['fcid']}&fclassid={$add['fclassid']}&fsptype={$add['fsptype']}");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例5: EditFriend
function EditFriend($add)
{
global $empire, $dbtbpre;
//是否登陆
$user_r = islogin();
$fid = (int) $add['fid'];
$fname = RepPostVar(trim($add['fname']));
$add['fcid'] = (int) $add['fcid'];
if (!$fname || !$fid) {
printerror("EmptyFriend", "", 1);
}
//加自己为好友
if ($fname == $user_r['username']) {
printerror("NotAddFriendSelf", "", 1);
}
$num = $empire->gettotal("select count(*) as total from " . eReturnMemberTable() . " where " . egetmf('username') . "='{$fname}' limit 1");
if (!$num) {
printerror("NotFriendUsername", "", 1);
}
//重复提交
if ($fname != $add['oldfname']) {
$num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewshy where fname='{$fname}' and userid='{$user_r['userid']}' limit 1");
if ($num) {
printerror("ReAddFriend", "", 1);
}
}
$cid = (int) $add['cid'];
$fsay = RepPostStr($add['fsay']);
$sql = $empire->query("update {$dbtbpre}enewshy set fname='" . addslashes($fname) . "',cid={$cid},fsay='" . addslashes($fsay) . "' where fid={$fid} and userid='{$user_r['userid']}'");
if ($sql) {
printerror("EditFriendSuccess", "../member/friend/?cid={$add['fcid']}", 1);
} else {
printerror("DbError", "", 1);
}
}
示例6: EditSafeInfo
function EditSafeInfo($add)
{
global $empire, $dbtbpre, $public_r;
$user_r = islogin();
//是否登陆
$userid = $user_r[userid];
$username = $user_r[username];
$rnd = $user_r[rnd];
//邮箱
$email = trim($add['email']);
if (!$email || !chemail($email)) {
printerror("EmailFail", "history.go(-1)", 1);
}
$email = RepPostStr($email);
//验证原密码
$oldpassword = RepPostVar($add[oldpassword]);
if (!$oldpassword) {
printerror('FailOldPassword', '', 1);
}
$add[password] = RepPostVar($add[password]);
$num = 0;
$ur = $empire->fetch1("select " . eReturnSelectMemberF('userid,password,salt') . " from " . eReturnMemberTable() . " where " . egetmf('userid') . "='{$userid}'");
if (empty($ur['userid'])) {
printerror('FailOldPassword', '', 1);
}
if (!eDoCkMemberPw($oldpassword, $ur['password'], $ur['salt'])) {
printerror('FailOldPassword', '', 1);
}
//邮箱
$pr = $empire->fetch1("select regemailonly from {$dbtbpre}enewspublic limit 1");
if ($pr['regemailonly']) {
$num = $empire->gettotal("select count(*) as total from " . eReturnMemberTable() . " where " . egetmf('email') . "='{$email}' and " . egetmf('userid') . "<>'{$userid}' limit 1");
if ($num) {
printerror("ReEmailFail", "history.go(-1)", 1);
}
}
//密码
$a = '';
$salt = '';
$truepassword = '';
if ($add[password]) {
if ($add[password] !== $add[repassword]) {
printerror('NotRepassword', 'history.go(-1)', 1);
}
$salt = eReturnMemberSalt();
$password = eDoMemberPw($add[password], $salt);
$a = "," . egetmf('password') . "='{$password}'," . egetmf('salt') . "='{$salt}'";
$truepassword = $add[password];
}
$sql = $empire->query("update " . eReturnMemberTable() . " set " . egetmf('email') . "='{$email}'" . $a . " where " . egetmf('userid') . "='{$userid}'");
if ($sql) {
//易通行系统
DoEpassport('editpassword', $userid, $username, $truepassword, $salt, $email, $user_r['groupid'], '');
printerror("EditInfoSuccess", "../member/EditInfo/EditSafeInfo.php", 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例7: ReInfoUrl
function ReInfoUrl($start, $classid, $from, $retype, $startday, $endday, $startid, $endid, $tbname, $userid, $username)
{
global $empire, $public_r, $class_r, $fun_r, $dbtbpre;
//验证权限
//CheckLevel($userid,$username,$classid,"changedata");
$start = (int) $start;
$tbname = RepPostVar($tbname);
if (empty($tbname) || !eCheckTbname($tbname)) {
printerror("ErrorUrl", "history.go(-1)");
}
$add1 = '';
//按栏目刷新
$classid = (int) $classid;
if ($classid) {
if (empty($class_r[$classid][islast])) {
$where = ReturnClass($class_r[$classid][sonclass]);
} else {
$where = "classid='{$classid}'";
}
$add1 = " and (" . $where . ")";
}
//按ID刷新
if ($retype) {
$startid = (int) $startid;
$endid = (int) $endid;
if ($endid) {
$add1 .= " and id>={$startid} and id<={$endid}";
}
} else {
$startday = RepPostVar($startday);
$endday = RepPostVar($endday);
if ($startday && $endday) {
$add1 .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59");
}
}
$b = 0;
$sql = $empire->query("select id,classid,checked from {$dbtbpre}ecms_" . $tbname . "_index where id>{$start}" . $add1 . " order by id limit " . $public_r[delnewsnum]);
while ($r = $empire->fetch($sql)) {
$b = 1;
$new_start = $r[id];
//返回表
$infotb = ReturnInfoMainTbname($tbname, $r['checked']);
$infor = $empire->fetch1("select newspath,filename,groupid,isurl,titleurl from " . $infotb . " where id='{$r['id']}' limit 1");
$infourl = GotoGetTitleUrl($r['classid'], $r['id'], $infor['newspath'], $infor['filename'], $infor['groupid'], $infor['isurl'], $infor['titleurl']);
$empire->query("update " . $infotb . " set titleurl='{$infourl}' where id='{$r['id']}' limit 1");
}
if (empty($b)) {
insert_dolog("");
//操作日志
printerror("ReInfoUrlSuccess", $from);
}
echo $fun_r[OneReInfoUrlSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)<script>self.location.href='ReInfoUrl.php?enews=ReInfoUrl&tbname={$tbname}&classid={$classid}&start={$new_start}&from=" . urlencode($from) . "&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}" . hReturnEcmsHashStrHref(0) . "';</script>";
exit;
}
示例8: SetWap
function SetWap($add, $userid, $username)
{
global $empire, $dbtbpre;
$wapopen = (int) $add['wapopen'];
$wapdefstyle = (int) $add['wapdefstyle'];
$wapshowmid = RepPostVar($add['wapshowmid']);
$waplistnum = (int) $add['waplistnum'];
$wapsubtitle = (int) $add['wapsubtitle'];
$wapchar = (int) $add['wapchar'];
$sql = $empire->query("update {$dbtbpre}enewspublic set wapopen={$wapopen},wapdefstyle={$wapdefstyle},wapshowmid='{$wapshowmid}',waplistnum={$waplistnum},wapsubtitle={$wapsubtitle},wapshowdate='{$add['wapshowdate']}',wapchar={$wapchar} limit 1");
//操作日志
insert_dolog("");
printerror("SetWapSuccess", "SetWap.php");
}
示例9: EditSp
function EditSp($add, $userid, $username)
{
global $empire, $dbtbpre;
$add['varname'] = RepPostVar($add['varname']);
$spid = (int) $add[spid];
if (!$spid || !$add[spname] || !$add[varname]) {
printerror("EmptySp", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "sp");
$num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewssp where varname='{$add['varname']}' and spid<>{$spid} limit 1");
if ($num) {
printerror("HaveSp", "history.go(-1)");
}
$add[sptype] = (int) $add[sptype];
$add[cid] = (int) $add[cid];
$add[classid] = (int) $add[classid];
$add[tempid] = (int) $add[tempid];
$add[maxnum] = (int) $add[maxnum];
$sptime = time();
$groupid = ReturnSpGroup($add[groupid]);
$userclass = ReturnSpGroup($add[userclass]);
$username = ',' . $add[username] . ',';
$add[isclose] = (int) $add[isclose];
$add[cladd] = (int) $add[cladd];
$add['refile'] = (int) $add['refile'];
$add['spfile'] = DoRepFileXg($add['spfile']);
$add['oldspfile'] = DoRepFileXg($add['oldspfile']);
$add['spfileline'] = (int) $add['spfileline'];
$add['spfilesub'] = (int) $add['spfilesub'];
$add['filepass'] = (int) $add['filepass'];
$sql = $empire->query("update {$dbtbpre}enewssp set spname='{$add['spname']}',varname='{$add['varname']}',sppic='{$add['sppic']}',spsay='{$add['spsay']}',sptype='{$add['sptype']}',cid='{$add['cid']}',classid='{$add['classid']}',tempid='{$add['tempid']}',maxnum='{$add['maxnum']}',groupid='{$groupid}',userclass='{$userclass}',username='{$username}',isclose='{$add['isclose']}',cladd='{$add['cladd']}',refile='{$add['refile']}',spfile='{$add['spfile']}',spfileline='{$add['spfileline']}',spfilesub='{$add['spfilesub']}' where spid='{$spid}'");
//更新附件
UpdateTheFileEditOther(7, $spid, 'other');
//生成碎片文件
if ($add['refile']) {
//旧文件
if ($add['spfile'] != $add['oldspfile']) {
DelSpReFile($add['oldspfile']);
}
DoSpReFile($add, 0);
}
if ($sql) {
//操作日志
insert_dolog("spid=" . $spid . "<br>spname=" . $add[spname]);
printerror("EditSpSuccess", "ListSp.php?cid={$add['fcid']}&fclassid={$add['fclassid']}&fsptype={$add['fsptype']}" . hReturnEcmsHashStrHref2(0));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例10: AddMemberFeedback
function AddMemberFeedback($add)
{
global $empire, $dbtbpre;
//验证码
$keyvname = 'checkspacefbkey';
ecmsCheckShowKey($keyvname, $add['key'], 1);
//用户
$userid = intval($add['userid']);
$ur = $empire->fetch1("select " . egetmf('userid') . " from " . eReturnMemberTable() . " where " . egetmf('userid') . "='{$userid}' limit 1");
if (empty($ur['userid'])) {
printerror("NotUsername", "", 1);
}
//发表者
$uid = (int) getcvar('mluserid');
if ($uid) {
$uname = RepPostVar(getcvar('mlusername'));
} else {
$uid = 0;
$uname = '';
}
$uname = RepPostStr($uname);
$name = RepPostStr($add['name']);
$company = RepPostStr($add['company']);
$phone = RepPostStr($add['phone']);
$fax = RepPostStr($add['fax']);
$email = RepPostStr($add['email']);
$address = RepPostStr($add['address']);
$zip = RepPostStr($add['zip']);
$title = RepPostStr($add['title']);
$ftext = RepPostStr($add['ftext']);
if (!trim($name) || !trim($title) || !trim($ftext)) {
printerror("EmptyMemberFeedback", "history.go(-1)", 1);
}
$addtime = date("Y-m-d H:i:s");
$ip = egetip();
$eipport = egetipport();
$sql = $empire->query("insert into {$dbtbpre}enewsmemberfeedback(name,company,phone,fax,email,address,zip,title,ftext,userid,ip,uid,uname,addtime,eipport) values('{$name}','{$company}','{$phone}','{$fax}','{$email}','{$address}','{$zip}','{$title}','{$ftext}',{$userid},'{$ip}',{$uid},'{$uname}','{$addtime}','{$eipport}');");
ecmsEmptyShowKey($keyvname);
//清空验证码
if ($sql) {
printerror("AddMemberFeedbackSuccess", $_SERVER['HTTP_REFERER'], 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例11: EditInfoType
function EditInfoType($add, $userid, $username)
{
global $empire, $dbtbpre, $emod_r;
$tid = (int) $add['tid'];
$tbname = RepPostVar($add['tbname']);
$mid = (int) $add[mid];
$typeid = $add['typeid'];
$tname = $add['tname'];
$myorder = $add['myorder'];
$yhid = $add['yhid'];
$deltypeid = $add['deltypeid'];
$count = count($typeid);
if (!$tid || !$tbname || !$mid || !$count) {
printerror("EmptyInfoTypeName", "history.go(-1)");
}
//删除
$del = 0;
$ids = '';
$delcount = count($deltypeid);
if ($delcount) {
$dh = '';
for ($j = 0; $j < $delcount; $j++) {
$ids .= $dh . intval($deltypeid[$j]);
$dh = ',';
}
$empire->query("delete from {$dbtbpre}enewsinfotype where typeid in (" . $ids . ")");
if ($emod_r[$mid][tbname]) {
$empire->query("update {$dbtbpre}ecms_" . $emod_r[$mid][tbname] . " set ttid=0 where ttid in (" . $ids . ")");
}
$del = 1;
}
//修改
for ($i = 0; $i < $count; $i++) {
if (strstr(',' . $ids . ',', ',' . $typeid[$i] . ',')) {
continue;
}
$empire->query("update {$dbtbpre}enewsinfotype set tname='" . $tname[$i] . "',myorder='" . intval($myorder[$i]) . "',yhid='" . intval($yhid[$i]) . "' where typeid='" . intval($typeid[$i]) . "'");
}
GetClass();
//更新缓存
//操作日志
insert_dolog("mid=" . $mid . "&del={$del}");
printerror("EditInfoTypeSuccess", "InfoType.php?tid={$tid}&tbname={$tbname}&mid={$mid}");
}
示例12: DelDoLog_date
function DelDoLog_date($add, $userid, $username)
{
global $empire, $dbtbpre;
//验证权限
CheckLevel($userid, $username, $classid, "log");
$start = RepPostVar($add['startday']);
$end = RepPostVar($add['endday']);
if (!$start || !$end) {
printerror('EmptyDelLogTime', '');
}
$startday = $start . ' 00:00:00';
$endday = $end . ' 23:59:59';
$sql = $empire->query("delete from {$dbtbpre}enewsdolog where logtime<='{$endday}' and logtime>='{$startday}'");
if ($sql) {
//操作日志
insert_dolog("time=" . $start . "~" . $end);
printerror("DelLogSuccess", "ListDolog.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例13: AddMemberGbook
function AddMemberGbook($add)
{
global $empire, $dbtbpre;
//验证码
$keyvname = 'checkspacegbkey';
ecmsCheckShowKey($keyvname, $add['key'], 1);
//用户
$userid = intval($add['userid']);
$ur = $empire->fetch1("select " . eReturnSelectMemberF('userid') . " from " . eReturnMemberTable() . " where " . egetmf('userid') . "='{$userid}' limit 1");
if (empty($ur['userid'])) {
printerror("NotUsername", "", 1);
}
//发表者
$uid = (int) getcvar('mluserid');
if ($uid) {
$uname = RepPostVar(getcvar('mlusername'));
} else {
$uid = 0;
$uname = trim($add['uname']);
}
$uname = RepPostStr($uname);
$gbtext = RepPostStr($add['gbtext']);
if (empty($uname) || !trim($gbtext)) {
printerror("EmptyMemberGbook", "history.go(-1)", 1);
}
$isprivate = intval($add['isprivate']);
$addtime = date("Y-m-d H:i:s");
$ip = egetip();
$eipport = egetipport();
$sql = $empire->query("insert into {$dbtbpre}enewsmembergbook(userid,isprivate,uid,uname,ip,addtime,gbtext,retext,eipport) values({$userid},{$isprivate},{$uid},'{$uname}','{$ip}','{$addtime}','{$gbtext}','','{$eipport}');");
ecmsEmptyShowKey($keyvname);
//清空验证码
if ($sql) {
printerror("AddMemberGbookSuccess", $_SERVER['HTTP_REFERER'], 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例14: AddMsg
function AddMsg($add)
{
global $empire, $level_r, $dbtbpre;
$user = islogin();
$title = RepPostStr(trim($add['title']));
$to_username = RepPostVar(trim($add['to_username']));
$msgtext = RepPostStr($add['msgtext']);
if (empty($title) || !trim($msgtext) || empty($to_username)) {
printerror("EmptyMsg", "", 1);
}
if ($user['username'] == $to_username) {
printerror("MsgToself", "", 1);
}
//字数
$len = strlen($msgtext);
if ($len > $level_r[$user[groupid]][msglen]) {
printerror("MoreMsglen", "", 1);
}
//接收方是否存在
$r = $empire->fetch1("select " . eReturnSelectMemberF('userid,groupid') . " from " . eReturnMemberTable() . " where " . egetmf('username') . "='{$to_username}' limit 1");
if (!$r['userid']) {
printerror("MsgNotToUsername", "", 1);
}
//对方短消息是否满
$mnum = $empire->gettotal("select count(*) as total from {$dbtbpre}enewsqmsg where to_username='{$to_username}'");
if ($mnum + 1 > $level_r[$r[groupid]][msgnum]) {
printerror("UserMoreMsgnum", "", 1);
}
$msgtime = date("Y-m-d H:i:s");
$sql = $empire->query("insert into {$dbtbpre}enewsqmsg(title,msgtext,haveread,msgtime,to_username,from_userid,from_username,isadmin,issys) values('" . addslashes($title) . "','" . addslashes($msgtext) . "',0,'{$msgtime}','{$to_username}','{$user['userid']}','{$user['username']}',0,0);");
$newhavemsg = eReturnSetHavemsg($user['havemsg'], 0);
$usql = $empire->query("update " . eReturnMemberTable() . " set " . egetmf('havemsg') . "='{$newhavemsg}' where " . egetmf('username') . "='{$to_username}' limit 1");
if ($sql) {
printerror("AddMsgSuccess", "../member/msg/", 1);
} else {
printerror("DbError", "", 1);
}
}
示例15: CardGetFen
function CardGetFen($username, $reusername, $card_no, $password)
{
global $empire, $dbtbpre;
$card_no = RepPostVar($card_no);
$password = RepPostVar($password);
$username = RepPostVar($username);
if (!trim($username) || !trim($card_no) || !trim($password)) {
printerror("EmptyGetCard", "history.go(-1)", 1);
}
if ($username != $reusername) {
printerror("DifCardUsername", "history.go(-1)", 1);
}
$user = $empire->fetch1("select " . eReturnSelectMemberF('userid,userdate,username') . " from " . eReturnMemberTable() . " where " . egetmf('username') . "='{$username}' limit 1");
if (!$user['userid']) {
printerror("ExiestCardUsername", "history.go(-1)", 1);
}
$num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewscard where card_no='" . $card_no . "' and password='" . $password . "' limit 1");
if (!$num) {
printerror("CardPassError", "history.go(-1)", 1);
}
//是否过期
$buytime = date("Y-m-d H:i:s");
$r = $empire->fetch1("select cardfen,money,endtime,carddate,cdgroupid,cdzgroupid from {$dbtbpre}enewscard where card_no='{$card_no}' limit 1");
if ($r[endtime] != "0000-00-00") {
$endtime = to_date($r[endtime]);
if ($endtime < time()) {
printerror("CardOutDate", "history.go(-1)", 1);
}
}
//充值
eAddFenToUser($r[cardfen], $r[carddate], $r[cdgroupid], $r[cdzgroupid], $user);
$sql1 = $empire->query("delete from {$dbtbpre}enewscard where card_no='{$card_no}'");
//删除卡号
//备份购买记录
BakBuy($user['userid'], $username, $card_no, $r[cardfen], $r[money], $r[carddate], 0);
printerror("CardGetFenSuccess", "../member/card/", 1);
}