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

140 lines
5.4KB

  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. } else if ($dopost == 'setskin') {
  26. $cskin = empty($cskin) ? 1 : $cskin;
  27. $skin = !in_array($cskin, array(1, 2, 3, 4)) ? 1 : $cskin;
  28. $skinconfig = DEDEDATA.'/admin/skin.txt';
  29. PutFile($skinconfig, $skin);
  30. } elseif ($dopost == 'get_seo') {
  31. //直接采用DedeBIZ重写方法
  32. exit;
  33. } elseif ($dopost == 'get_articles') {
  34. ?>
  35. <table class="table table-borderless">
  36. <?php
  37. $userCatalogSql = '';
  38. if (count($admin_catalogs) > 0) {
  39. $admin_catalog = join(',', $admin_catalogs);
  40. $userCatalogSql = "AND arc.typeid IN($admin_catalog) ";
  41. }
  42. $query = "SELECT arc.id, arc.arcrank, arc.title, arc.typeid, arc.mid, 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 {$userCatalogSql} AND arc.mid={$cuserLogin->getUserID()} ORDER BY arc.id DESC LIMIT 0,20";
  43. $arcArr = array();
  44. $dsql->Execute('m', $query);
  45. while($row = $dsql->GetArray('m'))
  46. {
  47. $arcArr[] = $row;
  48. }
  49. ?>
  50. <?php
  51. if (count($arcArr) > 0) {
  52. foreach($arcArr as $row)
  53. {
  54. if (trim($row['editcon'])=='') {
  55. $row['editcon'] = 'archives_edit.php';
  56. }
  57. $rowarcrank = $row['arcrank']==-1? "<span class='btn btn-danger btn-xs ml-2'>未审核</span>":"";
  58. $pubdate = GetDateMk($row['pubdate']);
  59. echo "<tr><td><a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a>{$rowarcrank}</td><td width='90'>{$pubdate}</td></tr>";
  60. }
  61. } else {
  62. ?>
  63. <tr><td colspan="2" align="center">暂无文档</td></tr>
  64. <?php }?>
  65. </table>
  66. <?php
  67. exit;
  68. } elseif ($dopost == "system_info") {
  69. if (!extension_loaded("openssl")) {
  70. echo json_encode(array(
  71. "code" => -1001,
  72. "msg" => "PHP不支持OpenSSL,无法完成商业版授权。",
  73. "result" => null,
  74. ));
  75. exit;
  76. }
  77. if (empty($cfg_auth_code)) {
  78. echo json_encode(array(
  79. "code" => -1002,
  80. "msg" => "当前站点已授权社区版,获取更多官方技术支持,请选择<a href='https://www.dedebiz.com/auth' class='text-primary'>商业版</a>。",
  81. "result" => null,
  82. ));
  83. exit;
  84. }
  85. openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
  86. $core_info = new stdClass;
  87. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  88. $client = new DedeBizClient();
  89. $core_info = $client->SystemInfo();
  90. $client->Close();
  91. }
  92. if (!empty($decotent)) {
  93. $res = json_decode($decotent);
  94. if (isset($res->sid)) {
  95. echo json_encode(array(
  96. "code" => 200,
  97. "msg" => "",
  98. "result" => array(
  99. "domain" => $res->domain,
  100. "title" => $res->title,
  101. "stype" => $res->stype == 1 ? "企业单位" : "个人",
  102. "auth_version" => $res->auth_version,
  103. "auth_at" => date("Y-m-d", $res->auth_at),
  104. "core" => $core_info,
  105. ),
  106. ));
  107. }
  108. }
  109. } elseif ($dopost == 'get_statistics') {
  110. require_once(DEDEINC."/libraries/statistics.class.php");
  111. //获取统计信息
  112. $sdate = empty($sdate) ? 0 : intval($sdate);
  113. $stat = new DedeStatistics;
  114. $rs = $stat->GetInfoByDate($sdate);
  115. echo json_encode(array(
  116. "code" => 200,
  117. "msg" => "",
  118. "result" => $rs,
  119. ));
  120. exit;
  121. } elseif ($dopost == 'get_statistics_multi') {
  122. require_once(DEDEINC."/libraries/statistics.class.php");
  123. //获取统计信息
  124. $sdates = empty($sdates) ? array() : explode(",",preg_replace("[^\d\,]","",$sdates)) ;
  125. $stat = new DedeStatistics;
  126. $rs = $stat->GetInfoByDateMulti($sdates);
  127. echo json_encode(array(
  128. "code" => 200,
  129. "msg" => "",
  130. "result" => $rs,
  131. ));
  132. exit;
  133. } elseif ($dopost == 'safe_mode') {
  134. $safemsg = "系统运行模式为安全模式,模板管理、标签管理、数据库管理、模块管理等功能已暂停,如果您需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值TRUE修改为FALSE恢复使用";
  135. $unsafemsg = "系统运行模式为开发模式,模板管理、标签管理、数据库管理、模块管理等功能已恢复,如果您不需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值FALSE修改为TRUE暂停使用";
  136. $modeStr = DEDEBIZ_SAFE_MODE? $safemsg : $unsafemsg;
  137. ShowMsg($modeStr, "javascript:;");
  138. exit;
  139. }
  140. ?>