content_output.class.php
来自「Phpcms2008 是一款基于 PHP+Mysql 架构的网站内容管理系统」· PHP 代码 · 共 42 行
PHP
42 行
<?php
class content_output
{
var $fields;
var $data;
function __construct()
{
global $db, $CATEGORY;
$this->db = &$db;
$this->CATEGORY = $CATEGORY;
}
function content_output()
{
$this->__construct();
}
function set_catid($catid)
{
$modelid = $this->CATEGORY[$catid]['modelid'];
$this->modelid = $modelid;
$this->fields = cache_read($modelid.'_fields.inc.php', CACHE_MODEL_PATH);
}
function get($data)
{
$this->data = $data;
$this->contentid = $data['contentid'];
$this->set_catid($data['catid']);
$info = array();
foreach($this->fields as $field=>$v)
{
if(!isset($data[$field])) continue;
$func = $v['formtype'];
$value = $data[$field];
$result = method_exists($this, $func) ? $this->$func($field, $data[$field]) : $data[$field];
if($result !== false) $info[$field] = $result;
}
return $info;
}
}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?