protected function lists($offset) { $where['status'] = 1; if ($offset) { $where = array('id' => array('gt', $offset)); } else { $limit = 10; } $data = $this->order('id desc')->limit($limit)->where($where)->select(array('hy' => true)); if (!is_array($data) || !count($data)) { return false; } $max = $data[0]['id']; $data = array_reverse($data); $userId = ss_uid(); foreach ($data as $k => &$v) { $v['user_id_text'] = $v['user_id_text']; $v['create_time'] = to_time($v['create_time'], 5); if ($userId == $v['user_id']) { $v['avatar_file'] = session('avatarFile'); } else { $v['avatar_file'] = avatar_file($v['avatar_file']); } unset($v['id']); } return array('list' => $data, 'offset' => $max); }
function ReNewsHtml($start, $classid, $from, $retype, $startday, $endday, $startid, $endid, $tbname, $havehtml) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre, $etable_r; $tbname = RepPostVar($tbname); if (empty($tbname)) { printerror("ErrorUrl", "history.go(-1)"); } $start = (int) $start; //按ID if ($retype) { $startid = (int) $startid; $endid = (int) $endid; $add1 = $endid ? ' and id>=' . $startid . ' and id<=' . $endid : ''; } else { $startday = RepPostVar($startday); $endday = RepPostVar($endday); $add1 = $startday && $endday ? ' and truetime>=' . to_time($startday . ' 00:00:00') . ' and truetime<=' . to_time($endday . ' 23:59:59') : ''; } //按栏目 $classid = (int) $classid; if ($classid) { $where = empty($class_r[$classid][islast]) ? ReturnClass($class_r[$classid][sonclass]) : "classid='{$classid}'"; $add1 .= ' and ' . $where; } //不生成 $add1 .= ReturnNreInfoWhere(); //是否重复生成 if ($havehtml != 1) { $add1 .= ' and havehtml=0'; } //优化 $yhadd = ''; $yhid = $etable_r[$tbname][yhid]; $yhvar = 'rehtml'; if ($yhid) { $yhadd = ReturnYhSql($yhid, $yhvar); } $b = 0; $sql = $empire->query("select * from {$dbtbpre}ecms_" . $tbname . " where " . $yhadd . "id>{$start}" . $add1 . " and checked=1 order by id limit " . $public_r[renewsnum]); while ($r = $empire->fetch($sql)) { if (!empty($r['titleurl']) || $class_r[$r[classid]][showdt] == 2) { continue; } $b = 1; GetHtml($r, '', 1); //生成信息文件 $new_start = $r[id]; } if (empty($b)) { echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><center><b>" . $tbname . $fun_r[ReTableIsOK] . "!</b></center>"; db_close(); $empire = null; exit; } echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><meta http-equiv=\"refresh\" content=\"" . $public_r['realltime'] . ";url=ecmschtml.php?enews=ReNewsHtml&tbname={$tbname}&classid={$classid}&start={$new_start}&from={$from}&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}&havehtml={$havehtml}&reallinfotime=" . $_GET['reallinfotime'] . "\">" . $fun_r[OneReNewsHtmlSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)"; exit; }
function ChangeInfoOtherLink($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)) { printerror("ErrorUrl", "history.go(-1)"); } //按栏目刷新 $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,keyboard,classid from {$dbtbpre}ecms_" . $tbname . " where id>{$start}" . $add1 . " order by id limit " . $public_r[infolinknum]); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r[id]; //手动相关链接 $infopr = $empire->fetch1("select diyotherlink from {$dbtbpre}enewsinfovote where id='{$r['id']}' and classid='{$r['classid']}' limit 1"); if ($infopr['diyotherlink']) { continue; } $newkeyid = GetKeyid($r[keyboard], $r[classid], $r[id], $class_r[$r[classid]][link_num]); $usql = $empire->query("update {$dbtbpre}ecms_" . $tbname . " set keyid='{$newkeyid}' where id={$r['id']}"); } if (empty($b)) { insert_dolog(""); //操作日志 printerror("ChangeInfoLinkSuccess", $from); } echo $fun_r[OneChangeInfoLinkSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)<script>self.location.href='ecmscom.php?enews=ChangeInfoOtherLink&tbname={$tbname}&classid={$classid}&start={$new_start}&from={$from}&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}';</script>"; exit; }
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; }
function DelDownRecord($add, $userid, $username) { global $empire, $dbtbpre; if (empty($add['downtime'])) { printerror("EmptyDownTime", "history.go(-1)"); } //验证权限 CheckLevel($userid, $username, $classid, "deldownrecord"); $truetime = to_time($add['downtime']); $sql = $empire->query("delete from {$dbtbpre}enewsdownrecord where truetime<=" . $truetime); if ($sql) { //操作日志 insert_dolog("time={$add['downtime']}"); printerror("DelDownRecordSuccess", "DelDownRecord.php"); } else { printerror("DbError", "history.go(-1)"); } }
</tr> <?php $totime = time(); $today = date("Y-m-d"); $yesterday = date("Y-m-d", $totime - 24 * 3600); $month = date("Y-m"); //本月最大天数 $maxday = date("t", mktime(0, 0, 0, date("m"), date("d"), date("Y"))); while ($r = $empire->fetch($sql)) { $tquery = "select count(*) as total from {$dbtbpre}ecms_" . $tbname . " where userid='{$r['userid']}' and ismember=0"; //今天发布数 $todaynum = $empire->gettotal($tquery . " and truetime>=" . to_time($today . " 00:00:00") . " and truetime<=" . to_time($today . " 23:59:59")); //昨天发布数 $yesterdaynum = $empire->gettotal($tquery . " and truetime>=" . to_time($yesterday . " 00:00:00") . " and truetime<=" . to_time($yesterday . " 23:59:59")); //本月发布数 $monthnum = $empire->gettotal($tquery . " and truetime>=" . to_time($month . "-01 00:00:00") . " and truetime<=" . to_time($month . "-" . $maxday . " 23:59:59")); //所有 $totalnum = $empire->gettotal($tquery); //未审核 $nochecktotalnum = $empire->gettotal($tquery . " and checked=0"); ?> <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'"> <td height="25"><div align="center"><a href="AddUser.php?enews=EditUser&userid=<?php echo $r[userid]; ?> " target="_blank"> <u><?php echo $r[username]; ?> </u> </a></div></td>
function CjNewsIn_all($classid, $checked, $uptime, $start, $userid, $username) { global $class_r, $empire, $public_r, $dbtbpre, $fun_r, $emod_r; $checked = (int) $checked; $classid = (int) $classid; $start = (int) $start; if (empty($classid)) { printerror("ErrorUrl", "history.go(-1)"); } //操作权限 CheckLevel($userid, $username, $classid, "cj"); $cr = $empire->fetch1("select * from {$dbtbpre}enewsinfoclass where classid='{$classid}'"); //副表 $cra = $empire->fetch1("select * from {$dbtbpre}ecms_infoclass_" . $cr[tbname] . " where classid='{$classid}'"); //组合两数组 $cr = TogTwoArray($cr, $cra); //导入gd处理文件 if ($cr['mark'] || $cr['getfirstspic']) { @(include_once "gd.php"); } if (empty($cr[insertnum])) { $cr[insertnum] = 10; } $mid = $class_r[$cr[newsclassid]][modid]; $savetxtf = $emod_r[$mid]['savetxtf']; $stb = $emod_r[$mid]['deftb']; //取得采集字段 $record = "<!--record-->"; $field = "<!--field--->"; $mr = $empire->fetch1("select cj from {$dbtbpre}enewsmod where mid='" . $class_r[$cr[newsclassid]][modid] . "'"); $cjr = explode($record, $mr[cj]); $ccount = count($cjr); $sql = $empire->query("select * from {$dbtbpre}ecms_infotmp_" . $cr[tbname] . " where classid='{$classid}' and checked=0 and id>{$start} order by id limit " . $cr[insertnum]); $todaytime = time(); $filetime = $todaytime; $b = 0; while ($r = $empire->fetch($sql)) { $b = 1; $newstart = $r[id]; $ivalue = ''; $ifield = ''; $dataivalue = ''; $dataifield = ''; $titlepicnoval = 0; for ($j = 0; $j < $ccount - 1; $j++) { $cjr1 = explode($field, $cjr[$j]); $dofield = $cjr1[1]; $var = "zz_" . $dofield; $var1 = "z_" . $dofield; $var2 = "qz_" . $dofield; $var3 = "save_" . $dofield; $value = $r[$dofield]; //自身链接 if ($dofield == "empireselfurl") { $value = $r['oldurl']; } //内容 if ($dofield == "newstext") { if ($cr[copyimg] || $cr[copyflash]) { $GLOBALS['cjnewsurl'] = $r[oldurl]; $value = addslashes(CopyImg(stripSlashes($value), $cr[copyimg], $cr[copyflash], $cr[newsclassid], $cr[imgurl], $username, 0, $r['id'], $cr['mark'], $public_r['filedeftb'])); } //替换关键字和字符 $value = DoReplaceKeyAndWord($value, 1, $cr[newsclassid]); } //简介 if ($dofield == "smalltext") { if (empty($value)) { $value = SubSmalltextVal($r[newstext], $cr[smalltextlen]); } else { $value = DoClearSmalltextVal($value); } } //图片集 if ($dofield == "morepic") { if ($cr[$var3] == " checked") { $msavepic = 1; $r['filepass'] = $r['id']; $value = LoadInSaveMorepicFile($value, $msavepic, $cr[newsclassid], 0, $r, 0, $public_r['filedeftb']); } } //时间 if ($dofield == "newstime") { continue; } //图片标题 if ($dofield == "titlepic" && $cr[zz_titlepicl]) { $cr[$var] = $cr[zz_titlepicl]; $cr[$var1] = $cr[z_titlepicl]; $cr[$var2] = $cr[qz_titlepicl]; $cr[$var3] = $cr[save_titlepicl]; } if ($dofield == "titlepic" && empty($value)) { $titlepicnoval = 1; } //是否远程保存 if ($value && !$cr[$var1] && $cr[$var3] == " checked" && $dofield != "morepic") { $tranr = DoTranUrl($value, $cr[newsclassid]); if ($tranr[tran]) { $tranr[filesize] = (int) $tranr[filesize]; $tranr[type] = (int) $tranr[type]; $r[id] = (int) $r[id]; //记录数据库 eInsertFileTable($tranr[filename], $tranr[filesize], $tranr[filepath], $username, $cr[newsclassid], '[URL]' . $tranr[filename], $tranr[type], 0, $r[id], $public_r[fpath], 0, 0, $public_r['filedeftb']); $value = $tranr[url]; } } //存放文本 if ($savetxtf == $dofield) { //建立目录 $thetxtfile = GetFileMd5(); $truevalue = MkDirTxtFile(date("Y/md"), $thetxtfile); //写放文件 EditTxtFieldText($truevalue, $value); $value = $truevalue; } $value = addslashes($value); if (strstr($emod_r[$mid]['tbdataf'], ',' . $dofield . ',')) { $dataifield .= "," . $dofield; $dataivalue .= ",'" . $value . "'"; } else { $ifield .= "," . $dofield; $ivalue .= ",'" . $value . "'"; } } $r[keyboard] = addslashes($r[keyboard]); //时间 if ($uptime) { $r[newstime] = $todaytime; $r[truetime] = $todaytime; } else { if ($r[newstime] == "0000-00-00 00:00:00") { $r[newstime] = $todaytime; } else { $r[newstime] = to_time($r[newstime]); } } //查看目录是否存在,不存在则建立 $newspath = FormatPath($cr[newsclassid], "", 0); //强制签发 if ($class_r[$cr[newsclassid]][wfid]) { $checked = 0; $isqf = 1; } else { $checked = $checked; $isqf = 0; } //变量处理 $newstempid = 0; $ispic = $r[titlepic] ? 1 : 0; //返回关键字 $keyid = GetKeyid($r[keyboard], $cr[newsclassid], 0, $class_r[$cr[newsclassid]][link_num]); //索引表 $havehtml = 0; $indexsql = $empire->query("insert into {$dbtbpre}ecms_" . $class_r[$cr[newsclassid]][tbname] . "_index(classid,checked,newstime,truetime,lastdotime,havehtml) values('{$cr['newsclassid']}','{$checked}','{$r['newstime']}','{$r['truetime']}','{$r['truetime']}','{$havehtml}');"); $id = $empire->lastid(); $infotbr = ReturnInfoTbname($class_r[$cr[newsclassid]][tbname], $checked, $stb); //主表 $isurl = $r['titleurl'] ? 1 : 0; $isql = $empire->query("insert into " . $infotbr['tbname'] . "(id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,ispic,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard,newstime" . $ifield . ") values('{$id}','{$cr['newsclassid']}',0,0,0,0,'{$newspath}','{$filename}','{$r['userid']}','{$r['username']}',0,0,'{$ispic}',0,'{$isqf}',0,'{$isurl}','{$r['truetime']}','{$r['truetime']}','{$havehtml}',0,0,'{$r['titlefont']}','{$r['titleurl']}','{$stb}','{$public_r['filedeftb']}','{$public_r['pldeftb']}','{$r['keyboard']}','{$r['newstime']}'" . $ivalue . ");"); //副表 $fisql = $empire->query("insert into " . $infotbr['datatbname'] . "(id,classid,keyid,dokey,newstempid,closepl,haveaddfen,infotags" . $dataifield . ") values('{$id}','{$cr['newsclassid']}','{$keyid}',1,'{$newstempid}',0,0,''" . $dataivalue . ");"); //更新栏目信息数 AddClassInfos($cr['newsclassid'], '+1', '+1', $checked); //更新新信息数 DoUpdateAddDataNum('info', $class_r[$cr['newsclassid']]['tid'], 1); //签发 if ($isqf == 1) { InfoInsertToWorkflow($id, $cr[newsclassid], $class_r[$cr[newsclassid]][wfid], $userid, $username); } //更新附件 UpdateTheFile($id, $r['id'], $cr[newsclassid], $public_r['filedeftb']); //取第一张图片为标题图片 $addtitlepic = ""; if ($cr['getfirstpic'] && $titlepicnoval) { $firsttitlepic = GetFpicToTpic($cr[newsclassid], $id, $cr['getfirstpic'], $cr['getfirstspic'], $cr['getfirstspicw'], $cr['getfirstspich'], $public_r['filedeftb']); if ($firsttitlepic) { $addtitlepic = ",titlepic='" . addslashes($firsttitlepic) . "',ispic=1"; } } //文件命名 $filename = ReturnInfoFilename($cr[newsclassid], $id, $r[filenameqz]); //信息地址 $updateinfourl = ''; if (!$isurl) { $infourl = GotoGetTitleUrl($cr['newsclassid'], $id, $newspath, $filename, 0, $isurl, ''); $updateinfourl = ",titleurl='{$infourl}'"; } $usql = $empire->query("update " . $infotbr['tbname'] . " set filename='{$filename}'" . $updateinfourl . $addtitlepic . " where id='{$id}'"); } $fm = ehtmlspecialchars($_GET['fm']); //全部入库完毕 if (empty($b)) { //取得忧化字段 for ($ci = 0; $ci < $ccount - 1; $ci++) { $cir = explode($field, $cjr[$ci]); $cifield = $cir[1]; if ($cifield == "title") { continue; } $updatefield .= "," . $cifield . "=''"; } //状态原记录 if ($cr['delloadinfo']) { $del = $empire->query("delete from {$dbtbpre}ecms_infotmp_" . $cr[tbname] . " where classid='{$classid}'"); } else { $del = $empire->query("update {$dbtbpre}ecms_infotmp_" . $cr[tbname] . " set checked=1,keyboard=''" . $updatefield . " where classid='{$classid}'"); } if ($fm) { echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><body topmargin=0><font color=red>" . $cr[classname] . " " . $fun_r['CjLoadInInfosSuccess'] . "</font>, <input type=button name=button value='" . $fun_r['OnlickLoadInCj'] . "' onclick=\"window.open('CheckCj.php?classid={$classid}&from=" . ehtmlspecialchars($_GET[from]) . hReturnEcmsHashStrHref2(0) . "');\"></body>"; exit; } else { printerror("CjLoadDbSuccess", "CheckCj.php?classid={$classid}&from=" . ehtmlspecialchars($_GET[from]) . hReturnEcmsHashStrHref2(0)); } } echo "<b>{$cr['classname']}</b> " . $fun_r['OneCjLoadDbSuccess'] . "(ID:<font color=red><b>" . $newstart . "</b></font>)<script>self.location.href='ecmscj.php?enews=CjNewsIn_all&checked={$checked}&uptime={$uptime}&classid={$classid}&start={$newstart}&fm={$fm}&from=" . ehtmlspecialchars($_GET[from]) . hReturnEcmsHashStrHref(0) . "';</script>"; exit; }
function ReturnAddF($add, $modid, $userid, $username, $do = 0, $rdata = 0, $ch = 0) { global $empire, $public_r, $dbtbpre, $emod_r; if ($do == 0 || $do == 1) { //导入gd处理文件 if ($add['mark'] || $add['getfirsttitlespic'] || $add['mcreatespic']) { include_once ECMS_PATH . 'e/class/gd.php'; } } $ret_r['tb'] = $emod_r[$modid]['deftb']; $r = explode(',', $emod_r[$modid][enter]); $count = count($r) - 1; if (empty($do)) { //数据库操作 for ($i = 1; $i < $count; $i++) { $f = $r[$i]; if ($f == 'special.field' || !strstr($emod_r[$modid]['canaddf'], ',' . $f . ',')) { continue; } $add[$f] = ReturnCheckboxAddF($add[$f], $modid, $f); //复选框 $value = RepPhpAspJspcodeText($add[$f]); if ($f == 'newstime') { $value = empty($value) ? time() : to_time($value); } elseif ($f == "morepic") { $value = ReturnMorepicpath($add['msmallpic'], $add['mbigpic'], $add['mpicname'], $add['mdelpicid'], $add['mpicid'], $add, $add['mpicurl_qz'], 0); } elseif ($f == "downpath") { $value = ReturnDownpath($add['downname'], $add['downpath'], $add['delpathid'], $add['pathid'], $add['downuser'], $add['fen'], $add['thedownqz'], $add, $add['foruser'], $add['downurl_qz'], 0); } elseif ($f == "onlinepath") { $value = ReturnDownpath($add['odownname'], $add['odownpath'], $add['odelpathid'], $add['opathid'], $add['odownuser'], $add['ofen'], $add['othedownqz'], $add, $add['oforuser'], $add['onlineurl_qz'], 0); } elseif ($f == "smalltext") { if (!trim($value)) { $value = SubSmalltextVal($add[newstext], $public_r[smalltextlen]); //截取新闻内容 } } elseif ($f == 'infoip') { $value = egetip(); } elseif ($f == 'infozm') { $value = $value ? $value : GetInfoZm($add[title]); } //处理函数 $value = DoFFun($modid, $f, $value, 1, 0); //检测必填字段 if ($ch == 1 && empty($add['titleurl'])) { ChMustAddF($modid, $f, $value); ChIsOnlyAddF($modid, 0, $f, $value, 0); //唯一值 } //编辑器 if ($f == "newstext") { //远程保存 $value = addslashes(CopyImg(stripSlashes($value), $add[copyimg], $add[copyflash], $add[classid], $add[qz_url], $username, $add['id'], $add['filepass'], $add['mark'])); //替换关键字和字符 $value = DoReplaceKeyAndWord($value, $add['dokey']); //自动分页 if ($add[autopage] && !strstr($value, "[!--empirenews.page--]")) { if (empty($add[autosize])) { $add[autosize] = 5000; } $value = AutoDoPage($value, $add[autosize]); } } //存文本 if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) { //建立目录 $thetxtfile = GetFileMd5(); $truevalue = MkDirTxtFile(date("Y/md"), $thetxtfile); //写放文件 EditTxtFieldText($truevalue, $value); $value = $truevalue; } if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) { $ret_r['datafields'] .= "," . $f; $ret_r['datavalues'] .= ",'" . addslashes($value) . "'"; } else { $ret_r['fields'] .= "," . $f; $ret_r['values'] .= ",'" . addslashes($value) . "'"; } } } elseif ($do == 1) { //数据库操作 for ($i = 1; $i < $count; $i++) { $f = $r[$i]; if ($f == "special.field" || !strstr($emod_r[$modid]['caneditf'], ',' . $f . ',')) { continue; } $add[$f] = ReturnCheckboxAddF($add[$f], $modid, $f); //复选框 $value = RepPhpAspJspcodeText($add[$f]); if ($f == 'newstime') { $value = empty($value) ? time() : to_time($value); } elseif ($f == "morepic") { $value = ReturnMorepicpath($add['msmallpic'], $add['mbigpic'], $add['mpicname'], $add['mdelpicid'], $add['mpicid'], $add, $add['mpicurl_qz'], 1); } elseif ($f == "downpath") { $value = ReturnDownpath($add['downname'], $add['downpath'], $add['delpathid'], $add['pathid'], $add['downuser'], $add['fen'], $add['thedownqz'], $add, $add['foruser'], $add['downurl_qz'], 1); } elseif ($f == "onlinepath") { $value = ReturnDownpath($add['odownname'], $add['odownpath'], $add['odelpathid'], $add['opathid'], $add['odownuser'], $add['ofen'], $add['othedownqz'], $add, $add['oforuser'], $add['onlineurl_qz'], 1); } elseif ($f == "smalltext") { if (!trim($value)) { $value = SubSmalltextVal($add[newstext], $public_r[smalltextlen]); //截取新闻内容 } } elseif ($f == 'infozm') { $value = $value ? $value : GetInfoZm($add[title]); } //处理函数 $value = DoFFun($modid, $f, $value, 0, 0); //检测必填字段 if ($ch == 1 && empty($add['titleurl'])) { ChMustAddF($modid, $f, $value); ChIsOnlyAddF($modid, $add[id], $f, $value, 0); //唯一值 } //数据同步 SameDataAddF($add[id], $add[classid], $modid, $f, $value); //内容 if ($f == "newstext") { //远程保存 $value = addslashes(CopyImg(stripSlashes($value), $add[copyimg], $add[copyflash], $add[classid], $add[qz_url], $username, $add['id'], $add['filepass'], $add['mark'])); //自动分页 if ($add[autopage] && !strstr($value, "[!--empirenews.page--]")) { if (empty($add[autosize])) { $add[autosize] = 5000; } $value = AutoDoPage($value, $add[autosize]); } } //存文本 if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) { //建立目录 $newstexttxt_r = explode("/", $add[newstext_url]); $thetxtfile = $newstexttxt_r[2]; $truevalue = MkDirTxtFile($newstexttxt_r[0] . "/" . $newstexttxt_r[1], $thetxtfile); //写放文件 EditTxtFieldText($truevalue, $value); $value = $truevalue; } if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) { $ret_r['datafields'] .= "," . $f; $ret_r['datavalues'] .= "," . $f . "='" . addslashes($value) . "'"; } else { $ret_r['fields'] .= "," . $f; $ret_r['values'] .= "," . $f . "='" . addslashes($value) . "'"; } } } elseif ($do == 8) { //数据库操作 for ($i = 1; $i < $count; $i++) { $f = $r[$i]; if ($f == 'special.field') { continue; } $value = $add[$f]; //存文本 if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) { //建立目录 $newstexttxt_r = explode("/", $add[newstext_url]); $thetxtfile = $newstexttxt_r[2]; $truevalue = MkDirTxtFile($newstexttxt_r[0] . "/" . $newstexttxt_r[1], $thetxtfile); //写放文件 EditTxtFieldText($truevalue, $value); $value = $truevalue; } if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) { $ret_r['datafields'] .= "," . $f; $ret_r['datavalues'] .= "," . $f . "='" . StripAddsData($value) . "'"; } else { $ret_r['fields'] .= "," . $f; $ret_r['values'] .= "," . $f . "='" . StripAddsData($value) . "'"; } } } elseif ($do == 9) { //数据库操作 for ($i = 1; $i < $count; $i++) { $f = $r[$i]; if ($f == 'special.field') { continue; } $value = $add[$f]; //存文本 if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) { //建立目录 $thetxtfile = GetFileMd5(); $truevalue = MkDirTxtFile(date("Y/md"), $thetxtfile); //写放文件 EditTxtFieldText($truevalue, $value); $value = $truevalue; } if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) { $ret_r['datafields'] .= "," . $f; $ret_r['datavalues'] .= ",'" . StripAddsData($value) . "'"; } else { $ret_r['fields'] .= "," . $f; $ret_r['values'] .= ",'" . StripAddsData($value) . "'"; } } } elseif ($do == 10) { //数据库操作 for ($i = 1; $i < $count; $i++) { $f = $r[$i]; if ($f == 'special.field') { continue; } $value = $add[$f]; if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) { $ret_r['datafields'] .= "," . $f; $ret_r['datavalues'] .= ",'" . StripAddsData($value) . "'"; } else { $ret_r['fields'] .= "," . $f; $ret_r['values'] .= ",'" . StripAddsData($value) . "'"; } } } return $ret_r; }
function GetAdJs($adid) { global $empire, $public_r, $dbtbpre; $r = $empire->fetch1("select * from {$dbtbpre}enewsad where adid='{$adid}'"); $file = "../../../d/js/acmsd/" . $public_r[adfile] . $adid . ".js"; //到期 if ($r['endtime'] != '0000-00-00' && time() > to_time($r['endtime'])) { $r[reptext] = ClearHtmlZs($r[reptext]); $h = addslashes(str_replace("\r\n", "", $r[reptext])); $html = "document.write(\"" . $h . "\")"; WriteFiletext_n($file, $html); return ''; } if ($r['ylink']) { $ad_url = $r['url']; } else { $ad_url = $public_r[newsurl] . "e/public/ClickAd?adid=" . $adid; //广告链接 } //----------------------文字广告 if ($r[t] == 1) { $r[titlefont] = $r[titlecolor] . ',' . $r[titlefont]; $picurl = DoTitleFont($r[titlefont], $r[picurl]); //文字属性 $h = "<a href='" . $ad_url . "' target=" . $r[target] . " title='" . $r[alt] . "'>" . addslashes($picurl) . "</a>"; //普通显示 if ($r[adtype] == 1) { $html = "document.write(\"" . $h . "\")"; } else { $html = "document.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_dialog.js></script>\"); \ndocument.write(\"<div style='position:absolute;left:300px;top:150px;width:" . $r[pic_width] . "; height:" . $r[pic_height] . ";z-index:1;solid;filter:alpha(opacity=90)' id=DGbanner5 onmousedown='down1(this)' onmousemove='move()' onmouseup='down=false'><table cellpadding=0 border=0 cellspacing=1 width=" . $r[pic_width] . " height=" . $r[pic_height] . " bgcolor=#000000><tr><td height=18 bgcolor=#5A8ACE align=right style='cursor:move;'><a href=# style='font-size: 9pt; color: #eeeeee; text-decoration: none' onClick=clase('DGbanner5') >关闭>>><img border='0' src='" . $public_r[newsurl] . "d/js/acmsd/close_o.gif'></a> </td></tr><tr><td bgcolor=f4f4f4 > " . $h . "</td></tr></table></div>\");"; } } elseif ($r[t] == 2) { $r[htmlcode] = ClearHtmlZs($r[htmlcode]); $h = addslashes(str_replace("\r\n", "", $r[htmlcode])); //普通显示 if ($r[adtype] == 1) { $html = "document.write(\"" . $h . "\")"; } else { $html = "document.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_dialog.js></script>\"); \ndocument.write(\"<div style='position:absolute;left:300px;top:150px;width:" . $r[pic_width] . "; height:" . $r[pic_height] . ";z-index:1;solid;filter:alpha(opacity=90)' id=DGbanner5 onmousedown='down1(this)' onmousemove='move()' onmouseup='down=false'><table cellpadding=0 border=0 cellspacing=1 width=" . $r[pic_width] . " height=" . $r[pic_height] . " bgcolor=#000000><tr><td height=18 bgcolor=#5A8ACE align=right style='cursor:move;'><a href=# style='font-size: 9pt; color: #eeeeee; text-decoration: none' onClick=clase('DGbanner5') >关闭>>><img border='0' src='" . $public_r[newsurl] . "d/js/acmsd/close_o.gif'></a> </td></tr><tr><td bgcolor=f4f4f4 > " . $h . "</td></tr></table></div>\");"; } } elseif ($r[t] == 3) { //打开新窗口 if ($r[adtype] == 8) { $html = "window.open('" . $r[url] . "');"; } elseif ($r[adtype] == 9) { $html = "window.open('" . $r[url] . "','','width=" . $r[pic_width] . ",height=" . $r[pic_height] . ",scrollbars=yes');"; } else { $html = "window.showModalDialog('" . $r[url] . "','','dialogWidth:" . $r[pic_width] . "px;dialogHeight:" . $r[pic_height] . "px;scroll:no;status:no;help:no');"; } } else { $filetype = GetFiletype($r[picurl]); //flash if ($filetype == ".swf") { $h = "<object classid=\\\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\\\" name=\\\"movie\\\" width=\\\"" . $r[pic_width] . "\\\" height=\\\"" . $r[pic_height] . "\\\" id=\\\"movie\\\"><param name=\\\"movie\\\" value=\\\"" . $r[picurl] . "\\\"><param name=\\\"quality\\\" value=\\\"high\\\"><param name=\\\"menu\\\" value=\\\"false\\\"><embed src=\\\"" . $r[picurl] . "\\\" width=\\\"" . $r[pic_width] . "\\\" height=\\\"" . $r[pic_height] . "\\\" quality=\\\"high\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\" type=\\\"application/x-shockwave-flash\\\" id=\\\"movie\\\" name=\\\"movie\\\" menu=\\\"false\\\"></embed><PARAM NAME='wmode' VALUE='Opaque'></object>"; } else { $h = "<a href='" . $ad_url . "' target=" . $r[target] . "><img src='" . $r[picurl] . "' border=0 width='" . $r[pic_width] . "' height='" . $r[pic_height] . "' alt='" . $r[alt] . "'></a>"; } //普通显示 if ($r[adtype] == 1) { $html = "document.write(\"" . $h . "\");"; } elseif ($r[adtype] == 4) { $html = "ns4=(document.layers)?true:false;\nie4=(document.all)?true:false;\nif(ns4){document.write(\"<layer id=DGbanner2 width=" . $r[pic_width] . " height=" . $r[pic_height] . " onmouseover=stopme('DGbanner2') onmouseout=movechip('DGbanner2')>" . $h . "</layer>\");}\nelse{document.write(\"<div id=DGbanner2 style='position:absolute; width:" . $r[pic_width] . "px; height:" . $r[pic_height] . "px; z-index:9; filter: Alpha(Opacity=90)' onmouseover=stopme('DGbanner2') onmouseout=movechip('DGbanner2')>" . $h . "</div>\");}\ndocument.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_float_fullscreen.js></script>\");"; } elseif ($r[adtype] == 5) { $html = "if (navigator.appName == 'Netscape')\n{document.write(\"<layer id=DGbanner3 top=150 width=" . $r[pic_width] . " height=" . $r[pic_height] . ">" . $h . "</layer>\");}\nelse{document.write(\"<div id=DGbanner3 style='position: absolute;width:" . $r[pic_height] . ";top:150;visibility: visible;z-index: 1'>" . $h . "</div>\");}\ndocument.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_float_upanddown.js></script>\");"; } elseif ($r[adtype] == 6) { $html = "if(navigator.appName == 'Netscape')\n{document.write(\"<layer id=DGbanner10 top=150 width=" . $r[pic_width] . " height=" . $r[pic_height] . ">" . $h . "</layer>\");}\nelse{document.write(\"<div id=DGbanner10 style='position: absolute;width:" . $r[pic_width] . ";top:150;visibility: visible;z-index: 1'>" . $h . "</div>\");}\ndocument.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_float_upanddown_L.js></script>\");"; } elseif ($r[adtype] == 7) { $html = "ns4=(document.layers)?true:false;\nif(ns4){document.write(\"<layer id=DGbanner4Cont onLoad='moveToAbsolute(layer1.pageX-160,layer1.pageY);clip.height=" . $r[pic_height] . ";clip.width=" . $r[pic_width] . "; visibility=show;'><layer id=DGbanner4News position:absolute; top:0; left:0>" . $h . "</layer></layer>\");}\nelse{document.write(\"<div id=DGbanner4 style='position:absolute;top:0; left:0;'><div id=DGbanner4Cont style='position:absolute;width:" . $r[pic_width] . ";height:" . $r[pic_height] . ";clip:rect(0," . $r[pic_width] . "," . $r[pic_height] . ",0)'><div id=DGbanner4News style='position:absolute;top:0;left:0;right:820'>" . $h . "</div></div></div>\");} \ndocument.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_fullscreen.js></script>\");"; } elseif ($r[adtype] == 3) { $html = "document.write(\"<script language=javascript src=" . $public_r[newsurl] . "d/js/acmsd/ecms_dialog.js></script>\"); \ndocument.write(\"<div style='position:absolute;left:300px;top:150px;width:" . $r[pic_width] . "; height:" . $r[pic_height] . ";z-index:1;solid;filter:alpha(opacity=90)' id=DGbanner5 onmousedown='down1(this)' onmousemove='move()' onmouseup='down=false'><table cellpadding=0 border=0 cellspacing=1 width=" . $r[pic_width] . " height=" . $r[pic_height] . " bgcolor=#000000><tr><td height=18 bgcolor=#5A8ACE align=right style='cursor:move;'><a href=# style='font-size: 9pt; color: #eeeeee; text-decoration: none' onClick=clase('DGbanner5') >关闭>>><img border='0' src='" . $public_r[newsurl] . "d/js/acmsd/close_o.gif'></a> </td></tr><tr><td bgcolor=f4f4f4 > " . $h . "</td></tr></table></div>\");"; } else { $html = "function closeAd(){huashuolayer2.style.visibility='hidden';huashuolayer3.style.visibility='hidden';}function winload(){huashuolayer2.style.top=109;huashuolayer2.style.left=5;huashuolayer3.style.top=109;huashuolayer3.style.right=5;}//if(document.body.offsetWidth>800){\n\t\t\t\t{document.write(\"<div id=huashuolayer2 style='position: absolute;visibility:visible;z-index:1'><table width=0 border=0 cellspacing=0 cellpadding=0><tr><td height=10 align=right bgcolor=666666><a href=javascript:closeAd()><img src=" . $public_r[newsurl] . "d/js/acmsd/close.gif width=12 height=10 border=0></a></td></tr><tr><td>" . $h . "</td></tr></table></div>\"+\"<div id=huashuolayer3 style='position: absolute;visibility:visible;z-index:1'><table width=0 border=0 cellspacing=0 cellpadding=0><tr><td height=10 align=right bgcolor=666666><a href=javascript:closeAd()><img src=" . $public_r[newsurl] . "d/js/acmsd/close.gif width=12 height=10 border=0></a></td></tr><tr><td>" . $h . "</td></tr></table></div>\");}winload()//}"; } } WriteFiletext_n($file, $html); }
protected function detail($pk) { $arr = $this->where(array('id' => $pk))->find('hy'); return array('table' => array('table1' => array('title' => '通知公告', 'icon' => 'fa-volume-up', 'style' => 'red', 'value' => array('标 题:' => $arr['title'], '创建时间:' => to_time($arr['create_time']), '相关文件:' => $arr['file_id'] ? '<a href="' . file_down_url($arr['file_id']) . '">下载文件</a>' : "无")), 'table2' => array('title' => '公告内容', 'icon' => 'fa-file-text', 'style' => 'purple table2', 'cols' => '0,12', 'value' => array('' => $arr['content'])))); }
function admin_ClearMember($add, $logininid, $loginin) { global $empire, $user_tablename, $user_username, $user_userid, $dbtbpre, $level_r, $user_group, $user_email, $user_checked, $user_registertime, $user_register, $user_group, $user_userfen, $user_money; CheckLevel($logininid, $loginin, $classid, "member"); //验证权限 //变量处理 $username = RepPostVar($add['username']); $email = RepPostStr($add['email']); $startuserid = (int) $add['startuserid']; $enduserid = (int) $add['enduserid']; $groupid = (int) $add['groupid']; $startregtime = RepPostVar($add['startregtime']); $endregtime = RepPostVar($add['endregtime']); $startuserfen = (int) $add['startuserfen']; $enduserfen = (int) $add['enduserfen']; $startmoney = (int) $add['startmoney']; $endmoney = (int) $add['endmoney']; $checked = (int) $add['checked']; $where = ''; if ($username) { $where .= " and " . $user_username . " like '%{$username}%'"; } if ($email) { $where .= " and " . $user_email . " like '%{$email}%'"; } if ($enduserid) { $where .= ' and ' . $user_userid . ' BETWEEN ' . $startuserid . ' and ' . $enduserid; } if ($groupid) { $where .= " and " . $user_group . "='{$groupid}'"; } if ($startregtime && $endregtime) { if ($user_register) { $startregtime = to_time($startregtime); $endregtime = to_time($endregtime); } $where .= " and " . $user_registertime . ">='{$startregtime}' and " . $user_registertime . "<='{$endregtime}'"; } if ($enduserfen) { $where .= ' and ' . $user_userfen . ' BETWEEN ' . $startuserfen . ' and ' . $enduserfen; } if ($endmoney) { $where .= ' and ' . $user_money . ' BETWEEN ' . $startmoney . ' and ' . $endmoney; } if ($checked) { $checkval = $checked == 1 ? 1 : 0; $where .= " and " . $user_checked . "='{$checkval}'"; } if (!$where) { printerror("EmptyClearMember", "history.go(-1)"); } $where = substr($where, 5); $sql = $empire->query("select " . $user_userid . "," . $user_username . "," . $user_group . " from " . $user_tablename . " where " . $where); $dh = ''; $inid = ''; while ($r = $empire->fetch($sql)) { $euid = $r[$user_userid]; //删除短信息 $dousername = doUtfAndGbk($r[$user_username], 1); //删除附加表 $fid = GetMemberFormId($r[$user_group]); DoDelMemberF($fid, $euid, $dousername); $empire->query("delete from {$dbtbpre}enewsqmsg where to_username='******'"); //集合 $inid .= $dh . $euid; $dh = ','; } if ($inid) { $addw = $user_userid . " in (" . $inid . ")"; $addaw = "userid in (" . $inid . ")"; $sql = $empire->query("delete from " . $user_tablename . " where " . $addw); //删除收藏 $del = $empire->query("delete from {$dbtbpre}enewsfava where " . $addaw); $del = $empire->query("delete from {$dbtbpre}enewsfavaclass where " . $addaw); //删除购买记录 $del = $empire->query("delete from {$dbtbpre}enewsbuybak where " . $addaw); //删除下载记录 $del = $empire->query("delete from {$dbtbpre}enewsdownrecord where " . $addaw); //删除好友记录 $del = $empire->query("delete from {$dbtbpre}enewshy where " . $addaw); $del = $empire->query("delete from {$dbtbpre}enewshyclass where " . $addaw); //删除留言 $del = $empire->query("delete from {$dbtbpre}enewsmembergbook where " . $addaw); //删除反馈 $del = $empire->query("delete from {$dbtbpre}enewsmemberfeedback where " . $addaw); } insert_dolog(""); //操作日志 printerror("DelMemberSuccess", "ClearMember.php"); }
function sys_TotalData($classid, $enews = 0, $day = 0) { global $empire, $class_r, $class_zr, $dbtbpre, $fun_r; if (empty($classid)) { return ""; } if ($day) { if ($day == 1) { $date = date("Y-m-d"); $starttime = $date . " 00:00:01"; $endtime = $date . " 23:59:59"; } elseif ($day == 2) { $date = date("Y-m"); $starttime = $date . "-01 00:00:01"; $endtime = $date . "-" . date("t") . " 23:59:59"; } elseif ($day == 3) { $date = date("Y"); $starttime = $date . "-01-01 00:00:01"; $endtime = $date + 1 . "-01-01 00:00:01"; } $and = " and newstime>=" . to_time($starttime) . " and newstime<=" . to_time($endtime); } //统计专题 if ($enews == 1) { if (empty($class_zr[$classid][tbname])) { echo $fun_r['BqErrorZid'] . "=<b>" . $classid . "</b>" . $fun_r['BqErrorNtb']; return ""; } $query = "select count(*) as total from {$dbtbpre}ecms_" . $class_zr[$classid][tbname] . " where ztid like '%|" . $classid . "|%' and checked=1" . $and; } elseif ($enews == 2) { $query = "select count(*) as total from {$dbtbpre}ecms_" . $classid . " where checked=1" . $and; } else { if (empty($class_r[$classid][tbname])) { echo $fun_r['BqErrorCid'] . "=<b>" . $classid . "</b>" . $fun_r['BqErrorNtb']; return ""; } if ($class_r[$classid][islast]) { $where = "classid='{$classid}'"; } else { $where = ReturnClass($class_r[$classid][sonclass]); } $query = "select count(*) as total from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " where " . $where . " and checked=1" . $and; } $num = $empire->gettotal($query); echo $num; }
printerror("ErrorUrl", "history.go(-1)"); } //未审核 $query = "select count(*) as total from {$dbtbpre}ecms_" . $class_zr[$ztid][tbname] . " where checked=0 and ztid like '%|{$ztid}|%'"; //已审核 $query1 = "select count(*) as total from {$dbtbpre}ecms_" . $class_zr[$ztid][tbname] . " where checked=1 and ztid like '%|{$ztid}|%'"; //点击 $onclickquery = "select avg(onclick) as total from {$dbtbpre}ecms_" . $class_zr[$ztid][tbname] . " where 1=1 and ztid like '%|{$ztid}|%'"; } else { printerror("ErrorUrl", "history.go(-1)"); } //时间 if ($startday && $endday) { $start = $startday . " 00:00:00"; $end = $endday . " 23:59:59"; $timeadd = " and (newstime>='" . to_time($start) . "' and newstime<='" . to_time($end) . "')"; $query .= $timeadd; $query1 .= $timeadd; $onclickquery .= $timeadd; } //用户 if ($userid) { $useradd = " and userid='{$userid}'"; $query .= $useradd; $query1 .= $useradd; $onclickquery .= $useradd; } //数据表 $htb = 0; $tbsql = $empire->query("select tbname,tname from {$dbtbpre}enewstable order by tid"); while ($tbr = $empire->fetch($tbsql)) {
function EditSpInfoTime($add, $userid, $username) { global $empire, $dbtbpre; $spid = (int) $add[spid]; $sid = $add[sid]; $newstime = $add[newstime]; if (!$spid) { printerror('ErrorUrl', ''); } $count = count($sid); if (!$count) { printerror('EmptySpInfoTime', ''); } //验证 $spr = CheckSpInfoLevel($spid); if ($spr[sptype] == 1) { for ($i = 0; $i < $count; $i++) { $dosid = (int) $sid[$i]; $donewstime = $newstime[$i] ? to_time($newstime[$i]) : time(); $empire->query("update {$dbtbpre}enewssp_1 set newstime='{$donewstime}' where sid='{$dosid}' and spid='{$spid}'"); } } elseif ($spr[sptype] == 2) { for ($i = 0; $i < $count; $i++) { $dosid = (int) $sid[$i]; $donewstime = $newstime[$i] ? to_time($newstime[$i]) : time(); $empire->query("update {$dbtbpre}enewssp_2 set newstime='{$donewstime}' where sid='{$dosid}' and spid='{$spid}'"); } } else { printerror('ErrorUrl', ''); } //操作日志 insert_dolog("spid={$spid}"); printerror("EditSpInfoTimeSuccess", "ListSpInfo.php?spid={$spid}"); }
function TogZt($add, $userid, $username) { global $empire, $class_r, $dbtbpre; $ztid = (int) $add['ztid']; if (empty($ztid)) { printerror("ErrorUrl", "history.go(-1)"); } $r = $empire->fetch1("select ztid,ztname,tbname from {$dbtbpre}enewszt where ztid={$ztid}"); if (empty($r['ztid']) || empty($r['tbname'])) { printerror("ErrorUrl", "history.go(-1)"); } $wheresql = ""; $formvar = ""; //关键字 $keyboard = RepPostVar2($add['keyboard']); if ($keyboard) { $formvar .= ReturnFormHidden('keyboard', $add['keyboard']); $searchfsql = ''; if ($add['stitle']) { $searchfsql .= "title like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('stitle', $add['stitle']); } if ($add['susername']) { if ($searchfsql) { $or = " or "; } $searchfsql .= $or . "username like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('susername', $add['susername']); } if ($add['snewstext']) { $or = ""; if ($searchfsql) { $or = " or "; } $searchfsql .= $or . "newstext like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('snewstext', $add['snewstext']); } if ($searchfsql) { $wheresql = " and (" . $searchfsql . ")"; } } //是否推荐 if ($add['isgood']) { $wheresql .= " and isgood>0"; $formvar .= ReturnFormHidden('isgood', $add['isgood']); } //头条 if ($add['firsttitle']) { $wheresql .= " and firsttitle>0"; $formvar .= ReturnFormHidden('firsttitle', $add['firsttitle']); } //有标题图片 if ($add['titlepic']) { $wheresql .= " and ispic=1"; $formvar .= ReturnFormHidden('titlepic', $add['titlepic']); } //审核 if ($add['checked']) { $wheresql .= " and checked=1"; $formvar .= ReturnFormHidden('checked', $add['checked']); } //按栏目刷新 $classid = (int) $add['classid']; if ($classid) { $formvar .= ReturnFormHidden('classid', $add['classid']); //大栏目 if (empty($class_r[$classid][islast])) { $where = ReturnClass($class_r[$classid][sonclass]); } else { $where = "classid='{$classid}'"; } $wheresql .= " and (" . $where . ")"; } $startid = (int) $add[startid]; $endid = (int) $add[endid]; $startday = RepPostVar($add[startday]); $endday = RepPostVar($add[endday]); $formvar .= ReturnFormHidden('retype', $add['retype']); //按ID if ($add['retype']) { if ($endid) { $wheresql .= " and id>={$startid} and id<={$endid}"; $formvar .= ReturnFormHidden('startid', $add[startid]) . ReturnFormHidden('endid', $add[endid]); } } else { if ($startday && $endday) { $wheresql .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59"); $formvar .= ReturnFormHidden('startday', $add[startday]) . ReturnFormHidden('endday', $add[endday]); } } //附件sql条件 $query = $add['query']; if ($query) { $query = ClearAddsData($query); //去除adds $wheresql .= " and (" . $query . ")"; $formvar .= ReturnFormHidden('query', $add['query']); } $wheresql = " where ztid not like '%|" . $ztid . "|%'" . $wheresql; $owheresql = $wheresql . " and ztid=''"; if ($add['doecmszt']) { if ($add['inid']) { $add['inid'] = RepPostVar($add['inid']); $wheresql .= " and id not in (" . $add['inid'] . ")"; $owheresql .= " and id not in (" . $add['inid'] . ")"; } $repztid = "|" . $ztid . "|"; $conztid = $ztid . "|"; //将空格转换成| $usql = $empire->query("update {$dbtbpre}ecms_" . $r['tbname'] . " set ztid='|'" . $owheresql); //组成新专题 $sql = $empire->query("update {$dbtbpre}ecms_" . $r['tbname'] . " set ztid=CONCAT(REPLACE(ztid,'" . $repztid . "','|'),'" . $conztid . "')" . $wheresql); if ($usql && $sql) { //操作日志 insert_dolog("ztid={$ztid}&ztname={$r['ztname']}"); printerror("TogZtSuccess", "TogZt.php?ztid={$ztid}"); } else { printerror("DbError", "history.go(-1)"); } } $re[0] = $wheresql; $re[1] = $formvar . ReturnFormHidden('ztid', $ztid) . ReturnFormHidden('pline', $add[pline]) . ReturnFormHidden('doecmszt', $add[doecmszt]) . ReturnFormHidden('enews', $add[enews]) . ReturnFormHidden('inid', $add[inid]); $re[2] = $r['tbname']; $re[3] = $r['ztname']; return $re; }
public function detail($pk) { $associate = array('user|user_id|id|user_no,name,sex,phone,roles,email,login_last_time,login_times,avatar_file'); $arr = $this->associate($associate)->where(array('user.id' => $pk))->find(); return array('table' => array('base' => array('title' => '基础信息', 'icon' => 'fa-list-alt', 'style' => 'green', 'value' => array('姓名:' => val_decrypt($arr['name']), '性别:' => $arr['sex'], '电话:' => val_decrypt($arr['phone']), '邮箱:' => $arr['email'])), 'teacher' => array('title' => '教工信息', 'icon' => 'fa-book', 'style' => 'purple', 'value' => array('教工号:' => $arr['user_no'], '职务:' => $arr['job'], '备注:' => $arr['remark'])), 'user' => array('title' => '账号信息', 'icon' => 'fa-user', 'style' => 'yellow', 'value' => array('头像:' => HomkaiServiceModel::getAvatarTpl($arr['avatar_file']), '上次登录:' => to_time($arr['login_last_time']), '累计登录:' => ($arr['login_times'] ?: 0) . '次')))); }
function TogZt($add, $userid, $username) { global $empire, $class_r, $dbtbpre; $ztid = (int) $add['ztid']; if (empty($ztid)) { printerror("ErrorUrl", "history.go(-1)"); } $r = $empire->fetch1("select ztid,ztname from {$dbtbpre}enewszt where ztid='{$ztid}'"); if (empty($r['ztid'])) { printerror("ErrorUrl", "history.go(-1)"); } $zcid = (int) $add['zcid']; $tbname = RepPostVar($add['tbname']); if (!$tbname) { printerror('EmptyTogZt', 'history.go(-1)'); } $tbr = $empire->fetch1("select tid from {$dbtbpre}enewstable where tbname='{$tbname}' limit 1"); if (!$tbr['tid']) { printerror('EmptyTogZt', 'history.go(-1)'); } $wheresql = ""; $formvar = ""; //关键字 $keyboard = RepPostVar2($add['keyboard']); if ($keyboard) { $formvar .= ReturnFormHidden('keyboard', $add['keyboard']); $searchfsql = ''; if ($add['stitle']) { $searchfsql .= "title like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('stitle', $add['stitle']); } if ($add['susername']) { if ($searchfsql) { $or = " or "; } $searchfsql .= $or . "username like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('susername', $add['susername']); } if ($searchfsql) { $wheresql = " and (" . $searchfsql . ")"; } } //是否推荐 if ($add['isgood']) { $wheresql .= " and isgood>0"; $formvar .= ReturnFormHidden('isgood', $add['isgood']); } //头条 if ($add['firsttitle']) { $wheresql .= " and firsttitle>0"; $formvar .= ReturnFormHidden('firsttitle', $add['firsttitle']); } //有标题图片 if ($add['titlepic']) { $wheresql .= " and ispic=1"; $formvar .= ReturnFormHidden('titlepic', $add['titlepic']); } //按栏目刷新 $classid = (int) $add['classid']; if ($classid) { $formvar .= ReturnFormHidden('classid', $classid); if (empty($class_r[$classid][islast])) { $where = ReturnClass($class_r[$classid][sonclass]); } else { $where = "classid='{$classid}'"; } $wheresql .= " and (" . $where . ")"; } $startid = (int) $add[startid]; $endid = (int) $add[endid]; $startday = RepPostVar($add[startday]); $endday = RepPostVar($add[endday]); $formvar .= ReturnFormHidden('retype', $add['retype']); //按ID if ($add['retype']) { if ($endid) { $wheresql .= " and id>={$startid} and id<={$endid}"; $formvar .= ReturnFormHidden('startid', $add[startid]) . ReturnFormHidden('endid', $add[endid]); } } else { if ($startday && $endday) { $wheresql .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59"); $formvar .= ReturnFormHidden('startday', $add[startday]) . ReturnFormHidden('endday', $add[endday]); } } //附件sql条件 $query = $add['query']; if ($query) { $query = ClearAddsData($query); //去除adds $wheresql .= " and (" . $query . ")"; $formvar .= ReturnFormHidden('query', $add['query']); } if (empty($wheresql)) { printerror('EmptyTogZt', 'history.go(-1)'); } $wheresql = substr($wheresql, 5); if ($add['doecmszt']) { $togtype = (int) $add['togtype']; if ($togtype == 1) { $add['inid'] = eReturnInids($add['inid']); $wheresql = "id in (" . $add['inid'] . ")"; } else { if ($add['inid']) { $add['inid'] = eReturnInids($add['inid']); $wheresql .= " and id not in (" . $add['inid'] . ")"; } } AddMoreInfoToZt($ztid, $zcid, $tbname, $wheresql); //操作日志 insert_dolog("ztid={$ztid}&ztname={$r['ztname']}"); printerror("TogZtSuccess", "TogZt.php?ztid={$ztid}" . hReturnEcmsHashStrHref2(0)); } $re[0] = $wheresql; $re[1] = $formvar . ReturnFormHidden('ztid', $ztid) . ReturnFormHidden('zcid', $zcid) . ReturnFormHidden('tbname', $tbname) . ReturnFormHidden('pline', $add[pline]) . ReturnFormHidden('doecmszt', $add[doecmszt]) . ReturnFormHidden('enews', $add[enews]) . ReturnFormHidden('inid', $add[inid]); $re[2] = $tbname; $re[3] = $r['ztname']; return $re; }
function InfoToDoc($add, $userid, $username) { global $empire, $dbtbpre, $public_r, $class_r; //操作权限 CheckLevel($userid, $username, $classid, "infodoc"); $tbname = RepPostVar($add['tbname']); if (empty($tbname)) { printerror("EmptyDocTb", ""); } $selecttbname = $tbname; if ($add['doing'] == 1) { $selecttbname = $tbname . '_doc'; } $search = "&retype={$add['retype']}"; if ($add['retype'] == 0) { if ($add['doing'] == 1) { $doctime = (int) $add['doctime1']; $dx = ">"; } else { $doctime = (int) $add['doctime']; $dx = "<"; } if (!$doctime) { printerror("EmptyDoctime", ""); } $chtime = time() - $doctime * 24 * 3600; $where = 'truetime' . $dx . $chtime; $log = "doctime={$doctime}"; $search .= "&doctime={$add['doctime']}&doctime1={$add['doctime1']}"; } elseif ($add['retype'] == 1) { $startday = RepPostVar($add['startday']); $endday = RepPostVar($add['endday']); if (!$endday) { printerror("EmptyDocDay", ""); } if ($startday) { $where = "truetime>=" . to_time($startday . " 00:00:00") . " and "; } $where .= "truetime<=" . to_time($endday . " 23:59:59"); $log = "startday={$startday}&endday={$endday}"; $search .= "&startday={$add['startday']}&endday={$add['endday']}"; } else { $startid = (int) $add['startid']; $endid = (int) $add['endid']; if (!$endid) { printerror("EmptyDocId", ""); } if ($startid) { $where = "id>=" . $startid . " and "; } $where .= "id<=" . $endid; $log = "startid={$startid}&endid={$endid}"; $search .= "&startid={$add['startid']}&endid={$add['endid']}"; } //栏目 $classid = $add['classid']; $count = count($classid); if ($count) { for ($i = 0; $i < $count; $i++) { $dh = ","; if ($i == 0) { $dh = ""; } $ids .= $dh . intval($classid[$i]); $search .= '&classid[]=' . $classid[$i]; } $where .= " and classid in (" . $ids . ")"; } $log .= "<br>doing={$add['doing']}"; $start = (int) $add['start']; $line = $public_r['docnewsnum']; $b = 0; $sql = $empire->query("select * from {$dbtbpre}ecms_" . $selecttbname . " where id>{$start} and " . $where . " order by id limit " . $line); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r['id']; DoDocInfo($tbname, $r, $add['doing']); } if (empty($b)) { //未审核信息归档 DoDocCkInfo($tbname, $where, $add['doing']); $add['docfrom'] = urldecode($add['docfrom']); //操作日志 insert_dolog("tbname=" . $tbname . $log . "&doing={$add['doing']}&do=2"); printerror("InfoToDocSuccess", $add['docfrom']); } echo $fun_r[OneInfoToDocSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)<script>self.location.href='ecmsinfo.php?enews=InfoToDoc&ecmsdoc=2&doing={$add['doing']}&tbname={$tbname}&start={$new_start}&docfrom=" . urlencode($add[docfrom]) . $search . hReturnEcmsHashStrHref(0) . "';</script>"; exit; }
if($r['haveprice']==1) { $ha="已付款"; } else { $ha="<font color=red>未付款</font>"; } //操作 $doing='<a href="../doaction.php?enews=DelDd&ddid='.$r[ddid].'" onclick="return confirm(\'确认要取消?\');">取消</a>'; if($r['checked']||$r['outproduct']||$r['haveprice']) { $doing='--'; } $dddeltime=$shoppr['dddeltime']*60; if($todaytime-$dddeltime>to_time($r['ddtime'])) { $doing='--'; } ?> <tr bgcolor="#FFFFFF"> <td height="25"> <div align="center"> <?php echo $j; ?> </div></td> <td> <div align="center"><a href="#ecms" onclick="window.open('../ShowDd/?ddid=<?php echo $r[ddid]; ?> ','','width=700,height=600,scrollbars=yes,resizable=yes');"> <?php
function DodoInfo($add, $ecms = 0) { global $empire, $public_r, $emod_r, $level_r, $class_r, $dbtbpre, $fun_r; //验证来源 if ($ecms == 0 || $ecms == 1) { CheckCanPostUrl(); } //开启投稿 if ($public_r['addnews_ok']) { printerror("CloseQAdd", "", 1); } //验证本时间允许操作 eCheckTimeCloseDo('info'); $classid = (int) $add['classid']; $mid = (int) $class_r[$classid]['modid']; if (!$mid || !$classid) { printerror("EmptyQinfoCid", "", 1); } $tbname = $emod_r[$mid]['tbname']; $qenter = $emod_r[$mid]['qenter']; if (!$tbname || !$qenter || $qenter == ',') { printerror("ErrorUrl", "history.go(-1)", 1); } $muserid = (int) getcvar('mluserid'); $musername = RepPostVar(getcvar('mlusername')); $mrnd = RepPostVar(getcvar('mlrnd')); //取得栏目信息 $isadd = 0; if ($ecms == 0) { $isadd = 1; } $setuserday = ''; $cr = DoQCheckAddLevel($classid, $muserid, $musername, $mrnd, $ecms, $isadd); $setuserday = $cr['checkaddnumquery']; $filepass = (int) $add['filepass']; $id = (int) $add['id']; $infor = array(); //组合标题属性 $titlecolor = RepPostStr(RepPhpAspJspcodeText($add[titlecolor])); $titlefont = TitleFont($add[titlefont], $titlecolor); $titlecolor = ""; $titlefont = ""; $ttid = (int) $add['ttid']; $keyboard = addslashes(RepPostStr(trim(DoReplaceQjDh($add[keyboard])))); $keyid = ''; //返回关键字组合 if ($keyboard && strstr($qenter, ',special.field,')) { $keyboard = str_replace('[!--f--!]', 'ecms', $keyboard); $keyid = GetKeyid($keyboard, $classid, $id, $class_r[$classid][link_num]); } //验证码 $keyvname = 'checkinfokey'; //moreport if (Moreport_ReturnMustDt()) { define('ECMS_SELFPATH', eReturnEcmsMainPortPath()); Moreport_ResetMainTempGid(); } //-----------------增加 if ($ecms == 0) { //时间 $lasttime = getcvar('lastaddinfotime'); if ($lasttime) { if (time() - $lasttime < $public_r['readdinfotime']) { printerror("QAddInfoOutTime", "", 1); } } //验证码 if ($cr['qaddshowkey']) { ecmsCheckShowKey($keyvname, $add['key'], 1); } //IP发布数限制 $check_ip = egetip(); $check_checked = $cr['wfid'] ? 0 : $cr['checkqadd']; eCheckIpAddInfoNum($check_ip, $tbname, $mid, $check_checked); //返回字段 $ret_r = ReturnQAddinfoF($mid, $add, $infor, $classid, $filepass, $muserid, $musername, 0); $checked = $cr['checkqadd']; $havehtml = 0; $newspath = date($cr['newspath']); $truetime = time(); $newstime = $truetime; $newstempid = $cr['newstempid']; $haveaddfen = 0; //强制签发 $isqf = 0; if ($cr['wfid']) { $checked = 0; $isqf = 1; } //增扣点 if ($checked && $muserid) { AddInfoFen($cr['addinfofen'], $muserid); $haveaddfen = 1; } if (empty($muserid)) { $musername = $fun_r['guest']; } //会员投稿数更新 if ($setuserday) { $empire->query($setuserday); } //发布时间 if (!strstr($qenter, ',newstime,')) { $ret_r[0] = ",newstime" . $ret_r[0]; $ret_r[1] = ",'{$newstime}'" . $ret_r[1]; } else { if ($add['newstime']) { $newstime = to_time($add['newstime']); $newstime = intval($newstime); } } //附加链接参数 $addecmscheck = empty($checked) ? '&ecmscheck=1' : ''; //索引表 $indexsql = $empire->query("insert into {$dbtbpre}ecms_" . $tbname . "_index(classid,checked,newstime,truetime,lastdotime,havehtml) values('{$classid}','{$checked}','{$newstime}','{$truetime}','{$truetime}','{$havehtml}');"); $id = $empire->lastid(); //返回表信息 $infotbr = ReturnInfoTbname($tbname, $checked, $ret_r[4]); //主表 $sql = $empire->query("insert into " . $infotbr['tbname'] . "(id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard" . $ret_r[0] . ") values('{$id}','{$classid}','{$ttid}',0,0,0,'{$newspath}','','" . $muserid . "','" . addslashes($musername) . "',0,0,0,'{$isqf}',1,0,'{$truetime}','{$truetime}','{$havehtml}',0,0,'{$titlefont}','','{$ret_r['4']}','{$public_r['filedeftb']}','{$public_r['pldeftb']}','{$keyboard}'" . $ret_r[1] . ");"); //副表 $fsql = $empire->query("insert into " . $infotbr['datatbname'] . "(id,classid,keyid,dokey,newstempid,closepl,haveaddfen,infotags" . $ret_r[2] . ") values('{$id}','{$classid}','{$keyid}',1,'{$newstempid}',0,'{$haveaddfen}',''" . $ret_r[3] . ");"); //扣点记录 if ($haveaddfen) { if ($cr['addinfofen'] < 0) { BakDown($classid, $id, 0, $muserid, $musername, RepPostStr($add[title]), abs($cr['addinfofen']), 3); } } //签发 if ($isqf == 1) { InfoInsertToWorkflow($id, $classid, $cr['wfid'], $muserid, addslashes($musername)); } //文件命名 $filename = ReturnInfoFilename($classid, $id, ''); //信息地址 $infourl = GotoGetTitleUrl($classid, $id, $newspath, $filename, 0, 0, ''); $usql = $empire->query("update " . $infotbr['tbname'] . " set filename='{$filename}',titleurl='{$infourl}' where id='{$id}'"); //修改ispic UpdateTheIspic($classid, $id, $checked); //修改附件 if ($filepass) { UpdateTheFile($id, $filepass, $classid, $public_r['filedeftb']); } //更新栏目信息数 AddClassInfos($classid, '+1', '+1', $checked); //更新新信息数 DoUpdateAddDataNum('info', $class_r[$classid]['tid'], 1); //清除验证码 ecmsEmptyShowKey($keyvname); esetcookie("qeditinfo", "", 0); //生成页面 if ($checked && !$cr['showdt']) { $titleurl = qAddGetHtml($classid, $id); } //生成列表 if ($checked) { qAddListHtml($classid, $mid, $cr['qaddlist'], $cr['listdt']); //生成上一篇 if ($cr['repreinfo']) { $prer = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id<{$id} and classid='{$classid}' order by id desc limit 1"); GetHtml($prer['classid'], $prer['id'], $prer, 1); } } if ($sql) { $reurl = DoingReturnUrl("AddInfo.php?classid={$classid}&mid={$mid}" . $addecmscheck, $add['ecmsfrom']); if ($add['gotoinfourl'] && $checked) { if ($cr['showdt'] == 1) { $reurl = $public_r[newsurl] . "e/action/ShowInfo/?classid={$classid}&id={$id}"; } elseif ($cr['showdt'] == 2) { $rewriter = eReturnRewriteInfoUrl($classid, $id, 1); $reurl = $rewriter['pageurl']; } else { $reurl = $titleurl; } } esetcookie("lastaddinfotime", time(), time() + 3600 * 24); //设置最后发表时间 printerror("AddQinfoSuccess", $reurl, 1); } else { printerror("DbError", "history.go(-1)", 1); } } elseif ($ecms == 1) { if (!$id) { printerror("ErrorUrl", "history.go(-1)", 1); } //检测权限 $infor = CheckQdoinfo($classid, $id, $muserid, $tbname, $cr['adminqinfo'], 1); //检测时间 if ($public_r['qeditinfotime']) { if (time() - $infor['truetime'] > $public_r['qeditinfotime'] * 60) { printerror("QEditInfoOutTime", "history.go(-1)", 1); } } $iaddfield = ''; $addfield = ''; $faddfield = ''; //返回字段 $ret_r = ReturnQAddinfoF($mid, $add, $infor, $classid, $filepass, $muserid, $musername, 1); if ($keyboard) { $addfield = ",keyboard='{$keyboard}'"; $faddfield = ",keyid='{$keyid}'"; } //时间 if (strstr($qenter, ',newstime,')) { if ($add['newstime']) { $newstime = to_time($add['newstime']); $newstime = intval($newstime); $iaddfield .= ",newstime='{$newstime}'"; } } //修改是否需要审核 $ychecked = $infor['checked']; if ($cr['qeditchecked']) { $infor['checked'] = 0; $iaddfield .= ",checked=0"; $relist = 1; //删除原页面 DelNewsFile($infor[filename], $infor[newspath], $infor[classid], $infor[newstext], $infor[groupid]); } //会员投稿数更新 if ($setuserday) { //$empire->query($setuserday); } $lastdotime = time(); //附加链接参数 $addecmscheck = empty($infor['checked']) ? '&ecmscheck=1' : ''; //索引表 $indexsql = $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set lastdotime={$lastdotime},havehtml=0" . $iaddfield . " where id='{$id}'"); //返回表信息 $infotbr = ReturnInfoTbname($tbname, $ychecked, $infor['stb']); //主表 $sql = $empire->query("update " . $infotbr['tbname'] . " set lastdotime={$lastdotime},havehtml=0,ttid='{$ttid}'" . $addfield . $ret_r[0] . " where id={$id} and classid={$classid} and userid='{$muserid}' and ismember=1"); //副表 $fsql = $empire->query("update " . $infotbr['datatbname'] . " set classid='{$classid}'" . $faddfield . $ret_r[3] . " where id='{$id}'"); //修改ispic UpdateTheIspic($classid, $id, $ychecked); //更新附件 UpdateTheFileEdit($classid, $id, $infor['fstb']); //未审核信息互转 if ($ychecked != $infor['checked']) { MoveCheckInfoData($tbname, $ychecked, $infor['stb'], "id='{$id}'"); //更新栏目信息数 if ($infor['checked']) { AddClassInfos($classid, '', '+1'); } else { AddClassInfos($classid, '', '-1'); } } esetcookie("qeditinfo", "", 0); //生成页面 if ($infor['checked'] && !$cr['showdt']) { $titleurl = qAddGetHtml($classid, $id); } //生成列表 if ($infor['checked'] || $relist == 1) { qAddListHtml($classid, $mid, $cr['qaddlist'], $cr['listdt']); } //生成上一篇 if ($cr['repreinfo'] && $infor['checked']) { $prer = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id<{$id} and classid='{$classid}' order by id desc limit 1"); GetHtml($prer['classid'], $prer['id'], $prer, 1); } if ($sql) { $reurl = DoingReturnUrl("ListInfo.php?mid={$mid}" . $addecmscheck, $add['ecmsfrom']); if ($add['editgotoinfourl'] && $infor['checked']) { if ($cr['showdt'] == 1) { $reurl = $public_r[newsurl] . "e/action/ShowInfo/?classid={$classid}&id={$id}"; } elseif ($cr['showdt'] == 2) { $rewriter = eReturnRewriteInfoUrl($classid, $id, 1); $reurl = $rewriter['pageurl']; } else { $reurl = $titleurl; } } printerror("EditQinfoSuccess", $reurl, 1); } else { printerror("DbError", "history.go(-1)", 1); } } elseif ($ecms == 2) { if (!$id) { printerror("ErrorUrl", "history.go(-1)", 1); } //检测权限 $r = CheckQdoinfo($classid, $id, $muserid, $tbname, $cr['adminqinfo'], 2); //附加链接参数 $addecmscheck = empty($r['checked']) ? '&ecmscheck=1' : ''; //返回表信息 $infotbr = ReturnInfoTbname($tbname, $r['checked'], $r['stb']); $stf = $emod_r[$mid]['savetxtf']; $pf = $emod_r[$mid]['pagef']; //分页字段 if ($pf) { if (strstr($emod_r[$mid]['tbdataf'], ',' . $pf . ',')) { $finfor = $empire->fetch1("select " . $pf . " from " . $infotbr['datatbname'] . " where id='{$id}' limit 1"); $r[$pf] = $finfor[$pf]; } } //存文本 if ($stf) { $newstextfile = $r[$stf]; $r[$stf] = GetTxtFieldText($r[$stf]); //删除文件 DelTxtFieldText($newstextfile); } //删除信息文件 DelNewsFile($r[filename], $r[newspath], $classid, $r[$pf], $r[groupid]); $indexsql = $empire->query("delete from {$dbtbpre}ecms_" . $tbname . "_index where id='{$id}'"); $sql = $empire->query("delete from " . $infotbr['tbname'] . " where id={$id} and classid={$classid} and userid='{$muserid}' and ismember=1"); $fsql = $empire->query("delete from " . $infotbr['datatbname'] . " where id={$id}"); esetcookie("qdelinfo", "", 0); //更新栏目信息数 AddClassInfos($classid, '-1', '-1', $r['checked']); //删除其它表记录和附件 DelSingleInfoOtherData($classid, $id, $r, 0, 0); //生成列表 if ($r['checked']) { qAddListHtml($classid, $mid, $cr['qaddlist'], $cr['listdt']); //生成上一篇 if ($cr['repreinfo']) { $prer = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id<{$id} and classid='{$classid}' order by id desc limit 1"); GetHtml($prer['classid'], $prer['id'], $prer, 1); //下一篇 $nextr = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id>{$id} and classid='{$classid}' order by id limit 1"); if ($nextr['id']) { GetHtml($nextr['classid'], $nextr['id'], $nextr, 1); } } } if ($sql) { $reurl = DoingReturnUrl("ListInfo.php?mid={$mid}", $add['ecmsfrom']); printerror("DelQinfoSuccess", $reurl, 1); } else { printerror("DbError", "history.go(-1)", 1); } } else { printerror("ErrorUrl", "", 1); } }
$dr[0] = (int) $dr[0]; $dr[1] = (int) $dr[1]; for ($j = 1; $j <= 31; $j++) { //检测日期合法性 if (!checkdate($dr[1], $j, $dr[0])) { continue; } $d = $j; if ($j < 10) { $d = '0' . $j; } $thisday = $date . '-' . $d; //发布数 $totalnum = $empire->gettotal("select count(*) as total from {$dbtbpre}ecms_" . $tbname . " where userid='{$userid}' and ismember=0 and truetime>=" . to_time($thisday . " 00:00:00") . " and truetime<=" . to_time($thisday . " 23:59:59")); //未审核数 $totalchecknum = $empire->gettotal("select count(*) as total from {$dbtbpre}ecms_" . $tbname . "_check where userid='{$userid}' and ismember=0 and truetime>=" . to_time($thisday . " 00:00:00") . " and truetime<=" . to_time($thisday . " 23:59:59")); ?> <tr bgcolor="#FFFFFF"> <td height="25"><div align="center"> <?php echo $thisday; ?> </div></td> <td height="25"><div align="center"> <?php echo $totalnum + $totalchecknum; ?> </div></td> <td><div align="center"><?php echo $totalchecknum; ?>
function sys_TotalData($classid, $enews = 0, $day = 0, $totaltype = 0) { global $empire, $class_r, $class_zr, $dbtbpre, $fun_r, $class_tr; if (empty($classid)) { return ""; } //统计类型 if ($totaltype == 1) { $totalfield = 'sum(plnum) as total'; } elseif ($totaltype == 2) { $totalfield = 'sum(onclick) as total'; } elseif ($totaltype == 3) { $totalfield = 'sum(totaldown) as total'; } else { $totalfield = 'count(*) as total'; } if ($day) { if ($day == 1) { $date = date("Y-m-d"); $starttime = $date . " 00:00:01"; $endtime = $date . " 23:59:59"; } elseif ($day == 2) { $date = date("Y-m"); $starttime = $date . "-01 00:00:01"; $endtime = $date . "-" . date("t") . " 23:59:59"; } elseif ($day == 3) { $date = date("Y"); $starttime = $date . "-01-01 00:00:01"; $endtime = $date + 1 . "-01-01 00:00:01"; } $and = " and newstime>=" . to_time($starttime) . " and newstime<=" . to_time($endtime); } if ($enews == 1) { if (empty($class_tr[$classid][tbname])) { echo $fun_r['BqErrorTtid'] . "=<b>" . $classid . "</b>" . $fun_r['BqErrorNtb']; return ""; } $query = "select " . $totalfield . " from {$dbtbpre}ecms_" . $class_tr[$classid][tbname] . " where ttid='{$classid}'" . $and; } elseif ($enews == 2) { $query = "select " . $totalfield . " from {$dbtbpre}ecms_" . $classid . (empty($and) ? '' : ' where ' . substr($and, 5)); } else { if (empty($class_r[$classid][tbname])) { echo $fun_r['BqErrorCid'] . "=<b>" . $classid . "</b>" . $fun_r['BqErrorNtb']; return ""; } if ($class_r[$classid][islast]) { $where = "classid='{$classid}'"; } else { $where = ReturnClass($class_r[$classid][sonclass]); } $query = "select " . $totalfield . " from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " where " . $where . $and; } $num = $empire->gettotal($query); echo $num; }
function ReNewsHtml($start, $classid, $from, $retype, $startday, $endday, $startid, $endid, $tbname, $havehtml) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre, $etable_r; $tbname = RepPostVar($tbname); if (empty($tbname) || !eCheckTbname($tbname)) { printerror("ErrorUrl", "history.go(-1)"); } $start = (int) $start; //按ID if ($retype) { $startid = (int) $startid; $endid = (int) $endid; $add1 = $endid ? ' and id>=' . $startid . ' and id<=' . $endid : ''; } else { $startday = RepPostVar($startday); $endday = RepPostVar($endday); $add1 = $startday && $endday ? ' and truetime>=' . to_time($startday . ' 00:00:00') . ' and truetime<=' . to_time($endday . ' 23:59:59') : ''; } //按栏目 $classid = (int) $classid; if ($classid) { $where = empty($class_r[$classid][islast]) ? ReturnClass($class_r[$classid][sonclass]) : "classid='{$classid}'"; $add1 .= ' and ' . $where; } //不生成 $add1 .= ReturnNreInfoWhere(); //是否重复生成 $updatehavehtml = 'havehtml=0'; if ($havehtml != 1) { $add1 .= ' and havehtml=0'; $updatehavehtml = ''; } //优化 $yhadd = ''; $yhid = $etable_r[$tbname][yhid]; $yhvar = 'rehtml'; if ($yhid) { $yhadd = ReturnYhSql($yhid, $yhvar, 1); } $b = 0; $sql = $empire->query("select id,classid from {$dbtbpre}ecms_" . $tbname . "_index where " . $yhadd . "id>{$start}" . $add1 . " and checked=1 order by id limit " . $public_r[renewsnum]); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r[id]; if ($class_r[$r[classid]][showdt] == 2) { continue; } GetHtml($r['classid'], $r['id'], '', 0, 1); //生成信息文件 } if (empty($b)) { //更新状态 if ($yhadd . $add1 == '') { $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set havehtml=1 where havehtml=0 and checked=1"); $empire->query("update {$dbtbpre}ecms_" . $tbname . " set havehtml=1 where havehtml=0"); } else { if ($updatehavehtml) { $updatehavehtml = ' and ' . $updatehavehtml; } if ($yhadd && $add1) { $truewhereindex = $yhadd . substr($add1, 5) . ' and checked=1'; $truewhere = $yhadd . substr($add1, 5); } elseif ($yhadd && !$add1) { $truewhereindex = $yhadd . 'checked=1'; $truewhere = substr($yhadd, 0, -5); } else { $truewhereindex = substr($add1, 5) . ' and checked=1'; $truewhere = substr($add1, 5); } $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set havehtml=1 where " . $truewhereindex . $updatehavehtml); $empire->query("update {$dbtbpre}ecms_" . $tbname . " set havehtml=1 where " . $truewhere . $updatehavehtml); } echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><center><b>" . $tbname . $fun_r[ReTableIsOK] . "!</b></center>"; db_close(); $empire = null; exit; } echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><meta http-equiv=\"refresh\" content=\"" . $public_r['realltime'] . ";url=ecmschtml.php?enews=ReNewsHtml&tbname={$tbname}&classid={$classid}&start={$new_start}&from=" . urlencode($from) . "&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}&havehtml={$havehtml}&reallinfotime=" . ehtmlspecialchars($_GET['reallinfotime']) . hReturnEcmsHashStrHref(0) . "\">" . $fun_r[OneReNewsHtmlSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)"; exit; }
function ChangeInfoOtherLink($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)"); } //按栏目刷新 $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[infolinknum]); while($r=$empire->fetch($sql)) { $b=1; $new_start=$r[id]; //手动相关链接 $pubid=ReturnInfoPubid($r['classid'],$r['id']); $infopr=$empire->fetch1("select diyotherlink from {$dbtbpre}enewsinfovote where pubid='$pubid' limit 1"); if($infopr['diyotherlink']) { continue; } //返回表 $infotb=ReturnInfoMainTbname($tbname,$r['checked']); $infor=$empire->fetch1("select stb,keyboard from ".$infotb." where id='$r[id]' limit 1"); //返回表信息 $infodatatb=ReturnInfoDataTbname($tbname,$r['checked'],$infor['stb']); $newkeyid=GetKeyid($infor[keyboard],$r[classid],$r[id],$class_r[$r[classid]][link_num]); $usql=$empire->query("update ".$infodatatb." set keyid='$newkeyid' where id='$r[id]' limit 1"); } if(empty($b)) { insert_dolog("");//操作日志 printerror("ChangeInfoLinkSuccess",$from); } echo $fun_r[OneChangeInfoLinkSuccess]."(ID:<font color=red><b>".$new_start."</b></font>)<script>self.location.href='ecmscom.php?enews=ChangeInfoOtherLink&tbname=$tbname&classid=$classid&start=$new_start&from=".urlencode($from)."&retype=$retype&startday=$startday&endday=$endday&startid=$startid&endid=$endid".hReturnEcmsHashStrHref(0)."';</script>"; exit(); }
function DelOldTagsInfo($add, $userid, $username) { global $empire, $dbtbpre; //验证权限 CheckLevel($userid, $username, $classid, "tags"); if (empty($add['newstime'])) { printerror("EmptyTagsTime", "history.go(-1)"); } $newstime = to_time($add['newstime']); $sql = $empire->query("select tagid from {$dbtbpre}enewstagsdata where newstime<={$newstime}"); while ($r = $empire->fetch($sql)) { $empire->query("update {$dbtbpre}enewstags set num=num-1 where tagid='{$r['tagid']}'"); } $del = $empire->query("delete from {$dbtbpre}enewstagsdata where newstime<={$newstime}"); if ($del) { //操作日志 insert_dolog("newstime={$add['newstime']}"); printerror("DelOldTagsInfoSuccess", $_SERVER['HTTP_REFERER']); } else { printerror("DbError", "history.go(-1)"); } }
function UpdateAllInfoPlnum($add, $userid, $username) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre; //验证权限 CheckLevel($userid, $username, $classid, "changedata"); $start = (int) $add['start']; $tbname = RepPostVar($add['tbname']); $from = $add['from']; if (empty($tbname) || !eCheckTbname($tbname)) { printerror("ErrorUrl", "history.go(-1)"); } //按栏目刷新 $classid = (int) $add['classid']; if ($classid) { if (empty($class_r[$classid][islast])) { $where = ReturnClass($class_r[$classid][sonclass]); } else { $where = "classid='{$classid}'"; } $add1 = " and (" . $where . ")"; } //按ID刷新 $retype = (int) $add['retype']; if ($retype) { $startid = (int) $add['startid']; $endid = (int) $add['endid']; if ($endid) { $add1 .= " and id>={$startid} and id<={$endid}"; } } else { $startday = RepPostVar($add['startday']); $endday = RepPostVar($add['endday']); if ($startday && $endday) { $add1 .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59"); } } //指定ID $doids = trim($add['doids']); $whereid = ''; if ($doids) { $doidr = explode(',', $doids); $doidcount = count($doidr); $wheredh = ''; for ($doi = 0; $doi < $doidcount; $doi++) { $whereid .= $wheredh . intval($doidr[$doi]); $wheredh = ','; } $add1 .= ' and id in (' . $whereid . ')'; } $b = 0; $sql = $empire->query("select id,classid,checked from {$dbtbpre}ecms_" . $tbname . "_index where id>{$start}" . $add1 . " order by id limit " . $public_r[infolinknum]); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r['id']; //更信息评论数 UpdateSingleInfoPlnum($r['classid'], $r['id'], $r['checked']); } if (empty($b)) { insert_dolog(""); //操作日志 printerror("UpdateInfoPlnumSuccess", $from); } echo $fun_r[OneUpdateInfoPlnumSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)<script>self.location.href='ecmspl.php?enews=UpdateAllInfoPlnum&tbname={$tbname}&classid={$classid}&start={$new_start}&from=" . urlencode($from) . "&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}&doids={$whereid}" . hReturnEcmsHashStrHref(0) . "';</script>"; exit; }
printerror('ErrorUrl', '', 1); } $search .= '&classid=' . $classid; } //时间 if ($_GET['endtime']) { $starttime = RepPostVar($_GET['starttime']); if (empty($starttime)) { $starttime = '0000-00-00'; } $endtime = RepPostVar($_GET['endtime']); if (empty($endtime)) { $endtime = '0000-00-00'; } if ($endtime != '0000-00-00') { $add .= " and (newstime BETWEEN '" . to_time($starttime . " 00:00:00") . "' and '" . to_time($endtime . " 23:59:59") . "')"; $search .= '&starttime=' . $starttime . '&endtime=' . $endtime; } } //每页显示记录数 $line = (int) $_GET['line']; if ($line < 1 || $line > 80) { $line = intval($public_r['tagslistnum']); } if (empty($line)) { printerror('ErrorUrl', '', 1); } //列表模板 $tempid = (int) $_GET['tempid']; if (empty($tempid)) { $tempid = $public_r['tagstempid'];
/** * Checks if the specific datetime is a valid time to book, according to the days. * * @param $from * @param $to * @return bool */ public function isBookableTime($from, $to) { $from_time = to_time($from); $to_time = to_time($to); $day_from = to_day($from); $day_to = to_day($to); $date_from = to_date($from); $date_to = to_date($to); $query = $this->timetable->days(); if ($date_from == $date_to) { return $query->where('day', $day_to)->where('from', '<=', $from_time)->where('to', '>=', $to_time)->count() > 0; } else { $date1 = new DateTime($date_from); $date2 = new DateTime($date_to); $interval = $date1->diff($date2); $nb_days = $interval->days; if ($nb_days > 7) { $nb_days = 7; } $days = self::daysOfWeek(); $index = array_search($day_from, $days); return $query->where(function ($query) use($days, $index, $nb_days, $from_time, $to_time) { $query->orWhere(function ($query) use($days, $index, $from_time) { $query->where('day', $days[$index])->where('from', '<=', $from_time)->where('to', '24:00:00.0000'); }); for ($i = 1; $i < $nb_days; $i++) { $index++; $index = $index % 7; $query->orWhere(function ($query) use($days, $index) { $query->where('day', $days[$index])->where('from', '00:00:00.0000')->where('to', '24:00:00.0000'); }); } $index++; $index = $index % 7; $query->orWhere(function ($query) use($days, $index, $to_time) { $query->where('day', $days[$index])->where('from', '00:00:00.0000')->where('to', '>=', $to_time); }); })->count() == $nb_days + 1; } }
function eCheckIpRegTime($ip, $time) { global $empire, $dbtbpre, $user_tablename, $user_userid, $user_registertime, $user_register; if (empty($time)) { return ''; } $uaddr = $empire->fetch1("select userid from {$dbtbpre}enewsmemberadd where regip='{$ip}' order by userid desc limit 1"); if (empty($uaddr['userid'])) { return ''; } $ur = $empire->fetch1("select " . $user_userid . "," . $user_registertime . " from {$user_tablename} where " . $user_userid . "='" . $uaddr[userid] . "'"); if (empty($ur[$user_userid])) { return ''; } $registertime = $ur[$user_registertime]; if (empty($user_register)) { $registertime = to_time($registertime); } if (time() - $registertime <= $time * 3600) { printerror('RegisterReIpError', '', 1); } }
/** * 详情弹窗 * @param number $pk * @return string */ protected function detail($pk) { $this->setRead($pk); $arr = $this->where(array('id' => $pk))->find('hy'); $arr['to_users'] = trim($arr['to_users'], ','); $arr['read_users'] = trim($arr['read_users'], ','); $uM = D('User'); $map = " `id` IN ({$arr['to_users']}) "; switch ($arr['type']) { case 1: $to = $uM->where($map)->getField('name', true) ?: array(); $to = implode('、', $to) . '<br><div class="pull-right">' . count($to) . '个人</div>'; break; case 2: $to = $uM->associate(array('student|id|user_id', 'class|student.class_id|id|name class_name'))->group('class.id')->where(array('id' => array('in', $arr['to_users'])))->field('id')->select('hy'); $to = md_arr_2_idx_arr($to, 'class_name'); $to = implode('<br>', $to) . '<br><div class="pull-right">' . count($to) . '个班</div>'; break; } if ($arr['read_users']) { $map .= " AND `id` IN ({$arr['read_users']}) "; $read = $uM->where($map)->getField('name', true) ?: array(); } $read = !$read ? '<div class="pull-right">无</div>' : implode('、', $read) . '<br><div class="pull-right">' . count($read) . '个人'; return array('table' => array('table1' => array('title' => '通知提醒', 'icon' => 'fa-volume-up', 'style' => 'green', 'cols' => '4,8', 'value' => array('发布时间:' => to_time($arr['create_time'], 2), '消息类型:' => $this->callback_type($arr['type']), '消息类别:' => $arr['category'])), 'table2' => array('title' => '消息内容', 'icon' => 'fa-file-text', 'style' => 'yellow', 'cols' => '0,12', 'value' => array('' => $arr['url'] ? '<a href="' . U($arr['url']) . '">' . $arr['message'] . '</a>' : $arr['message'])), 'table3' => array('title' => '接收用户', 'icon' => 'fa-user', 'style' => 'red', 'cols' => '0,12', 'value' => array('' => $to)), 'table4' => array('title' => '已读用户', 'icon' => 'fa-check', 'style' => 'purple', 'cols' => '0,12', 'value' => array('' => $read)))); }