Esempio n. 1
0
/**
*获取标题列表,包括图片及内容
**/
function Get_Title($format)
{
    global $db, $webdb, $pre, $ModuleDB;
    //CMS万能文章专题里的文章
    if ($format['SYS'] == 'CMS' && $format['ctype'] == 'special') {
        return CMS_special($format);
    }
    //方便下面得到URL的真实列表地址
    $page = 1;
    if (strstr($format[sql], '$GLOBALS[')) {
        eval("\$format[sql]=\"{$format['sql']}\";");
    }
    if (strstr($format[sql2], '$GLOBALS[')) {
        eval("\$format[sql2]=\"{$format['sql2']}\";");
    }
    //此处屏障报错,主要是处理不同版本之间存在的一些差异性问题
    $query = $db->query("{$format['sql']}", '', '0');
    if (!$query) {
        return;
    }
    //辅助模板存在,并且辅助SQL存在的话,要读数据库
    if ($format[tplpart_2code] && $format[sql2]) {
        $query2 = $db->query($format[sql2], '', '0');
        $rs2 = $db->fetch_array($query2);
        $rs2 = label_set_rs($format, $rs2);
    }
    while ($rs = $db->fetch_array($query)) {
        //有辅助模板时,要特别处理,CK代表截取了一条数据
        if ($format[tplpart_2code]) {
            if ($format[sql2]) {
                //如果有SQL语句的话,要过滤雷同的记录
                if ($rs2[id] == $rs[id]) {
                    $ck++;
                    continue;
                }
            } elseif (!$ck) {
                //没SQL语句,并且辅助模板有变量时,要截取一条记录,$content一般不会单独出现
                if (strstr($format[tplpart_2code], '$title') || strstr($format[tplpart_2code], '$picurl')) {
                    $rs2 = label_set_rs($format, $rs);
                    $ck++;
                    continue;
                }
            }
        }
        $listdb[] = label_set_rs($format, $rs);
    }
    //有辅助模板时,没有截取到数据时,要过滤最后一条记录
    if ($format[tplpart_2code] && !$ck) {
        array_pop($listdb);
        //针对那种没有变量的辅助模板
        if (!$format[sql2]) {
            $rs2 = label_set_rs($format, '');
        }
    }
    //执行PHP逻辑
    if (strstr($listdb[0][tpl_1code], 'print <<<EOT')) {
        return run_label_php($listdb);
    }
    //幻灯片,=='rollpic'旧版,=='r'即V6
    if ($format[stype] == 'rollpic' || $format[stype] == 'r') {
        foreach ($listdb as $key => $rs) {
            $iii++;
            $picurl[$iii] = $rs[picurl];
            unset($rs[picurl]);
            $picalt[$iii] = $rs[title];
            @extract($rs);
            eval("\$showurl=\"{$showurl}\";");
            $piclink[$iii] = $showurl;
        }
        $format[picurl] = $picurl;
        $format[picalt] = $picalt;
        $format[piclink] = $piclink;
        return rollPic_JS($format);
    }
    //处理多列的问题
    $listdb = array_chunk($listdb, $format[colspan]);
    $width = floor(1 / $format[colspan] * 100);
    foreach ($listdb as $key1 => $array1) {
        $show .= "<tr>";
        //有辅助模板时,第一个外循环,要特别处理一下,即内循环加多一个
        if ($format[tplpart_2code] && $key1 == 0) {
            $array1[-1] = $rs2;
            ksort($array1);
        }
        foreach ($array1 as $key2 => $rs) {
            $jjj++;
            @extract($rs);
            //if($format[tplpath]=='/common_zh_title/zh_bigtitle.jpg'){	die("fd$tpl_2code");}
            //有辅助模板时,第一个外循环,第一个内循环时,特别处理辅助模板
            if ($tpl_2code && $key1 == 0 && $jjj == 1) {
                $format[titlenum2] && ($title = get_word($full_title, $format[titlenum2]));
                $format[content_num2] && ($content = get_word($full_content, $format[content_num2]));
                $htmlcode = addslashes($tpl_2code);
                eval("\$htmlcode=\"{$htmlcode}\";");
                $htmlcode = $htmlcodeTOP = StripSlashes($htmlcode);
            } else {
                $i++;
                //方便模板用序号
                //自定义模型当中,获取这三个select,radio,checkbox表单中类似“1|中国”真实值
                if ($format[SYS] == 'form') {
                    $m_array = unserialize($M_config);
                    foreach ($m_array[listshow_db] as $key3 => $rs3) {
                        ${$key3} = SRC_true_value($m_array[field_db][$key3], ${$key3});
                    }
                }
                $htmlcode = addslashes($tpl_1code);
                eval("\$htmlcode=\"{$htmlcode}\";");
                $htmlcode = StripSlashes($htmlcode);
                $show .= "<td width={$width}%>{$htmlcode}</td>";
            }
            $DivTpl .= $htmlcode;
        }
        $show .= "</tr>";
    }
    if ($format[DivTpl]) {
        //DIV布局
        return $DivTpl;
    } else {
        //table布局
        return "{$htmlcodeTOP}<table width='100%' border='0' cellspacing='0' cellpadding='0'>{$show}</table>";
    }
}
Esempio n. 2
0
    $arr = explode(",", $fidDB[allowview]);
    if (!in_array($groupdb['gid'], $arr)) {
        if ($lfjuid) {
            $uid = $lfjuid;
        } else {
            showerr("ÇëÏȵǼ");
        }
    }
}
$array = unserialize($fidDB[config]);
$rows = 20;
if ($page < 1) {
    $page = 1;
}
$min = ($page - 1) * $rows;
$SQL = '';
if ($uid) {
    $SQL = " AND C.uid='{$uid}' ";
}
$showpage = getpage("{$_pre}content C", "WHERE C.mid='{$mid}' {$SQL}", "?mid={$mid}", $rows);
$query = $db->query("SELECT C.*,D.* FROM {$_pre}content C LEFT JOIN {$_pre}content_{$mid} D ON C.id=D.id WHERE C.mid='{$mid}' {$SQL} ORDER BY C.id DESC LIMIT {$min},{$rows}");
while ($rs = $db->fetch_array($query)) {
    foreach ($array[listshow_db] as $key => $rs2) {
        $rs[$key] = SRC_true_value($array[field_db][$key], $rs[$key]);
    }
    $rs[posttime] = date("Y-m-d", $rs[posttime]);
    $listdb[] = $rs;
}
require ROOT_PATH . "inc/head.php";
require "data/form_tpl/list_{$mid}.htm";
require ROOT_PATH . "inc/foot.php";
Esempio n. 3
0
        } elseif ($rs[form_type] == 'ieedit') {
            $rsdb[$key] = En_TruePath($rsdb[$key], 0);
        } elseif ($rs[form_type] == 'upfile') {
            $rsdb[$key] = tempdir($rsdb[$key]);
        } elseif ($rs[form_type] == 'upmorefile') {
            $detail = explode("\n", $rsdb[$key]);
            unset($rsdb[$key]);
            foreach ($detail as $_key => $value) {
                list($_url, $_name) = explode("@@@", $value);
                $_rsdb[$key][name][] = $_name = $_name ? $_name : "DownLoad{$_key}";
                $_rsdb[$key][url][] = $_url = tempdir($_url);
                $rsdb[$key][show][] = "<A HREF='{$_url}' target=_blank>{$_name}</A>";
            }
            $rsdb[$key] = implode("<br>", $rsdb[$key][show]);
        } elseif ($rs[form_type] == 'radio' || $rs[form_type] == 'select' || $rs[form_type] == 'checkbox') {
            $rsdb[$key] = SRC_true_value($rs, $rsdb[$key]);
        }
    }
    $rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]);
    require "head.php";
    require ROOT_PATH . "{$dirname}/data/form_tpl/admin_bencandy_{$mid}.htm";
    require "foot.php";
} elseif ($job == "yz") {
    $db->query("UPDATE `{$_pre}content` SET yz='{$yz}' WHERE id='{$id}'");
    jump("修改成功", "{$FROMURL}", '0');
} elseif ($job == "reply") {
    $rsdb = $db->get_one("SELECT * FROM `{$pre}form_reply` WHERE id='{$id}'");
    $rsdb[content] = En_TruePath($rsdb[content], 0);
    $rsdb[content] = editor_replace($rsdb[content]);
    get_admin_html('reply');
} elseif ($action == "reply") {