function __construct($typeid)
 	{
		$this->indexUrl = $GLOBALS['cfg_basehost'].$GLOBALS['cfg_indexurl'];
		$this->indexName = $GLOBALS['cfg_indexname'];
		$this->baseDir = $GLOBALS['cfg_basedir'];
		$this->modDir = $GLOBALS['cfg_templets_dir'];
		$this->SplitSymbol = $GLOBALS['cfg_list_symbol'];
		$this->dsql = new DedeSql(false);
		$this->TypeID = $typeid;
	  $this->valuePosition = "";
	  $this->valuePositionName = "";
	  $this->typeDir = "";
	  $this->OptionArrayList = "";
		//载入类目信息
		$query = "
		Select #@__arctype.*,#@__channeltype.typename as ctypename
		From #@__arctype left join #@__channeltype
		on #@__channeltype.ID=#@__arctype.channeltype
		where #@__arctype.ID='$typeid'
		";
		if($typeid > 0){
		  $this->TypeInfos = $this->dsql->GetOne($query,MYSQL_ASSOC);
		  //模板和路径变量处理
 		  if($this->TypeInfos['ispart']<=2) $this->TypeInfos['typedir'] = MfTypedir($this->TypeInfos['typedir']);
 		  $this->TypeInfos['tempindex'] = MfTemplet($this->TypeInfos['tempindex']);
 		  $this->TypeInfos['templist'] = MfTemplet($this->TypeInfos['templist']);
 		  $this->TypeInfos['temparticle'] = MfTemplet($this->TypeInfos['temparticle']);
 		  $this->TypeInfos['tempone'] = MfTemplet($this->TypeInfos['tempone']);
	  }
  }
Beispiel #2
0
 function __construct($typeid)
 {
     $this->indexUrl = $GLOBALS['cfg_basehost'] . $GLOBALS['cfg_indexurl'];
     $this->indexName = $GLOBALS['cfg_indexname'];
     $this->baseDir = $GLOBALS['cfg_basedir'];
     $this->modDir = $GLOBALS['cfg_templets_dir'];
     $this->SplitSymbol = $GLOBALS['cfg_list_symbol'];
     $this->dsql = $GLOBALS['dsql'];
     $this->TypeID = $typeid;
     $this->valuePosition = '';
     $this->valuePositionName = '';
     $this->typeDir = '';
     $this->OptionArrayList = '';
     //载入类目信息
     $query = "SELECT tp.*,ch.typename as ctypename,ch.addtable,ch.issystem FROM `#@__arctype` tp left join `#@__channeltype` ch\r\n        on ch.id=tp.channeltype  WHERE tp.id='{$typeid}' ";
     if ($typeid > 0) {
         $this->TypeInfos = $this->dsql->GetOne($query);
         if (is_array($this->TypeInfos)) {
             $this->TypeInfos['tempindex'] = MfTemplet($this->TypeInfos['tempindex']);
             $this->TypeInfos['templist'] = MfTemplet($this->TypeInfos['templist']);
             $this->TypeInfos['temparticle'] = MfTemplet($this->TypeInfos['temparticle']);
         }
     }
 }
Beispiel #3
0
<?php

if (!file_exists(dirname(__FILE__) . '/data/common.inc.php')) {
    header('Location:install/index.php');
    exit;
}
require_once dirname(__FILE__) . "/include/common.inc.php";
require_once DEDEINC . "/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `dede_homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->Display();
 /**
  *  获得模板文件位置
  *
  * @access    public
  * @return    string
  */
 function GetTempletFile()
 {
     global $cfg_basedir, $cfg_templets_dir, $cfg_df_style;
     $cid = $this->ChannelUnit->ChannelInfos['nid'];
     if (!empty($this->Fields['templet'])) {
         $filetag = MfTemplet($this->Fields['templet']);
         if (!preg_match("#\\/#", $filetag)) {
             $filetag = $GLOBALS['cfg_df_style'] . '/' . $filetag;
         }
     } else {
         $filetag = MfTemplet($this->TypeLink->TypeInfos["temparticle"]);
     }
     $tid = $this->Fields['typeid'];
     $filetag = str_replace('{cid}', $cid, $filetag);
     $filetag = str_replace('{tid}', $tid, $filetag);
     $tmpfile = $cfg_basedir . $cfg_templets_dir . '/' . $filetag;
     if ($cid == 'spec') {
         if (!empty($this->Fields['templet'])) {
             $tmpfile = $cfg_basedir . $cfg_templets_dir . '/' . $filetag;
         } else {
             $tmpfile = $cfg_basedir . $cfg_templets_dir . "/{$cfg_df_style}/article_spec.htm";
         }
     }
     if (!file_exists($tmpfile)) {
         $tmpfile = $cfg_basedir . $cfg_templets_dir . "/{$cfg_df_style}/" . ($cid == 'spec' ? 'article_spec.htm' : 'article_default.htm');
     }
     if (!preg_match("#.htm\$#", $tmpfile)) {
         return FALSE;
     }
     return $tmpfile;
 }
  function GetTempletFile()
  {
 	  global $cfg_basedir,$cfg_templets_dir,$cfg_df_style;
 	  $cid = $this->ChannelUnit->ChannelInfos["nid"];
 	  if($this->Fields['templet']!=''){ $filetag = MfTemplet($this->Fields['templet']); }
 	  else{ $filetag = MfTemplet($this->TypeLink->TypeInfos["temparticle"]); }
 	  $tid = $this->Fields["typeid"];
 	  $filetag = str_replace("{cid}",$cid,$filetag);
 	  $filetag = str_replace("{tid}",$tid,$filetag);
 	  $tmpfile = $cfg_basedir.$cfg_templets_dir."/".$filetag;
 	  if($cid=='spec'){
 	  	if($this->Fields['templet']!=''){ $tmpfile = $cfg_basedir.$cfg_templets_dir."/".MfTemplet($this->Fields['templet']); }
 	  	else $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/article_spec.htm";
 	  }
 	  if(!file_exists($tmpfile)) $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/article_default.htm";
 	  return $tmpfile;
  }