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; } |
新闻热点
疑难解答