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

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