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

139 lines
5.2KB

  1. <?php
  2. /**
  3. * 管理后台首页主体
  4. *
  5. * @version $id:index_body.php 11:06 2010年7月13日 tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2022 DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require(dirname(__FILE__).'/config.php');
  12. require(DEDEINC.'/image.func.php');
  13. require(DEDEINC.'/dedetag.class.php');
  14. //默认主页
  15. if (empty($dopost)) {
  16. require(DEDEINC.'/inc/inc_fun_funAdmin.php');
  17. $verLockFile = DEDEDATA.'/admin/ver.txt';
  18. $fp = fopen($verLockFile, 'r');
  19. $upTime = trim(fread($fp, 64));
  20. fclose($fp);
  21. $oktime = substr($upTime, 0, 4).'-'.substr($upTime, 4, 2).'-'.substr($upTime, 6, 2);
  22. $offUrl = SpGetNewInfo();
  23. include DedeInclude('templets/index_body.htm');
  24. exit();
  25. }
  26. else if ($dopost == 'setskin') {
  27. $cskin = empty($cskin) ? 1 : $cskin;
  28. $skin = !in_array($cskin, array(1, 2, 3, 4)) ? 1 : $cskin;
  29. $skinconfig = DEDEDATA.'/admin/skin.txt';
  30. PutFile($skinconfig, $skin);
  31. } elseif ($dopost == 'get_seo') {
  32. //直接采用DedeBIZ重写方法
  33. exit;
  34. } elseif ($dopost == 'get_articles'){
  35. ?>
  36. <table class="table table-borderless">
  37. <?php
  38. $query = "SELECT arc.id, arc.arcrank, arc.title, arc.typeid, arc.pubdate, arc.channel, ch.editcon, tp.typename FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.arcrank<>-2 ORDER BY arc.id DESC LIMIT 0,12";
  39. $arcArr = array();
  40. $dsql->Execute('m', $query);
  41. while($row = $dsql->GetArray('m'))
  42. {
  43. $arcArr[] = $row;
  44. }
  45. ?>
  46. <?php
  47. if (count($arcArr) > 1)
  48. {
  49. foreach($arcArr as $row)
  50. {
  51. if (trim($row['editcon'])==''){
  52. $row['editcon'] = 'archives_edit.php';
  53. }
  54. $rowarcrank = $row['arcrank']==-1? " <span class='text-danger'>[未审核]</span>":"";
  55. $pubdate = GetDateMk($row['pubdate']);
  56. echo "<tr><td><a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a>{$rowarcrank}</td><td width='90'>{$pubdate}</td></tr>";
  57. }
  58. } else {
  59. ?>
  60. <tr><td colspan="2">暂无文档</td></tr>
  61. <?php }?>
  62. </table>
  63. <?php
  64. exit;
  65. } elseif ($dopost == "system_info") {
  66. if (!extension_loaded("openssl")) {
  67. echo json_encode(array(
  68. "code" => -1001,
  69. "msg" => "PHP不支持OpenSSL,无法完成商业版授权。",
  70. "result" => null,
  71. ));
  72. exit;
  73. }
  74. if (empty($cfg_auth_code)) {
  75. echo json_encode(array(
  76. "code" => -1002,
  77. "msg" => "无法启动商业版组件<a href='https://www.dedebiz.com/auth'>《商业版授权》</a>",
  78. "result" => null,
  79. ));
  80. exit;
  81. }
  82. openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
  83. $core_info = new stdClass;
  84. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  85. $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
  86. $client->appid = $cfg_bizcore_appid;
  87. $client->key = $cfg_bizcore_key;
  88. $core_info = $client->SystemInfo();
  89. $client->Close();
  90. }
  91. if (!empty($decotent)) {
  92. $res = json_decode($decotent);
  93. if (isset($res->sid)) {
  94. echo json_encode(array(
  95. "code" => 200,
  96. "msg" => "",
  97. "result" => array(
  98. "domain" => $res->domain,
  99. "title" => $res->title,
  100. "stype" => $res->stype == 1 ? "企业单位" : "个人",
  101. "auth_version" => $res->auth_version,
  102. "auth_at" => date("Y-m-d", $res->auth_at),
  103. "core" => $core_info,
  104. ),
  105. ));
  106. }
  107. }
  108. } elseif ($dopost == 'get_statistics') {
  109. require_once(DEDEINC."/libraries/statistics.class.php");
  110. //获取统计信息
  111. $sdate = empty($sdate) ? 0 : intval($sdate);
  112. $stat = new DedeStatistics;
  113. $rs = $stat->GetInfoByDate($sdate);
  114. echo json_encode(array(
  115. "code" => 200,
  116. "msg" => "",
  117. "result" => $rs,
  118. ));
  119. exit;
  120. } elseif ($dopost == 'get_statistics_multi') {
  121. require_once(DEDEINC."/libraries/statistics.class.php");
  122. //获取统计信息
  123. $sdates = empty($sdates) ? array() : explode(",",preg_replace("[^\d\,]","",$sdates)) ;
  124. $stat = new DedeStatistics;
  125. $rs = $stat->GetInfoByDateMulti($sdates);
  126. echo json_encode(array(
  127. "code" => 200,
  128. "msg" => "",
  129. "result" => $rs,
  130. ));
  131. exit;
  132. } elseif ($dopost == 'safe_mode') {
  133. $safemsg = "系统运行模式为:安全模式,模板管理、标签管理、数据库管理、模块管理等功能已暂停,如果您需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值TRUE修改为FALSE恢复使用";
  134. $unsafemsg = "系统运行模式为:开发模式,模板管理、标签管理、数据库管理、模块管理等功能已恢复,如果您不需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值FALSE修改为TRUE暂停使用";
  135. $modeStr = DEDEBIZ_SAFE_MODE? $safemsg : $unsafemsg;
  136. ShowMsg($modeStr, "javascript:;");
  137. exit;
  138. }
  139. ?>