DEDECMS 问题求助 , 在 DEDE 官方论坛发了 ... 结果要审核 ... 我转至 CSDN 求助 . 接触这东西已经有两天了 , 两天下来似乎迷迷糊糊明白了一点 . 今天想练练手 , 看后台每个栏目后面 " 预览 " 中 ( plus/list.php ) 都可以预览到具体的列表 / 主题 . 我看点进去具体内容没有没有预览功能 , 正好自己写个练练 . 大概成型了 正常的信息都 OK , DEDE 就是好一个 MakeOneTag , 解决所有 taglib 下有的东西我喜欢 , 现在少了一些信息 , 现发出模板里少的东西和我的代码求助大神 !少如下东西 :
Notice:  Undefined index:  phpurl in E:\AppServ\www\dede\include\arc.content.class.php on line 59 // 这货是 ? 对应 position 的 LINK ?
Notice:  Undefined index:  position in E:\AppServ\www\dede\include\arc.content.class.php on line 59 // 我看了看 , 这肯定是位置 ... 请问大神哪个表 ? 两天看的蛋疼 , 实在不想看了
Notice:  Undefined index:  phpurl in E:\AppServ\www\dede\include\arc.content.class.php on line 59
Notice:  Undefined index:  vote in E:\AppServ\www\dede\include\arc.content.class.php on line 59 // 投票 , 可是在文章 field.body 后面 , 这是神马意思神马意思 ?
Notice:  Undefined index:  goodper in E:\AppServ\www\dede\include\arc.content.class.php on line 59 // 这货我就不知道啥玩意儿了
Notice:  Undefined index:  goodper in E:\AppServ\www\dede\include\arc.content.class.php on line 59
Notice:  Undefined index:  badper in E:\AppServ\www\dede\include\arc.content.class.php on line 59
Notice:  Undefined index:  badper in E:\AppServ\www\dede\include\arc.content.class.php on line 59
Notice:  Undefined index:  phpurl in E:\AppServ\www\dede\include\arc.content.class.php on line 59
Notice:  Undefined index:  phpurl in E:\AppServ\www\dede\include\arc.content.class.php on line 59
Notice:  Undefined index:  phpurl in E:\AppServ\www\dede\include\arc.content.class.php on line 59结构式这样的 :
touch ./plus/arc.php (引用 LINUX 命令表示新建该文件 , 不知道怎么表示目录 , 就用了个 TOUCH)
CODE:
require_once(dirname(__FILE__)."/../include/common.inc.php");
include(DEDEINC."/arc.content.class.php");
intval($id)===0 && exit('');
$arc = new content($id);
$arc->Display();
而后
touch ./include/arc.content.class.php
CODE:
if(!defined('DEDEINC')) exit('Request Error!');
/**
* 文档内容
*
*/
require_once(DEDEINC.'/arc.partview.class.php');
//require_once(DEDEINC.'/ftp.class.php');@set_time_limit(0);/**
* 自由内容类
*
*/
class content
{
  public $dsql;
  public $dtp;
  //public $dtp2;
  public $id;
  public $TypeLink;
  function __construct($id){
    global $dsql;    $this->id = is_numeric($id) ? intval($id) : '';
    $this->dtp = new DedeTagParse();
    $this->dtp->SetRefObj($this);
    $this->dtp->SetNameSpace('dede','{','}');
    //$this->dtp2 = new DedeTagParse();
    //$this->dtp2->SetNameSpace('field','[',']');
    $this->dsql = & $dsql;    $typeid = self::has();
    !$typeid && exit('输入的参数有误');
    $this->TypeLink = new TypeLink($typeid);// 确定了栏目和模型 , 栏目表 left join 模型表 .
  }
  
  protected function has(){
    $sql = "SELECT `typeid` FROM `#@__arctiny` WHERE `id`={$this->id}";
    $row = $this->dsql->GetOne($sql);
    return is_array($row) ? array_shift($row) : FALSE;
  }  protected function get(){
    $sql = "SELECT * FROM `#@__archives` WHERE `id`={$this->id}";
    $row = $this->dsql->GetOne($sql);
    $sql = "SELECT `body` FROM `#@__addonarticle` WHERE `aid`={$this->id}";
    $row2 = $this->dsql->GetOne($sql);
    $row = array_merge($row,$row2);
    return $row;
  }  function parseField(){
    $row = self::get();
    foreach($this->dtp->CTags as $k=>$ctag){
      switch (trim(strtolower($ctag->GetName()))) {
        case "field":
          $name = $ctag->CAttribute->Items['name'];
          $this->dtp->Assign($k,isset($row[$name]) ? $row[$name] : ''/* 如果想要看到少哪些变量 , 直接使用 $row[$name]*/);
        break;
      }
    }
  }
  
  function Display(){
    $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
    $tempfile = $this->TypeLink->TypeInfos["temparticle"];
    $tempfile = $tmpdir."/".$tempfile;
    !file_exists($tempfile) && exit('模板设置错误');
    $this->dtp->LoadTemplate($tempfile);
    MakeOneTag($this->dtp,$this);
    $this->parseField();
    $this->dtp->Display();
  }
}为了方便各位大神下载 , 我不会传附件 ... 所以也无法给出文件 ...
对了 , 使用
dede/plus/arc.php?id=x 来访问 ...
由于看着东西还不到 2 天所以难免有错 , 有考虑不周请大神指正 .