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

56 line
2.0KB

  1. <?php
  2. /**
  3. * 首页
  4. *
  5. * @version $id:index.php 9:23 2022-05-16 tianya $
  6. * @package DedeBIZ.Site
  7. * @copyright Copyright (c) 2022 DedeBIZ.COM
  8. * @license GNU GPL v2 (https://www.dedebiz.com/license)
  9. * @link https://www.dedebiz.com
  10. */
  11. define("DEDEINDEX", true);
  12. if (!file_exists(dirname(__FILE__).'/data/common.inc.php')) {
  13. header('Location:install/index.php');
  14. exit();
  15. }
  16. if (isset($_GET['upcache']) || !file_exists('index.html')) {
  17. require_once(dirname(__FILE__)."/system/common.inc.php");
  18. if (DEBUG_LEVEL == TRUE) {
  19. $ttt1 = ExecTime();
  20. }
  21. require_once DEDEINC."/archive/partview.class.php";
  22. $GLOBALS['_arclistEnv'] = 'index';
  23. $row = $dsql->GetOne("SELECT * FROM `#@__homepageset`");
  24. $row['templet'] = MfTemplet($row['templet']);
  25. $pv = new PartView();
  26. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$row['templet']);
  27. $row['showmod'] = isset($row['showmod']) ? $row['showmod'] : 0;
  28. if ($row['showmod'] == 1) {
  29. $pv->SaveToHtml(dirname(__FILE__).'/index.html');
  30. if (DEBUG_LEVEL == TRUE) {
  31. $queryTime = ExecTime() - $ttt1;
  32. if (PHP_SAPI === 'cli') {
  33. echo '首页:生成花费时间:'.$queryTime."\r\n";
  34. } else {
  35. echo DedeAlert("页面加载总消耗时间:{$queryTime}", ALERT_DANGER);
  36. }
  37. }
  38. include(dirname(__FILE__).'/index.html');
  39. exit();
  40. } else {
  41. $pv->Display();
  42. if (DEBUG_LEVEL == TRUE) {
  43. $queryTime = ExecTime() - $ttt1;
  44. if (PHP_SAPI === 'cli') {
  45. echo '首页:加载花费时间:'.$queryTime."\r\n";
  46. } else {
  47. echo DedeAlert("页面加载总消耗时间:{$queryTime}", ALERT_DANGER);
  48. }
  49. }
  50. exit();
  51. }
  52. } else {
  53. header('HTTP/1.1 301 Moved Permanently');
  54. header('Location:index.html');
  55. }
  56. ?>