コード例 #1
0
function ReturnAddF($modid, $rdata = 0)
{
    global $empire, $dbtbpre;
    $record = "<!--record-->";
    $field = "<!--field--->";
    $mr = $empire->fetch1("select tempvar,enter,listandf,setandf,listtempvar from {$dbtbpre}enewsmod where mid='{$modid}'");
    //模板字段
    if ($rdata == 1) {
        $ret_r['tempvar'] = doReturnAddTempf($mr['tempvar']);
    } elseif ($rdata == 2) {
        $ret_r['listtempvar'] = doReturnAddTempf($mr['listtempvar']);
    } else {
        $ret_r['tempvar'] = doReturnAddTempf($mr['tempvar']);
        $ret_r['listtempvar'] = doReturnAddTempf($mr['listtempvar']);
    }
    $ret_r['listandf'] = $mr['listandf'];
    $ret_r['setandf'] = $mr['setandf'];
    return $ret_r;
}
コード例 #2
0
function GetModCache()
{
    global $empire, $dbtbpre;
    //数据表
    $tablesql = $empire->query("select tbname,deftb,yhid,mid from {$dbtbpre}enewstable");
    while ($tabler = $empire->fetch($tablesql)) {
        $tables .= "\$etable_r['" . $tabler[tbname] . "']=Array('deftb'=>'" . addslashes($tabler[deftb]) . "',\r\n'yhid'=>" . $tabler[yhid] . ",\r\n'mid'=>" . $tabler[mid] . ");\r\n";
    }
    //系统模型
    $alllinkfields = '|';
    //关联同步
    $modsql = $empire->query("select * from {$dbtbpre}enewsmod");
    while ($mr = $empire->fetch($modsql)) {
        $listtempf = doReturnAddTempf($mr['listtempvar']);
        //列表模板
        $texttempf = doReturnAddTempf($mr['tempvar']);
        //内容模板
        $enter = doReturnAddTempf($mr['enter']);
        //录入项
        $qenter = doReturnAddTempf($mr['qenter']);
        //投稿项
        $cj = doReturnAddTempf($mr['cj']);
        //采集项
        //表字段
        $dataf = ',';
        //副表字段
        $tobrf = ',';
        //回车字段
        $dohtmlf = ',';
        //html字段
        $savetxtf = '';
        //存文本字段
        $pagef = '';
        //分页字段
        $smalltextf = ',';
        //简介字段
        $checkboxf = ',';
        //复选框字段
        $filef = ',';
        //附件字段
        $imgf = ',';
        //图片字段
        $flashf = ',';
        //FLASH字段
        $onlyf = ',';
        //唯一字段
        $linkfields = '|';
        //关联同步
        $editorf = ',';
        //编辑器字段
        $ubbeditorf = ',';
        //UBB编辑器字段
        $adddofunf = '||';
        //增加处理函数
        $editdofunf = '||';
        //修改处理函数
        $qadddofunf = '||';
        //投稿增加处理函数
        $qeditdofunf = '||';
        //投稿修改处理函数
        $fsql = $empire->query("select * from {$dbtbpre}enewsf where tid='{$mr['tid']}'");
        while ($fr = $empire->fetch($fsql)) {
            if ($fr['tbdataf']) {
                $dataf .= $fr['f'] . ',';
            }
            if ($fr['tobr']) {
                $tobrf .= $fr['f'] . ',';
            }
            if ($fr['dohtml']) {
                $dohtmlf .= $fr['f'] . ',';
            }
            if ($fr['savetxt']) {
                $savetxtf = $fr['f'];
            }
            if ($fr['ispage']) {
                $pagef = $fr['f'];
            }
            if ($fr['issmalltext']) {
                $smalltextf .= $fr['f'] . ',';
            }
            if ($fr['fform'] == 'checkbox') {
                $checkboxf .= $fr['f'] . ',';
            }
            if ($fr['fform'] == 'file') {
                $filef .= $fr['f'] . ',';
            }
            if ($fr['fform'] == 'img') {
                $imgf .= $fr['f'] . ',';
            }
            if ($fr['fform'] == 'flash') {
                $flashf .= $fr['f'] . ',';
            }
            if ($fr['isonly']) {
                $onlyf .= $fr['f'] . ',';
            }
            if (($fr['fform'] == 'linkfield' || $fr['fform'] == 'linkfieldselect') && $fr['samedata'] && $fr['linkfieldval']) {
                $linkfields .= $fr[f] . ',' . $fr[linkfieldtb] . '.' . $fr[linkfieldval] . '|';
                $alllinkfields .= $fr[tbname] . '.' . $fr[f] . ',' . $fr[linkfieldtb] . '.' . $fr[linkfieldval] . '|';
            }
            if ($fr['fform'] == 'editor') {
                $editorf .= $fr['f'] . ',';
            }
            if ($fr['fform'] == 'ubbeditor') {
                $ubbeditorf .= $fr['f'] . ',';
            }
            if ($fr['adddofun']) {
                $adddofunf .= $fr[f] . '!#!' . $fr[adddofun] . '||';
            }
            if ($fr['editdofun']) {
                $editdofunf .= $fr[f] . '!#!' . $fr[editdofun] . '||';
            }
            if ($fr['qadddofun']) {
                $qadddofunf .= $fr[f] . '!#!' . $fr[qadddofun] . '||';
            }
            if ($fr['qeditdofun']) {
                $qeditdofunf .= $fr[f] . '!#!' . $fr[qeditdofun] . '||';
            }
        }
        //表数据
        $tr = $empire->fetch1("select * from {$dbtbpre}enewstable where tid='{$mr['tid']}'");
        //字符
        $mods .= "\$emod_r[" . $mr[mid] . "]=Array('mid'=>" . $mr[mid] . ",\r\n'mname'=>'" . addslashes($mr[mname]) . "',\r\n'qmname'=>'" . addslashes($mr[qmname]) . "',\r\n'defaulttb'=>" . $tr[isdefault] . ",\r\n'datatbs'=>'" . addslashes($tr[datatbs]) . "',\r\n'deftb'=>'" . addslashes($tr[deftb]) . "',\r\n'enter'=>'" . addslashes($enter) . "',\r\n'qenter'=>'" . addslashes($qenter) . "',\r\n'listtempf'=>'" . addslashes($listtempf) . "',\r\n'tempf'=>'" . addslashes($texttempf) . "',\r\n'mustqenterf'=>'" . addslashes($mr[mustqenterf]) . "',\r\n'listandf'=>'" . addslashes($mr[listandf]) . "',\r\n'setandf'=>" . $mr[setandf] . ",\r\n'searchvar'=>'" . addslashes($mr[searchvar]) . "',\r\n'cj'=>'" . addslashes($cj) . "',\r\n'canaddf'=>'" . addslashes($mr[canaddf]) . "',\r\n'caneditf'=>'" . addslashes($mr[caneditf]) . "',\r\n'tbdataf'=>'" . addslashes($dataf) . "',\r\n'tobrf'=>'" . addslashes($tobrf) . "',\r\n'dohtmlf'=>'" . addslashes($dohtmlf) . "',\r\n'checkboxf'=>'" . addslashes($checkboxf) . "',\r\n'savetxtf'=>'" . addslashes($savetxtf) . "',\r\n'editorf'=>'" . addslashes($editorf) . "',\r\n'ubbeditorf'=>'" . addslashes($ubbeditorf) . "',\r\n'pagef'=>'" . addslashes($pagef) . "',\r\n'smalltextf'=>'" . addslashes($smalltextf) . "',\r\n'filef'=>'" . addslashes($filef) . "',\r\n'imgf'=>'" . addslashes($imgf) . "',\r\n'flashf'=>'" . addslashes($flashf) . "',\r\n'linkfields'=>'" . addslashes($linkfields) . "',\r\n'onlyf'=>'" . addslashes($onlyf) . "',\r\n'adddofunf'=>'" . addslashes($adddofunf) . "',\r\n'editdofunf'=>'" . addslashes($editdofunf) . "',\r\n'qadddofunf'=>'" . addslashes($qadddofunf) . "',\r\n'qeditdofunf'=>'" . addslashes($qeditdofunf) . "',\r\n'definfovoteid'=>" . $mr[definfovoteid] . ",\r\n'orderf'=>'" . addslashes($mr[orderf]) . "',\r\n'sonclass'=>'" . addslashes($mr[sonclass]) . "',\r\n'tid'=>" . $mr[tid] . ",\r\n'tbname'=>'" . addslashes($mr[tbname]) . "');\r\n";
    }
    $mods = "\r\n\r\n\$emod_pubr=Array('linkfields'=>'" . addslashes($alllinkfields) . "');\r\n\r\n\$etable_r=array();\r\n" . $tables . "\r\n\r\n\$emod_r=array();\r\n" . $mods . "\r\n\r\n";
    return $mods;
}