Beispiel #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;
 }
Beispiel #2
0
    $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);
    $pv->SaveToHtml($homeFile);
    $pv->Close();
    if (empty($nextdo)) {
        ShowMsg("<b>完成主页更新任务!完成所有更新任务!</b>", "close::tgtable");
        exit;
    } else {
        $jumpurl = GetNextUrl();
        ShowMsg("完成主页更新! 现在跳转到其它更新任务...", $jumpurl, 0, 500);
        exit;
    }
} else {
    if ($dopost == 'makeparenttype') {
        require_once DEDEDATA . "/cache/inc_catalog_base.inc";
        require_once DEDEINC . '/arc.listview.class.php';
        $notallowArr = array('dopost', 'f', 'del', 'curpage', 'morejob');
        $jumpurl = GetNextUrl($notallowArr);
Beispiel #3
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');
}
        $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;
}
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;
}
	$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");

ClearAllLink();
<?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>";
  $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();
?>
    $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);
Beispiel #10
0
	
	// 创建栏目目录
	$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;
}


//获取静态的分页列表
function GetPageList($url,$page,$count,$each,$list_len,$listitem="index,end,pre,next,pageno,option")
Beispiel #11
0
                    } 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
}
//while
//更新栏目开始