国内流行的内容管理系统(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.

38 lines
1.3KB

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