Пример #1
0
 function ac_xml()
 {
     global $cfg_basedir, $cfg_cmspath;
     require_once DEDEINC . "/arc.partview.class.php";
     $murl = $cfg_cmspath . "/sitemap.xml";
     $tmpfile = SEOTEMPLETS . "/admin/sitemap.xml";
     $pv = new PartView();
     $pv->SetTemplet($tmpfile);
     $pv->SaveToHtml($cfg_basedir . $murl);
     echo "<a href='{$murl}' target='_blank'>成功更新文件: {$murl} 浏览...</a>";
     exit;
 }
Пример #2
0
function lib_mytag(&$ctag, &$refObj)
{
    $attlist = "typeid|0,name|,ismake|no";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (trim($ismake) == '') {
        $ismake = 'no';
    }
    $body = lib_GetMyTagT($refObj, $typeid, $name, '#@__mytag');
    //编译
    if ($ismake == 'yes') {
        require_once DEDEINC . '/arc.partview.class.php';
        $pvCopy = new PartView($typeid);
        $pvCopy->SetTemplet($body, "string");
        $body = $pvCopy->GetResult();
    }
    return $body;
}
Пример #3
0
 /**
  *  php5构造函数
  *
  * @access    public
  * @param     int  $aid  内容ID
  * @return    string
  */
 function __construct($aid)
 {
     global $cfg_basedir, $cfg_templets_dir, $cfg_df_style, $envs;
     $this->dsql = $GLOBALS['dsql'];
     $this->dtp = new DedeTagParse();
     $this->dtp->refObj = $this;
     $this->dtp->SetNameSpace("dede", "{", "}");
     $this->Fields = $this->dsql->GetOne("SELECT * FROM `#@__sgpage` WHERE aid='{$aid}' ");
     $envs['aid'] = $this->Fields['aid'];
     //设置一些全局参数的值
     foreach ($GLOBALS['PubFields'] as $k => $v) {
         $this->Fields[$k] = $v;
     }
     if ($this->Fields['ismake'] == 1) {
         $pv = new PartView();
         $pv->SetTemplet($this->Fields['body'], 'string');
         $this->Fields['body'] = $pv->GetResult();
     }
     $tplfile = $cfg_basedir . str_replace('{style}', $cfg_templets_dir . '/' . $cfg_df_style, $this->Fields['template']);
     $this->dtp->LoadTemplate($tplfile);
     $this->ParseTemplet();
 }
Пример #4
0
        $reid = $tinfos['reid'];
        $typedir = $tinfos['typedir'];
    } else {
        @header("http/1.1 404 not found");
        @header("status: 404 not found");
        include "../404.html";
        exit;
    }
    if ($actype == "download") {
        if ($reid == 0 || $reid == 45) {
            header('HTTP/1.1 301 Moved Permanently');
            header("Location:{$typedir}.html");
            exit;
        } else {
            include_once DEDEINC . "/arc.partview.class.php";
            $pv = new PartView($tid, $needtypelink = TRUE, $actype);
            $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $cfg_df_style . "/downlist.htm");
            $pv->SaveToHtml($tfilename);
            $pv->Close();
        }
    } else {
        //sbYou.net 修改 去除自动生成静态,用另一种方法生成
        /*
        include_once(DEDEINC."/arc.listview.class.php");
        $lv = new ListView($tid,"",$actype);
        $reurl = $lv->MakeHtml();
        $lv->Close();
        */
    }
}
//系统参数
Пример #5
0
	$tags_count = isset($tags_count['count']) ? (int)$tags_count['count'] : 0;
	$page_html = GetPageList('list_'.$arctype_id.'_{page}.html', $page, $tags_count, $each, 5);
	
	// 创建栏目目录
	$true_typedir = str_replace("{cmspath}",$cfg_cmspath,$arctype['typedir']);
	$true_typedir = ereg_replace("/{1,}","/",$true_typedir);
	if(!CreateDir($true_typedir))
	{
		ShowMsg("创建目录 {$true_typedir} 失败,请检查你的路径是否存在问题!","-1");
		exit();
	}
	
	// 生成静态页面文件
	$output = $cfg_basedir.str_replace('{cmspath}', $cfg_cmspath, $arctype['typedir']).'/list_'.$arctype_id.'_'.$page.'.html'; // 写死了
	$tpl_file = $cfg_basedir.$cfg_templets_dir.'/tmcms/tag.htm';
	$pv = new PartView();
	$pv->SetTemplet($tpl_file);
	$pv->SaveToHtml($output);
	if($page == 1) {
		$output = $cfg_basedir.str_replace('{cmspath}', $cfg_cmspath, $arctype['typedir']).'/index.html';
		$pv->SaveToHtml($output);
	}
	
	$page++;
	$goto = "ex_tags_main.php?action=makeHtml&typeid={$arctype_id}&page={$page}";
	ShowMsg('继续生成下一页['.$page.']静态页面', $goto);
	
	exit;
}

Пример #6
0
        $config = array('hostname' => $servurl, 'username' => $servuser, 'password' => $servpwd, 'debug' => 'TRUE');
    } else {
        $config = array();
    }
    if (!$ftp->connect($config)) {
        exit('Error:None FTP Connection!');
    }
}
if ($uptype == "all") {
    $row = $dsql->GetOne("SELECT id FROM #@__arctype WHERE id>'{$typeid}' AND ispart<>2 ORDER BY id ASC LIMIT 0,1;");
    if (!is_array($row)) {
        echo "完成所有文件更新!";
        exit;
    } else {
        $pv = new PartView($row['id']);
        $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $templet);
        $pv->SaveToHtml($cfg_basedir . $cfg_cmspath . "/data/js/" . $row['id'] . ".js", $isremote);
        $typeid = $row['id'];
        ShowMsg("成功更新" . $cfg_cmspath . "/data/js/" . $row['id'] . ".js,继续进行操作!", "makehtml_js_action.php?typeid={$typeid}&isremote={$isremote}&serviterm={$serviterm}", 0, 100);
        exit;
    }
} else {
    $pv = new PartView($typeid);
    $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $templet);
    $pv->SaveToHtml($cfg_basedir . $cfg_cmspath . "/data/js/" . $typeid . ".js", $isremote);
    echo "成功更新" . $cfg_cmspath . "/data/js/" . $typeid . ".js!";
    echo "预览:";
    echo "<hr>";
    echo "<script src='" . $cfg_cmspath . "/data/js/" . $typeid . ".js'></script>";
    exit;
}
	";
	$dsql = new DedeSql(false);
	$dsql->SetQuery($inQuery);
	if(!$dsql->ExecuteNoneQuery())
	{
		$dsql->Close();
		ShowMsg("增加页面失败,请检查长相是否有问题!","-1");
	  exit();
	}
	$dsql->Close();
	
	$filename = $cfg_basedir.$cfg_cmspath."/".$filename;
	
	if($ismake==1)
	{
	  $pv = new PartView();
    $pv->SetTemplet(stripslashes($body),"string");
    $pv->SaveToHtml($filename);
    $pv->Close();
  }
  else
  {
  	$fp = fopen($filename,"w") or die("创建:{$filename} 失败,可能是没有权限!");
  	fwrite($fp,stripslashes($body));
  	fclose($fp);
  }
	ShowMsg("成功增加一个页面!","templets_one.php");
	exit();
}

require_once(dirname(__FILE__)."/templets/templets_one_add.htm");
Пример #8
0
function lib_channelartlist(&$ctag, &$refObj)
{
    global $dsql, $envs, $_sys_globals, $cfg_tui;
    //处理标记属性、innertext
    $attlist = 'typeid|0,row|20,showhide|no,cacheid|';
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $showhideArr = array('yes' => 0, 'no' => 1, 'both' => -1);
    $hideflag = $showhideArr[$showhide];
    $artlist = '';
    //读取固定的缓存块
    $cacheid = trim($cacheid);
    if ($cacheid != '') {
        $artlist = GetCacheBlock($cacheid);
        if ($artlist != '') {
            return $artlist;
        }
    }
    if (empty($typeid)) {
        $typeid = !empty($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : 0;
    }
    if ($innertext == '') {
        $innertext = GetSysTemplets('part_channelartlist.htm');
    }
    $totalnum = $row;
    if (empty($totalnum)) {
        $totalnum = 20;
    }
    //获得类别ID总数的信息
    $typeids = array();
    if ($typeid == 0) {
        $tpsql = " reid<>0 AND ispart<>2 AND ishidden<>{$hideflag} AND channeltype>0 ";
    } else {
        if ($typeid == '-1') {
            $tpsql = " reid=0 and ishidden<>{$hideflag} AND channeltype>0 ";
        } else {
            if ($typeid == '-9999999') {
                $tpsql = " id={$cfg_tui} AND ispart<>2 AND ishidden<>{$hideflag} ";
            } else {
                if (!preg_match('#,#', $typeid) && $typeid > 0) {
                    $tpsql = " reid='{$typeid}' AND ispart<>2 AND ishidden<>{$hideflag} ";
                } else {
                    if ($typeid < 0) {
                        $typeid = 0 - $typeid;
                        $tpsql = " id={$typeid} AND ispart<>2 AND ishidden<>{$hideflag} ";
                    } else {
                        $tpsql = " reid IN({$typeid}) AND ispart<>2 AND ishidden<>{$hideflag} ";
                    }
                }
            }
        }
    }
    if ($orderby == '') {
        $orderbysql = "ORDER BY id";
    } else {
        $orderbysql = "ORDER BY {$orderby}";
    }
    if ($orderway == '') {
        $orderwaysql = "desc";
    } else {
        $orderwaysql = "{$orderway}";
    }
    $dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath \r\n                                            FROM `#@__arctype` WHERE {$tpsql} {$orderbysql} {$orderwaysql} LIMIT {$totalnum}");
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $typeids[] = $row;
    }
    if (!isset($typeids[0])) {
        return '';
    }
    $GLOBALS['itemindex'] = 0;
    $GLOBALS['itemparity'] = 1;
    for ($i = 0; isset($typeids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new PartView($typeids[$i]['id']);
        $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
        $GLOBALS['itemparity'] = $GLOBALS['itemparity'] == 1 ? 2 : 1;
    }
    //注销环境变量,以防止后续调用中被使用
    $GLOBALS['envs']['typeid'] = $_sys_globals['typeid'];
    $GLOBALS['envs']['reid'] = '';
    if ($cacheid != '') {
        WriteCacheBlock($cacheid, $artlist);
    }
    return $artlist;
}
Пример #9
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();
Пример #10
0
function lib_channelartlist(&$ctag, &$refObj)
{
    global $dsql, $envs, $_sys_globals;
    //处理标记属性、innertext
    $attlist = 'typeid|0,row|20,cacheid|';
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    //读取固定的缓存块
    $cacheid = trim($cacheid);
    if ($cacheid != '') {
        $artlist = GetCacheBlock($cacheid);
        if ($artlist != '') {
            return $artlist;
        }
    }
    if (empty($typeid)) {
        $typeid = !empty($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : 0;
    }
    if ($innertext == '') {
        $innertext = GetSysTemplets('part_channelartlist.htm');
    }
    $totalnum = $row;
    if (empty($totalnum)) {
        $totalnum = 20;
    }
    //获得类别ID总数的信息
    $typeids = array();
    if ($typeid == 0 || $typeid == 'top') {
        $tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
    } else {
        if (!preg_match('#,#', $typeid)) {
            $tpsql = " reid='{$typeid}' AND ispart<>2 AND ishidden<>1 ";
        } else {
            $tpsql = " id IN({$typeid}) AND ispart<>2 AND ishidden<>1 ";
        }
    }
    $dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath \n                                            FROM `#@__arctype` WHERE {$tpsql} ORDER BY substring_index( '{$typeid}',id,1) limit {$totalnum}");
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $typeids[] = $row;
    }
    if (!isset($typeids[0])) {
        return '';
    }
    $GLOBALS['itemindex'] = 0;
    $GLOBALS['itemparity'] = 1;
    for ($i = 0; isset($typeids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new PartView($typeids[$i]['id']);
        $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
        if ($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid']) {
            $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current';
        } else {
            $pv->Fields['currentstyle'] = '';
        }
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
        $GLOBALS['itemparity'] = $GLOBALS['itemparity'] == 1 ? 2 : 1;
    }
    //注销环境变量,以防止后续调用中被使用
    $GLOBALS['envs']['typeid'] = $_sys_globals['typeid'];
    $GLOBALS['envs']['reid'] = '';
    if ($cacheid != '') {
        WriteCacheBlock($cacheid, $artlist);
    }
    return $artlist;
}
Пример #11
0
<?php

if (!file_exists(dirname(__FILE__) . '/data/common.inc.php')) {
    header('Location:install/index.php');
    exit;
}
//自动生成HTML版
if (isset($_GET['upcache'])) {
    require_once dirname(__FILE__) . "/include/common.inc.php";
    require_once DEDEINC . "/arc.partview.class.php";
    $GLOBALS['_arclistEnv'] = 'index';
    $row = $dsql->GetOne("Select * From `#@__homepageset`");
    $row['templet'] = MfTemplet($row['templet']);
    $pv = new PartView();
    $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
    $pv->SaveToHtml(dirname(__FILE__) . '/index.html');
    include dirname(__FILE__) . '/index.html';
    exit;
} else {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location:index.html');
}
	$pv->Display();
	$pv->Close();
}
else if($dopost=="make")
{
	header("Content-Type: text/html; charset={$cfg_ver_lang}");
	$homeFile = dirname(__FILE__)."/".$position;
	$homeFile = str_replace("\\","/",$homeFile);
	$homeFile = str_replace("//","/",$homeFile);
	$fp = fopen($homeFile,"w") or die("你指定的文件名有问题,无法创建文件");
	fclose($fp);
	if($saveset==1)
	{
		$dsql = new DedeSql(false);
		$dsql->SetQuery("update #@__homepageset set templet='$templet',position='$position' ");
		$dsql->ExecuteNoneQuery();
		$dsql->Close();
	}
	$templet = str_replace("{style}",$cfg_df_style,$templet);
	$pv = new PartView();
	$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
	$pv->SaveToHtml($homeFile);
	$pv->Close();
	echo "成功更新主页HTML:".$homeFile;
	echo "<br/><br/><a href='$position' target='_blank'>浏览...</a>";
}
$t2 = ExecTime();
echo "<!-- ".($t2-$t1)." -->";

ClearAllLink();
?>
Пример #13
0
	function IncludeFile($filename,$ismake='no')
	{
		global $cfg_df_style;
		$restr = "";
		if(file_exists($filename)){ $okfile = $filename; }
		else if( file_exists(dirname(__FILE__)."/".$filename) ){ $okfile = dirname(__FILE__)."/".$filename; }
		else if( file_exists(dirname(__FILE__)."/../".$filename) ){ $okfile = dirname(__FILE__)."/../".$filename; }
		else if( file_exists(dirname(__FILE__)."/../templets/".$filename) ){ $okfile = dirname(__FILE__)."/../templets/".$filename; }
		else if( file_exists(dirname(__FILE__)."/../templets/".$cfg_df_style."/".$filename) ){ $okfile = dirname(__FILE__)."/../templets/".$cfg_df_style."/".$filename; }
		else{ return "无法在这个位置找到: $filename"; }
		//编译
  	if($ismake=="yes"){
  		require_once(dirname(__FILE__)."/inc_arcpart_view.php");
  		$pvCopy = new PartView();
  		$pvCopy->SetTemplet($okfile,"file");
  		$restr = $pvCopy->GetResult();
    }else{
  	  $fp = @fopen($okfile,"r");
		  while($line=fgets($fp,1024)) $restr.=$line;
		  fclose($fp);
	  }
		return $restr;
	}
<?php

require_once dirname(__FILE__) . "/config.php";
CheckPurview('sys_MakeHtml');
require_once DEDEINC . "/arc.partview.class.php";
$tagFile = DEDEADMIN . "/../tags.html";
$fp = fopen($tagFile, "w") or die("你指定的文件名有问题,无法创建文件");
fclose($fp);
$pv = new PartView();
$GLOBALS['_arclistEnv'] = 'index';
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $cfg_df_style . "/index_tag.htm");
//打开TAG页模板
$pv->SaveToHtml($tagFile);
echo "成功更新TAG主页:" . $tagFile;
echo "<br/><br/><a href='../tags.html' target='_blank'>浏览...</a>";
Пример #15
0
function pasterTempletDiy($path)
{
    require_once DEDEINC . "/arc.partview.class.php";
    global $cfg_basedir, $cfg_templets_dir;
    $tmpfile = $cfg_basedir . $cfg_templets_dir . "/" . $path;
    //模版文件的路径
    $dtp = new PartView();
    $dtp->SetTemplet($tmpfile);
    $dtp->Display();
}
  $row = $dsql->GetOne("Select ID From #@__arctype where ID>'$typeid' And ispart<2 order by ID asc limit 0,1;");
  $dsql->Close();
  if(!is_array($row)){
	  echo "完成所有文件更新!";
	  exit();
  }
  else{
	  $pv = new PartView($row['ID']);
    $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
    $pv->SaveToHtml($cfg_basedir."/data/js/".$row['ID'].".js");
    $pv->Close();
	  $typeid = $row['ID'];
	  ShowMsg("成功更新"."/data/js/".$row['ID'].".js,继续进行操作!","makehtml_js_action.php?typeid=$typeid",0,100);
    exit();
  }
}
else
{
	$pv = new PartView($typeid);
  $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
  $pv->SaveToHtml($cfg_basedir."/data/js/".$typeid.".js");
  $pv->Close();
	echo "成功更新"."/data/js/".$typeid.".js!";
	echo "预览:";
	echo "<hr>";
	echo "<script src='../data/js/".$typeid.".js'></script>";
  exit();
}

ClearAllLink();
?>
Пример #17
0
    $homeFile = dirname(__FILE__) . "/../html/index.html";
    $cfg_autoindex_time = intval($cfg_autoindex_time) >= 0 ? intval($cfg_autoindex_time) : 600;
    if (abs(time() - @filemtime($homeFile)) > $cfg_autoindex_time) {
        //生成首页 by QISIP 2014-04-01
        $tid = '';
        $dsql->ExecuteNoneQuery("Delete From `#@__arccache`");
        include_once DEDEINC . "/arc.partview.class.php";
        $row = $dsql->GetOne("Select * From `#@__homepageset`");
        $row['templet'] = MfTemplet($row['templet']);
        $pv = new PartView();
        $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
        $pv->SaveToHtml('../html/index.html');
        $dsql->Close();
        //生成sitemap by QISIP 2014-04-01
        $sitemaptemplet = $cfg_df_style . "/sitemap.htm";
        $pv2 = new PartView();
        $pv2->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $sitemaptemplet);
        $sitemapFile = "../sitemap.html";
        $pv2->SaveToHtml($sitemapFile);
        //生成排行榜 by QISIP 2014-04-03
        $tid = '375';
        $paihangbangtemplet = $cfg_df_style . "/paihang.htm";
        $paihangbangtemplet = $cfg_basedir . $cfg_templets_dir . "/" . $paihangbangtemplet;
        if (file_exists($paihangbangtemplet)) {
            $lv = new ListView($tid);
            $reurl = $lv->MakeHtml();
            $lv->Close();
        }
    }
}
setcookie("upflag", '1', time() + $co_oldpertime);
Пример #18
0
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . '/../include/common.inc.php';
require_once DEDEINC . '/arc.partview.class.php';
if (isset($arcID)) {
    $aid = $arcID;
}
$arcID = $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
if ($aid == 0) {
    die(" document.write('Request Error!'); ");
}
$cacheFile = DEDEDATA . '/cache/mytag-' . $aid . '.htm';
if (isset($nocache) || !file_exists($cacheFile) || time() - filemtime($cacheFile) > $cfg_puccache_time) {
    $pv = new PartView();
    $row = $pv->dsql->GetOne(" SELECT * FROM `#@__mytag` WHERE aid='{$aid}' ");
    if (!is_array($row)) {
        $myvalues = "<!--\r\ndocument.write('Not found input!');\r\n-->";
    } else {
        $tagbody = '';
        if ($row['timeset'] == 0) {
            $tagbody = $row['normbody'];
        } else {
            $ntime = time();
            if ($ntime > $row['endtime'] || $ntime < $row['starttime']) {
                $tagbody = $row['expbody'];
            } else {
                $tagbody = $row['normbody'];
            }
        }
function MakeArt($aid,$mkindex=true,$upcache=true)
{
	global $cfg_makeindex,$cfg_basedir,$cfg_templets_dir,$cfg_df_style,$cfg_up_prenext,$typeid,$envs,$typeid;
	include_once(DEDEADMIN."/../include/inc_archives_view.php");
	if(!$upcache) $envs['nocache'] = true;
	$arc = new Archives($aid);
  $reurl = $arc->MakeHtml();
  if($mkindex)
  {
  	//更新上下篇文章
  	if($cfg_up_prenext=='Y' && !empty($typeid))
  	{
     		$preRow =  $arc->dsql->GetOne("Select ID From `{$arc->MainTable}` where ID<$aid And ID>".($aid-1000)." And arcrank>-1 And typeid='$typeid' order by ID desc");
        $nextRow = $arc->dsql->GetOne("Select ID From `{$arc->MainTable}` where ID>$aid And ID<".($aid+1000)." And arcrank>-1 And typeid='$typeid' order by ID asc");
    		
    		if(is_array($preRow)){
  	   			$arc = new Archives($preRow['ID']);
       			$arc->MakeHtml();
    		}
    		if(is_array($nextRow)){
  	   		$arc = new Archives($nextRow['ID']);
       		$arc->MakeHtml();
    		}
  	}
  	//更新主页
  	if($cfg_makeindex=='Y')
  	{
  			$pv = new PartView();
  			$row = $pv->dsql->GetOne("Select * From #@__homepageset");
  			$templet = str_replace("{style}",$cfg_df_style,$row['templet']);
  			$homeFile = dirname(__FILE__)."/../".$row['position'];
	  		$homeFile = str_replace("\\","/",$homeFile);
	  		$homeFile = str_replace("//","/",$homeFile);
	  		$fp = fopen($homeFile,"w") or die("主页文件:{$homeFile} 没有写权限!");
	  		fclose($fp);
	  		$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
	  		$pv->SaveToHtml($homeFile);
  	}
  }
  return $reurl;
}
}
/*----------------------
function __makeAll();
-------------------*/
else if($dopost=="makeall")
{
	require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
  $dsql->ExecuteNoneQuery("update #@__sgpage set uptime='".time()."'");
	$row = $dsql->Execute('meoutside',"Select * From #@__sgpage ");
	while($row = $dsql->GetArray('meoutside'))
	{
	  $fileurl = $cfg_cmspath."/".$row['filename'];
	  $filename = $cfg_basedir.$cfg_cmspath."/".$row['filename'];
	  if($row['ismake']==1)
	  {
	    $pv = new PartView();
      $pv->SetTemplet($row['body'],"string");
      $pv->SaveToHtml($filename);
     }
     else
     {  
    	  $fp = fopen($filename,"w") or die("创建:{$filename} 失败,可能是没有权限!");
  	    fwrite($fp,$row['body']);
        fclose($fp);
     }
  }
	$dsql->Close();
	ShowMsg("成功更新所有页面!","templets_one.php");
	exit();
}
$row = $dsql->GetOne("Select  * From #@__sgpage where aid='$aid'");
Пример #21
0
<?php

require_once dirname(__FILE__) . "/config.php";
CheckPurview('temp_Test');
require_once DEDEINC . "/arc.partview.class.php";
$partcode = stripslashes($partcode);
if (empty($typeid)) {
    $typeid = 0;
}
if (empty($showsource)) {
    $showsource = "";
}
if ($typeid > 0) {
    $pv = new PartView($typeid);
} else {
    $pv = new PartView();
}
$pv->SetTemplet($partcode, "string");
if ($showsource == "" || $showsource == "yes") {
    echo "模板代码:";
    echo "<span style='color:red;'><pre>" . htmlspecialchars($partcode) . "</pre></span>";
    echo "结果:<hr size='1' width='100%'>";
}
$pv->Display();
Пример #22
0
        exit;
    } else {
        $jumpurl = GetNextUrl();
        ShowMsg("完成下篇文档更新任务! 继续执行其它任务...", $jumpurl, 0, 500);
        exit;
    }
}
/******************************
//更新主页的任务
function makeindex() {  }
******************************/
if ($dopost == 'makeindex') {
    require_once DEDEINC . '/arc.partview.class.php';
    $envs = $_sys_globals = array();
    $envs['aid'] = 0;
    $pv = new PartView();
    $row = $pv->dsql->GetOne('SELECT * FROM `#@__homepageset`');
    $templet = str_replace("{style}", $cfg_df_style, $row['templet']);
    $homeFile = dirname(__FILE__) . '/' . $row['position'];
    $homeFile = str_replace("//", "/", str_replace("\\", "/", $homeFile));
    $fp = fopen($homeFile, 'w') or die("无法更新网站主页到:{$homeFile} 位置");
    fclose($fp);
    $tpl = $cfg_basedir . $cfg_templets_dir . '/' . $templet;
    if (!file_exists($tpl)) {
        $tpl = $cfg_basedir . $cfg_templets_dir . '/default/index.htm';
        if (!file_exists($tpl)) {
            exit("无法找到主页模板:{$tpl} ");
        }
    }
    $GLOBALS['_arclistEnv'] = 'index';
    $pv->SetTemplet($tpl);
Пример #23
0
                    if ($row['issystem'] == -1) {
                        $dsql->ExecuteNoneQuery("Update `" . trim($row['addtable']) . "` set arcrank='0' where aid='{$aid}' ");
                    } else {
                        $dsql->ExecuteNoneQuery("Update `{$maintable}` set arcrank='0',pubdate='{$now}' where id='{$aid}' ");
                    }
                    $pageurl = MakeArt($aid, false);
                }
                //while
                //审核更新文档结束
                echo "审核更新文档结束运行……";
                //更新主页
                echo "更新主页运行……";
                $GLOBALS['_arclistEnv'] = 'index';
                $row = $dsql->GetOne("Select * From `#@__homepageset`");
                $row['templet'] = MfTemplet($row['templet']);
                $pv = new PartView();
                $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
                $pv->SaveToHtml(DEDEROOT . '/index.html');
                //更新主页
                $query = "Update `#@__check_time` set check_time={$now} where id='" . $row1['id'] . "' ";
                //更新审核时间
                echo "更新审核时间……";
                $dsql->ExecuteNoneQuery($query);
                //ShowMsg("1");
            }
            //if
        }
        //if
    }
    //if
}