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

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