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

55 lines
2.3KB

  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 https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. if (!file_exists(dirname(__FILE__).'/data/common.inc.php')) {
  12. header('Location:install/index.php');
  13. exit();
  14. }
  15. if (isset($_GET['upcache']) || !file_exists('index.html')) {
  16. require_once(dirname(__FILE__)."/system/common.inc.php");
  17. if (DEBUG_LEVEL == TRUE) {
  18. $ttt1 = ExecTime();
  19. }
  20. require_once DEDEINC."/archive/partview.class.php";
  21. $GLOBALS['_arclistEnv'] = 'index';
  22. $row = $dsql->GetOne("SELECT * FROM `#@__homepageset`");
  23. $row['templet'] = MfTemplet($row['templet']);
  24. $pv = new PartView();
  25. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$row['templet']);
  26. $row['showmod'] = isset($row['showmod']) ? $row['showmod'] : 0;
  27. if ($row['showmod'] == 1) {
  28. $pv->SaveToHtml(dirname(__FILE__).'/index.html');
  29. if (DEBUG_LEVEL == TRUE) {
  30. $queryTime = ExecTime() - $ttt1;
  31. if (PHP_SAPI === 'cli') {
  32. echo '首页:生成花费时间:'.$queryTime."\r\n";
  33. } else {
  34. echo "<div style='width:98%;margin:1rem auto;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;position:relative;padding:.75rem 1.25rem;border:1px solid transparent;border-radius:.25rem'>页面加载总消耗时间:{$queryTime}</div>\r\n";
  35. }
  36. }
  37. include(dirname(__FILE__).'/index.html');
  38. exit();
  39. } else {
  40. $pv->Display();
  41. if (DEBUG_LEVEL == TRUE) {
  42. $queryTime = ExecTime() - $ttt1;
  43. if (PHP_SAPI === 'cli') {
  44. echo '首页:加载花费时间:'.$queryTime."\r\n";
  45. } else {
  46. echo "<div style='width:98%;margin:1rem auto;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;position:relative;padding:.75rem 1.25rem;border:1px solid transparent;border-radius:.25rem'>页面加载总消耗时间:{$queryTime}</div>\r\n";
  47. }
  48. }
  49. exit();
  50. }
  51. } else {
  52. header('HTTP/1.1 301 Moved Permanently');
  53. header('Location:index.html');
  54. }
  55. ?>