Ejemplo n.º 1
0
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)");
    }
}
Ejemplo n.º 2
0
function EditAd($add, $titlefont, $titlecolor, $userid, $username)
{
    global $empire, $time, $dbtbpre;
    $add[adid] = (int) $add[adid];
    if (!$add[classid] || !$add[title] || !$add[adtype] || !$add[adid]) {
        printerror("EmptyAd", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "ad");
    $add[htmlcode] = AddAddsData(RepPhpAspJspcodeText($add[htmlcode]));
    $add[reptext] = AddAddsData(RepPhpAspJspcodeText($add[reptext]));
    $ttitlefont = TitleFont($titlefont, 'no');
    //重置
    if ($add[reset]) {
        $a = ",onclick=0";
    }
    //变量处理
    $add[pic_width] = (int) $add[pic_width];
    $add[pic_height] = (int) $add[pic_height];
    $add[classid] = (int) $add[classid];
    $add[adtype] = (int) $add[adtype];
    $add[t] = (int) $add[t];
    $add[ylink] = (int) $add[ylink];
    $sql = $empire->query("update {$dbtbpre}enewsad set picurl='{$add['picurl']}',url='{$add['url']}',pic_width={$add['pic_width']},pic_height={$add['pic_height']},classid={$add['classid']},adtype={$add['adtype']},title='{$add['title']}',target='{$add['target']}',alt='{$add['alt']}',starttime='{$add['starttime']}',endtime='{$add['endtime']}',adsay='{$add['adsay']}',titlefont='{$ttitlefont}',titlecolor='{$titlecolor}',htmlcode='{$add['htmlcode']}',t={$add['t']},ylink={$add['ylink']},reptext='{$add['reptext']}'" . $a . " where adid='{$add['adid']}'");
    GetAdJs($add[adid]);
    if ($sql) {
        //操作日志
        insert_dolog("adid=" . $add[adid] . "<br>title=" . $add[title]);
        printerror("EditAdSuccess", "ListAd.php?time={$time}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Ejemplo n.º 3
0
function ReturnCheckRetitle($add)
{
    global $empire, $dbtbpre, $class_r;
    $classid = (int) $add['classid'];
    $id = (int) $add['id'];
    $title = AddAddsData($add['title']);
    $where = '';
    if ($id) {
        $where = ' and id<>' . $id;
    }
    //已审核
    $num = $empire->gettotal("select count(*) as total from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " where title='" . addslashes($title) . "'" . $where . " limit 1");
    //未审核
    if (empty($num)) {
        $num = $empire->gettotal("select count(*) as total from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_check where title='" . addslashes($title) . "'" . $where . " limit 1");
    }
    return $num;
}
Ejemplo n.º 4
0
function SetEnews($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //操作权限
    CheckLevel($userid, $username, $classid, "public");
    $add[newsurl] = ehtmlspecialchars($add[newsurl], ENT_QUOTES);
    if (empty($add[indextype])) {
        $add[indextype] = ".html";
    }
    if (empty($add[searchtype])) {
        $add[searchtype] = ".html";
    }
    //备份目录
    if (empty($add[bakdbpath])) {
        $add[bakdbpath] = "bdata";
    }
    if (!file_exists("ebak/" . RepPathStr($add[bakdbpath]))) {
        printerror("NotBakDbPath", "");
    }
    if (empty($add[bakdbzip])) {
        $add[bakdbzip] = "zip";
    }
    if (!file_exists("ebak/" . RepPathStr($add[bakdbzip]))) {
        printerror("NotbakZipPath", "");
    }
    //函数是否存在
    if (!function_exists($add['listpagefun']) || !function_exists($add['textpagefun']) || !function_exists($add['listpagelistfun'])) {
        printerror("NotPageFun", "history.go(-1)");
    }
    //adfile
    $add['adfile'] = RepFilenameQz($add['adfile']);
    //修改ftp密码
    if ($add[ftppassword]) {
        $a = "ftppassword='******'ftppassword']}',";
    }
    //变量处理
    $add[filesize] = (int) $add[filesize];
    $add[hotnum] = (int) $add[hotnum];
    $add[newnum] = (int) $add[newnum];
    $add[relistnum] = (int) $add[relistnum];
    $add[renewsnum] = (int) $add[renewsnum];
    $add[min_keyboard] = (int) $add[min_keyboard];
    $add[max_keyboard] = (int) $add[max_keyboard];
    $add[search_num] = (int) $add[search_num];
    $add[search_pagenum] = (int) $add[search_pagenum];
    $add[newslink] = (int) $add[newslink];
    $add[checked] = (int) $add[checked];
    $add[searchtime] = (int) $add[searchtime];
    $add[loginnum] = (int) $add[loginnum];
    $add[logintime] = (int) $add[logintime];
    $add[addnews_ok] = (int) $add[addnews_ok];
    $add[register_ok] = (int) $add[register_ok];
    $add[goodlencord] = (int) $add[goodlencord];
    $add[goodnum] = (int) $add[goodnum];
    $add[exittime] = (int) $add[exittime];
    $add[smalltextlen] = (int) $add[smalltextlen];
    $add[defaultgroupid] = (int) $add[defaultgroupid];
    $add[phpmode] = (int) $add[phpmode];
    $add[install] = (int) $add[install];
    $add[hotplnum] = (int) $add[hotplnum];
    $add[dorepnum] = (int) $add[dorepnum];
    $add[loadtempnum] = (int) $add[loadtempnum];
    $add[firstnum] = (int) $add[firstnum];
    $add[min_userlen] = (int) $add[min_userlen];
    $add[max_userlen] = (int) $add[max_userlen];
    $add[min_passlen] = (int) $add[min_passlen];
    $add[max_passlen] = (int) $add[max_passlen];
    $add[filechmod] = (int) $add[filechmod];
    $add[sametitle] = (int) $add[sametitle];
    $add[addrehtml] = (int) $add[addrehtml];
    $add[loginkey_ok] = (int) $add[loginkey_ok];
    $add[limittype] = (int) $add[limittype];
    $add[redodown] = (int) $add[redodown];
    $add[candocode] = (int) $add[candocode];
    $add[opennotcj] = (int) $add[opennotcj];
    $add[reuserpagenum] = (int) $add[reuserpagenum];
    $add[revotejsnum] = (int) $add[revotejsnum];
    $add[readjsnum] = (int) $add[readjsnum];
    $add[qaddtran] = (int) $add[qaddtran];
    $add[qaddtransize] = (int) $add[qaddtransize];
    $add[ebakthisdb] = (int) $add[ebakthisdb];
    $add[delnewsnum] = (int) $add[delnewsnum];
    $add[markpos] = (int) $add[markpos];
    $add[adminloginkey] = (int) $add[adminloginkey];
    $add[php_outtime] = (int) $add[php_outtime];
    $add[addreinfo] = (int) $add[addreinfo];
    $add[rssnum] = (int) $add[rssnum];
    $add[rsssub] = (int) $add[rsssub];
    $add[dorepdlevelnum] = (int) $add[dorepdlevelnum];
    $add[listpagelistnum] = (int) $add[listpagelistnum];
    $add[infolinknum] = (int) $add[infolinknum];
    $add[searchgroupid] = (int) $add[searchgroupid];
    $add[opencopytext] = (int) $add[opencopytext];
    $add[reuserjsnum] = (int) $add[reuserjsnum];
    $add[reuserlistnum] = (int) $add[reuserlistnum];
    $add[opentitleurl] = (int) $add[opentitleurl];
    $add['qaddtranfile'] = (int) $add['qaddtranfile'];
    $add['qaddtranfilesize'] = (int) $add['qaddtranfilesize'];
    $add['sendmailtype'] = (int) $add['sendmailtype'];
    $add['loginemail'] = (int) $add['loginemail'];
    $add['feedbacktfile'] = (int) $add['feedbacktfile'];
    $add['feedbackfilesize'] = (int) $add['feedbackfilesize'];
    $add['searchtempvar'] = (int) $add['searchtempvar'];
    $add['showinfolevel'] = (int) $add['showinfolevel'];
    $add['spicwidth'] = (int) $add['spicwidth'];
    $add['spicheight'] = (int) $add['spicheight'];
    $add['spickill'] = (int) $add['spickill'];
    $add['jpgquality'] = (int) $add['jpgquality'];
    $add['markpct'] = (int) $add['markpct'];
    $add['redoview'] = (int) $add['redoview'];
    $add['reggetfen'] = (int) $add['reggetfen'];
    $add['regbooktime'] = (int) $add['regbooktime'];
    $add['revotetime'] = (int) $add['revotetime'];
    $add['fpath'] = (int) $add['fpath'];
    $add['openmembertranimg'] = (int) $add['openmembertranimg'];
    $add['memberimgsize'] = (int) $add['memberimgsize'];
    $add['openmembertranfile'] = (int) $add['openmembertranfile'];
    $add['memberfilesize'] = (int) $add['memberfilesize'];
    $add['openspace'] = (int) $add['openspace'];
    $add['realltime'] = (int) $add['realltime'];
    $add['textpagelistnum'] = (int) $add['textpagelistnum'];
    $add['memberlistlevel'] = (int) $add['memberlistlevel'];
    $add['ebakcanlistdb'] = (int) $add['ebakcanlistdb'];
    $add['keytog'] = (int) $add['keytog'];
    $add['keytime'] = (int) $add['keytime'];
    $add['regkey_ok'] = (int) $add['regkey_ok'];
    $add['opengetdown'] = (int) $add['opengetdown'];
    $add['gbkey_ok'] = (int) $add['gbkey_ok'];
    $add['fbkey_ok'] = (int) $add['fbkey_ok'];
    $add['newaddinfotime'] = (int) $add['newaddinfotime'];
    $add['classnavline'] = (int) $add['classnavline'];
    $add['docnewsnum'] = (int) $add['docnewsnum'];
    $add['dtcanbq'] = (int) $add['dtcanbq'];
    $add['dtcachetime'] = (int) $add['dtcachetime'];
    $add['regretime'] = (int) $add['regretime'];
    $add['regemailonly'] = (int) $add['regemailonly'];
    $add['repkeynum'] = (int) $add['repkeynum'];
    $add['getpasstime'] = (int) $add['getpasstime'];
    $add['acttime'] = (int) $add['acttime'];
    $add['regacttype'] = (int) $add['regacttype'];
    $add['opengetpass'] = (int) $add['opengetpass'];
    $add['hlistinfonum'] = (int) $add['hlistinfonum'];
    if (empty($add['hlistinfonum'])) {
        $add['hlistinfonum'] = 30;
    }
    $add['qlistinfonum'] = (int) $add['qlistinfonum'];
    if (empty($add['qlistinfonum'])) {
        $add['qlistinfonum'] = 30;
    }
    $add['dtncanbq'] = (int) $add['dtncanbq'];
    $add['dtncachetime'] = (int) $add['dtncachetime'];
    $add['readdinfotime'] = (int) $add['readdinfotime'];
    $add['qeditinfotime'] = (int) $add['qeditinfotime'];
    $add['ftpmode'] = (int) $add['ftpmode'];
    $add['ftpssl'] = (int) $add['ftpssl'];
    $add['ftppasv'] = (int) $add['ftppasv'];
    $add['ftpouttime'] = (int) $add['ftpouttime'];
    $add['onclicktype'] = (int) $add['onclicktype'];
    $add['onclickfilesize'] = (int) $add['onclickfilesize'];
    $add['onclickfiletime'] = (int) $add['onclickfiletime'];
    $add['closeqdt'] = (int) $add['closeqdt'];
    $add['settop'] = (int) $add['settop'];
    $add['qlistinfomod'] = (int) $add['qlistinfomod'];
    $add['gb_num'] = (int) $add['gb_num'];
    $add['member_num'] = (int) $add['member_num'];
    $add['space_num'] = (int) $add['space_num'];
    $add['infolday'] = (int) $add['infolday'];
    $add['filelday'] = (int) $add['filelday'];
    $add['baktempnum'] = (int) $add['baktempnum'];
    $add['dorepkey'] = (int) $add['dorepkey'];
    $add['dorepword'] = (int) $add['dorepword'];
    $add['indexpagedt'] = (int) $add['indexpagedt'];
    $add['closeqdtmsg'] = AddAddsData($add['closeqdtmsg']);
    $add['openfileserver'] = (int) $add['openfileserver'];
    $add['fieldandtop'] = (int) $add['fieldandtop'];
    $add['fieldandclosetb'] = $add['fieldandclosetb'] ? ',' . $add['fieldandclosetb'] . ',' : '';
    $add['firsttitlename'] = ehtmlspecialchars(str_replace("\r\n", "|", $add['firsttitlename']));
    $add['isgoodname'] = ehtmlspecialchars(str_replace("\r\n", "|", $add['isgoodname']));
    $add['closelisttemp'] = ehtmlspecialchars($add['closelisttemp']);
    $add['ipaddinfonum'] = (int) $add['ipaddinfonum'];
    $add['ipaddinfotime'] = (int) $add['ipaddinfotime'];
    $add['indexaddpage'] = (int) $add['indexaddpage'];
    $add['modmemberedittran'] = (int) $add['modmemberedittran'];
    $add['modinfoedittran'] = (int) $add['modinfoedittran'];
    //提交IP
    $doiptypes = '';
    $doiptype = $add['doiptype'];
    $doiptypecount = count($doiptype);
    if ($doiptypecount) {
        $doiptypes = ',';
        for ($di = 0; $di < $doiptypecount; $di++) {
            $doiptypes .= $doiptype[$di] . ',';
        }
    }
    //关闭相关模块
    $closemodss = '';
    $closemods = $add['closemods'];
    $closemodscount = count($closemods);
    if ($closemodscount) {
        $closemodss = ',';
        for ($cmi = 0; $cmi < $closemodscount; $cmi++) {
            $closemodss .= $closemods[$cmi] . ',';
        }
    }
    //关闭后台菜单
    $closehmenus = '';
    $closehmenu = $add['closehmenu'];
    $closehmenucount = count($closehmenu);
    if ($closehmenucount) {
        $closehmenus = ',';
        for ($chmi = 0; $chmi < $closehmenucount; $chmi++) {
            $closehmenus .= $closehmenu[$chmi] . ',';
        }
    }
    //限制操作的时间点
    $timecloses = '';
    $timeclose = $add['timeclose'];
    $timeclosecount = count($timeclose);
    if ($timeclosecount) {
        $timecloses = ',';
        for ($tci = 0; $tci < $timeclosecount; $tci++) {
            $timecloses .= $timeclose[$tci] . ',';
        }
    }
    //限制使用时间的操作
    $timeclosedos = '';
    $timeclosedo = $add['timeclosedo'];
    $timeclosedocount = count($timeclosedo);
    if ($timeclosedocount) {
        $timeclosedos = ',';
        for ($tcdi = 0; $tcdi < $timeclosedocount; $tcdi++) {
            $timeclosedos .= $timeclosedo[$tcdi] . ',';
        }
    }
    $add[filetype] = "|" . $add[filetype] . "|";
    $add[qimgtype] = "|" . $add['qaddtranimgtype'] . "|";
    $add[qfiletype] = "|" . $add['qaddtranfiletype'] . "|";
    $add[feedbackfiletype] = "|" . $add['feedbackfiletype'] . "|";
    $add[memberimgtype] = "|" . $add['memberimgtype'] . "|";
    $add[memberfiletype] = "|" . $add['memberfiletype'] . "|";
    $sql = $empire->query("update {$dbtbpre}enewspublic set " . $a . "sitename='{$add['sitename']}',newsurl='{$add['newsurl']}',email='{$add['email']}',filetype='{$add['filetype']}',filesize={$add['filesize']},hotnum={$add['hotnum']},newnum={$add['newnum']},relistnum={$add['relistnum']},renewsnum={$add['renewsnum']},min_keyboard={$add['min_keyboard']},max_keyboard={$add['max_keyboard']},search_num={$add['search_num']},search_pagenum={$add['search_pagenum']},newslink={$add['newslink']},checked={$add['checked']},searchtime={$add['searchtime']},loginnum={$add['loginnum']},logintime={$add['logintime']},addnews_ok={$add['addnews_ok']},register_ok={$add['register_ok']},indextype='{$add['indextype']}',goodlencord={$add['goodlencord']},goodtype='{$add['goodtype']}',goodnum={$add['goodnum']},searchtype='{$add['searchtype']}',exittime={$add['exittime']},smalltextlen={$add['smalltextlen']},defaultgroupid={$add['defaultgroupid']},fileurl='{$add['fileurl']}',phpmode={$add['phpmode']},ftphost='{$add['ftphost']}',ftpport='{$add['ftpport']}',ftpusername='******'ftpusername']}',ftppath='{$add['ftppath']}',ftpmode='{$add['ftpmode']}',install={$add['install']},hotplnum={$add['hotplnum']},dorepnum={$add['dorepnum']},loadtempnum={$add['loadtempnum']},firstnum={$add['firstnum']},bakdbpath='{$add['bakdbpath']}',bakdbzip='{$add['bakdbzip']}',downpass='******'downpass']}',min_userlen={$add['min_userlen']},max_userlen={$add['max_userlen']},min_passlen={$add['min_passlen']},max_passlen={$add['max_passlen']},filechmod={$add['filechmod']},loginkey_ok={$add['loginkey_ok']},limittype={$add['limittype']},redodown={$add['redodown']},candocode={$add['candocode']},opennotcj={$add['opennotcj']},reuserpagenum={$add['reuserpagenum']},revotejsnum={$add['revotejsnum']},readjsnum={$add['readjsnum']},qaddtran={$add['qaddtran']},qaddtransize={$add['qaddtransize']},ebakthisdb={$add['ebakthisdb']},delnewsnum={$add['delnewsnum']},markpos={$add['markpos']},markimg='{$add['markimg']}',marktext='{$add['marktext']}',markfontsize='{$add['markfontsize']}',markfontcolor='{$add['markfontcolor']}',markfont='{$add['markfont']}',adminloginkey={$add['adminloginkey']},php_outtime={$add['php_outtime']},listpagefun='{$add['listpagefun']}',textpagefun='{$add['textpagefun']}',adfile='{$add['adfile']}',notsaveurl='{$add['notsaveurl']}',rssnum={$add['rssnum']},rsssub={$add['rsssub']},dorepdlevelnum={$add['dorepdlevelnum']},listpagelistfun='{$add['listpagelistfun']}',listpagelistnum={$add['listpagelistnum']},infolinknum={$add['infolinknum']},searchgroupid={$add['searchgroupid']},opencopytext={$add['opencopytext']},reuserjsnum={$add['reuserjsnum']},reuserlistnum={$add['reuserlistnum']},opentitleurl='{$add['opentitleurl']}',qaddtranimgtype='{$add['qimgtype']}',qaddtranfile={$add['qaddtranfile']},qaddtranfilesize={$add['qaddtranfilesize']},qaddtranfiletype='{$add['qfiletype']}',sendmailtype={$add['sendmailtype']},smtphost='{$add['smtphost']}',fromemail='{$add['fromemail']}',loginemail={$add['loginemail']},emailusername='******'emailusername']}',emailpassword='******'emailpassword']}',smtpport='{$add['smtpport']}',emailname='{$add['emailname']}',feedbacktfile={$add['feedbacktfile']},feedbackfilesize={$add['feedbackfilesize']},feedbackfiletype='{$add['feedbackfiletype']}',searchtempvar={$add['searchtempvar']},showinfolevel={$add['showinfolevel']},navfh='" . eaddslashes($add[navfh]) . "',spicwidth={$add['spicwidth']},spicheight={$add['spicheight']},spickill={$add['spickill']},jpgquality={$add['jpgquality']},markpct={$add['markpct']},redoview={$add['redoview']},reggetfen={$add['reggetfen']},regbooktime={$add['regbooktime']},revotetime={$add['revotetime']},fpath={$add['fpath']},filepath='{$add['filepath']}',openmembertranimg={$add['openmembertranimg']},memberimgsize={$add['memberimgsize']},openmembertranfile={$add['openmembertranfile']},memberfilesize={$add['memberfilesize']},memberimgtype='{$add['memberimgtype']}',memberfiletype='{$add['memberfiletype']}',canposturl='{$add['canposturl']}',openspace='{$add['openspace']}',realltime={$add['realltime']},closeip='{$add['closeip']}',openip='{$add['openip']}',hopenip='{$add['hopenip']}',closewords='{$add['closewords']}',closewordsf='{$add['closewordsf']}',textpagelistnum={$add['textpagelistnum']},memberlistlevel={$add['memberlistlevel']},ebakcanlistdb={$add['ebakcanlistdb']},keytog='{$add['keytog']}',keyrnd='{$add['keyrnd']}',keytime='{$add['keytime']}',regkey_ok='{$add['regkey_ok']}',opengetdown='{$add['opengetdown']}',gbkey_ok='{$add['gbkey_ok']}',fbkey_ok='{$add['fbkey_ok']}',newaddinfotime='{$add['newaddinfotime']}',classnavline='{$add['classnavline']}',classnavfh='" . eaddslashes($add[classnavfh]) . "',sitekey='{$add['sitekey']}',siteintro='{$add['siteintro']}',docnewsnum='{$add['docnewsnum']}',dtcanbq='{$add['dtcanbq']}',dtcachetime='{$add['dtcachetime']}',regretime='{$add['regretime']}',regclosewords='{$add['regclosewords']}',regemailonly='{$add['regemailonly']}',repkeynum='{$add['repkeynum']}',getpasstime='{$add['getpasstime']}',acttime='{$add['acttime']}',regacttype='{$add['regacttype']}',acttext='" . eaddslashes($add[acttext]) . "',getpasstext='" . eaddslashes($add[getpasstext]) . "',acttitle='" . eaddslashes($add[acttitle]) . "',getpasstitle='" . eaddslashes($add[getpasstitle]) . "',opengetpass='******'opengetpass']}',hlistinfonum='{$add['hlistinfonum']}',qlistinfonum='{$add['qlistinfonum']}',dtncanbq='{$add['dtncanbq']}',dtncachetime='{$add['dtncachetime']}',readdinfotime='{$add['readdinfotime']}',qeditinfotime='{$add['qeditinfotime']}',ftpssl='{$add['ftpssl']}',ftppasv='{$add['ftppasv']}',ftpouttime='{$add['ftpouttime']}',onclicktype='{$add['onclicktype']}',onclickfilesize='{$add['onclickfilesize']}',onclickfiletime='{$add['onclickfiletime']}',closeqdt='{$add['closeqdt']}',settop='{$add['settop']}',qlistinfomod='{$add['qlistinfomod']}',gb_num='{$add['gb_num']}',member_num='{$add['member_num']}',space_num='{$add['space_num']}',opendoip='{$add['opendoip']}',closedoip='{$add['closedoip']}',doiptype='{$doiptypes}',infolday='{$add['infolday']}',filelday='{$add['filelday']}',baktempnum='{$add['baktempnum']}',dorepkey='{$add['dorepkey']}',dorepword='{$add['dorepword']}',onclickrnd='{$add['onclickrnd']}',indexpagedt='{$add['indexpagedt']}',keybgcolor='{$add['keybgcolor']}',keyfontcolor='{$add['keyfontcolor']}',keydistcolor='{$add['keydistcolor']}',closeqdtmsg='{$add['closeqdtmsg']}',openfileserver='{$add['openfileserver']}',closemods='{$closemodss}',fieldandtop='{$add['fieldandtop']}',fieldandclosetb='{$add['fieldandclosetb']}',firsttitlename='" . eaddslashes($add[firsttitlename]) . "',isgoodname='" . eaddslashes($add[isgoodname]) . "',closelisttemp='" . eaddslashes($add[closelisttemp]) . "',chclasscolor='" . eaddslashes($add[chclasscolor]) . "',timeclose='" . eaddslashes($timecloses) . "',timeclosedo='" . eaddslashes($timeclosedos) . "',ipaddinfonum='{$add['ipaddinfonum']}',ipaddinfotime='{$add['ipaddinfotime']}',closehmenu='{$closehmenus}',indexaddpage='{$add['indexaddpage']}',modmemberedittran='{$add['modmemberedittran']}',modinfoedittran='{$add['modinfoedittran']}';");
    DoSetFileServer($add);
    //远程附件更新
    GetConfig();
    //首页动态文件
    if ($add['indexpagedt'] != $add['oldindexpagedt']) {
        if ($add['indexpagedt']) {
            DelFiletext(ECMS_PATH . 'index' . $add[indextype]);
            @copy(ECMS_PATH . DASHBOARD . '/data/template/dtindexpage.txt', ECMS_PATH . 'index.php');
        } else {
            DelFiletext(ECMS_PATH . 'index.php');
            $indextemp = GetIndextemp();
            NewsBq(0, $indextemp, 1, 0);
        }
    }
    if ($sql) {
        insert_dolog("");
        //操作日志
        printerror("SetPublicSuccess", "SetEnews.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Ejemplo n.º 5
0
function ReturnClassAddF($add, $ecms = 0)
{
    global $empire, $dbtbpre;
    $ret_r[0] = '';
    $ret_r[1] = '';
    $fsql = $empire->query("select f from {$dbtbpre}enewsclassf");
    if ($ecms == 0) {
        while ($fr = $empire->fetch($fsql)) {
            $f = $fr['f'];
            $fval = $add[$f];
            $fval = RepPhpAspJspcode($fval);
            $ret_r[0] .= ",`" . $f . "`";
            $ret_r[1] .= ",'" . AddAddsData($fval) . "'";
        }
    } else {
        while ($fr = $empire->fetch($fsql)) {
            $f = $fr['f'];
            $fval = $add[$f];
            $fval = RepPhpAspJspcode($fval);
            $ret_r[0] .= ",`" . $f . "`='" . AddAddsData($fval) . "'";
        }
    }
    return $ret_r;
}
Ejemplo n.º 6
0
function EditUserlist($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $cid = (int) $add['cid'];
    $listid = (int) $add['listid'];
    $listtempid = (int) $add['listtempid'];
    $maxnum = (int) $add['maxnum'];
    $lencord = (int) $add['lencord'];
    if (!$listid || !$add[listname] || !$listtempid || !$add[listsql] || !$add[totalsql] || !$add[filepath] || !$add[filetype] || !$add[lencord]) {
        printerror("EmptyUserListname", "history.go(-1)");
    }
    $query_first = substr($add['totalsql'], 0, 7);
    $query_firstlist = substr($add['listsql'], 0, 7);
    if (!($query_first == "select " || $query_first == "SELECT " || $query_firstlist == "select " || $query_firstlist == "SELECT ")) {
        printerror("ListSqlError", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "userlist");
    /*
    //删除旧文件
    if(!($add['oldfilepath']<>$add['filepath']||$add['oldfiletype']<>$add['filetype']))
    {
    	DelFiletext($add['oldjsfilename']);
    }
    */
    if (empty($add['pagetitle'])) {
        $add['pagetitle'] = $add['listname'];
    }
    $add['listname'] = ehtmlspecialchars($add['listname']);
    $add['pagetitle'] = AddAddsData(RepPhpAspJspcode($add['pagetitle']));
    $add['pagekeywords'] = AddAddsData(RepPhpAspJspcode($add['pagekeywords']));
    $add['pagedescription'] = AddAddsData(RepPhpAspJspcode($add['pagedescription']));
    $add[totalsql] = ClearAddsData($add[totalsql]);
    $add[listsql] = ClearAddsData($add[listsql]);
    $add['classid'] = (int) $add['classid'];
    $sql = $empire->query("update {$dbtbpre}enewsuserlist set listname='{$add['listname']}',pagetitle='{$add['pagetitle']}',filepath='{$add['filepath']}',filetype='{$add['filetype']}',totalsql='" . addslashes($add['totalsql']) . "',listsql='" . addslashes($add['listsql']) . "',maxnum={$maxnum},lencord={$lencord},listtempid={$listtempid},pagekeywords='{$add['pagekeywords']}',pagedescription='{$add['pagedescription']}',classid='{$add['classid']}' where listid={$listid}");
    //刷新列表
    ReUserlist($add, "../");
    if ($sql) {
        //操作日志
        insert_dolog("listid={$listid}&listname={$add['listname']}");
        printerror("EditUserlistSuccess", "ListUserlist.php?classid={$cid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Ejemplo n.º 7
0
function EditSysF($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tid = (int) $add['tid'];
    $tbname = RepPostVar($add['tbname']);
    $fid = (int) $add['fid'];
    $f = RepPostVar($add['f']);
    if (!$fid || !$tid || !$tbname || !$f || !$add[fname]) {
        printerror("EmptyF", "history.go(-1)");
    }
    CheckLevel($userid, $username, $classid, "f");
    //验证权限
    //字段
    $addupdate = '';
    if ($f == 'title' || $f == 'titlepic') {
        if (!empty($add['flen'])) {
            $field = $f . " " . $add['ftype'] . "(" . $add['flen'] . ") NOT NULL default ''";
            //信息表
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . " change " . $f . " " . $field);
            //归档表
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_doc change " . $f . " " . $field);
            //采集临时表
            $empire->query("alter table {$dbtbpre}ecms_infotmp_" . $tbname . " change " . $f . " " . $field);
        }
        $addupdate = ",ftype='{$add['ftype']}'";
    }
    //索引
    $iskey = (int) $add['iskey'];
    if ($f == 'title' || $f == 'titlepic' || $f == 'newstime') {
        if ($iskey == 1) {
            if ($add['oldiskey'] == 0) {
                $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . " ADD INDEX(" . $f . ")");
                $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_doc ADD INDEX(" . $f . ")");
            }
        } elseif ($add['oldiskey'] == 1 && $iskey == 0) {
            $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . " DROP INDEX " . $f);
            $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_doc DROP INDEX " . $f);
        }
    }
    //处理变量
    $add[isonly] = (int) $add[isonly];
    $add[myorder] = (int) $add[myorder];
    //替换代码
    if ($add[fform] != $add[oldfform] || $add[fvalue] != $add[oldfvalue] || $add[oldlinkfieldtb] != $add[linkfieldtb] || $add[oldlinkfieldshow] != $add[linkfieldshow] || $add[linkfieldval] != $add[oldlinkfieldval] || $add[fformsize] != $add[oldfformsize]) {
        $fhtml = GetFform($add[fform], $add[f], $add[fvalue], $add[linkfieldval], $add[fformsize], $add);
    } else {
        $fhtml = AddAddsData($add[fhtml]);
    }
    if ($add[fform] != $add[oldfform] || $add[fvalue] != $add[oldfvalue] || $add[oldlinkfieldtb] != $add[linkfieldtb] || $add[oldlinkfieldshow] != $add[linkfieldshow] || $add[linkfieldval] != $add[oldlinkfieldval] || $add[fformsize] != $add[oldfformsize]) {
        $qfhtml = GetQFform($add[fform], $add[f], $add[fvalue], $add[fformsize], $add);
    } else {
        $qfhtml = AddAddsData($add[qfhtml]);
    }
    $sql = $empire->query("update {$dbtbpre}enewsf set fname='{$add['fname']}',fform='{$add['fform']}',fhtml='" . addslashes($fhtml) . "',fzs='" . addslashes($add[fzs]) . "',myorder={$add['myorder']},flen='{$add['flen']}',fvalue='" . addslashes($add[fvalue]) . "',iskey={$iskey},qfhtml='" . addslashes($qfhtml) . "',isonly='{$add['isonly']}',linkfieldval='{$add['linkfieldval']}',samedata='{$add['samedata']}',fformsize='{$add['fformsize']}',adddofun='{$add['adddofun']}',editdofun='{$add['editdofun']}',qadddofun='{$add['qadddofun']}',qeditdofun='{$add['qeditdofun']}',linkfieldtb='{$add['linkfieldtb']}',linkfieldshow='{$add['linkfieldshow']}'" . $addupdate . " where fid='{$fid}'");
    TogSaveTxtF(1);
    //公共变量
    //更新表单
    $fsql = $empire->query("select mid,mtemp,tid,qmtemp from {$dbtbpre}enewsmod where tid='{$tid}'");
    while ($fr = $empire->fetch($fsql)) {
        ChangeMForm($fr[mid], $fr[tid], $fr[mtemp]);
        ChangeQmForm($fr[mid], $fr[tid], $fr[qmtemp]);
    }
    GetConfig(1);
    //更新缓存
    if ($sql) {
        insert_dolog("fid=" . $fid . "<br>f=" . $f);
        //操作日志
        printerror("EditFSuccess", "db/EditSysF.php?tid={$tid}&tbname={$tbname}&fid={$fid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Ejemplo n.º 8
0
function AddPostUrlData($postdata, $userid, $username)
{
    global $empire, $fun_r, $dbtbpre;
    $count = count($postdata);
    if (empty($count)) {
        printerror("NotPostData", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "postdata");
    $e = "!!!";
    $rnd = md5(uniqid(microtime()));
    for ($i = 0; $i < $count; $i++) {
        $r = explode($e, $postdata[$i]);
        $r[1] = (int) $r[1];
        $r[0] = AddAddsData($r[0]);
        $sql = $empire->query("insert into {$dbtbpre}enewspostdata(rnd,postdata,ispath) values('{$rnd}','{$r['0']}','{$r['1']}');");
    }
    $line = (int) $_POST['line'];
    if ($line == 0) {
        $line = 10;
    }
    echo $fun_r[AddPostDataSuccess] . "<script>self.location.href='enews.php?enews=PostUrlData&start=0&line={$line}&rnd={$rnd}" . hReturnEcmsHashStrHref(0) . "';</script>";
    exit;
}
Ejemplo n.º 9
0
function hRepPostStr2($val)
{
    CkPostStrChar($val);
    $val = AddAddsData($val);
    return $val;
}
Ejemplo n.º 10
0
function RepPostStr2($val)
{
    CkPostStrChar($val);
    $val = AddAddsData($val);
    //FireWall
    FWClearGetText($val);
    return $val;
}