国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2KB

  1. <?php
  2. /**
  3. * @version $Id: index.php 1 9:23 2010-11-11 tianya $
  4. * @package DedeCMS.Site
  5. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  6. * @license http://help.dedecms.com/usersguide/license.html
  7. * @link http://www.dedecms.com
  8. */
  9. if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
  10. {
  11. header('Location:install/index.php');
  12. exit();
  13. }
  14. //自动生成HTML版
  15. if(isset($_GET['upcache']) || !file_exists('index.html'))
  16. {
  17. require_once (dirname(__FILE__) . "/include/common.inc.php");
  18. require_once DEDEINC."/arc.partview.class.php";
  19. $GLOBALS['_arclistEnv'] = 'index';
  20. $row = $dsql->GetOne("Select * From `#@__homepageset`");
  21. $row['templet'] = MfTemplet($row['templet']);
  22. $pv = new PartView();
  23. $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
  24. $row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0;
  25. if ($row['showmod'] == 1)
  26. {
  27. $pv->SaveToHtml(dirname(__FILE__).'/index.html');
  28. include(dirname(__FILE__).'/index.html');
  29. exit();
  30. } else {
  31. $pv->Display();
  32. exit();
  33. }
  34. }
  35. else
  36. {
  37. header('HTTP/1.1 301 Moved Permanently');
  38. header('Location:index.html');
  39. }