国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

137 rindas
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='btn btn-danger btn-xs'>未审核</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' class='text-primary'>商业版</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();
  86. $core_info = $client->SystemInfo();
  87. $client->Close();
  88. }
  89. if (!empty($decotent)) {
  90. $res = json_decode($decotent);
  91. if (isset($res->sid)) {
  92. echo json_encode(array(
  93. "code" => 200,
  94. "msg" => "",
  95. "result" => array(
  96. "domain" => $res->domain,
  97. "title" => $res->title,
  98. "stype" => $res->stype == 1 ? "企业单位" : "个人",
  99. "auth_version" => $res->auth_version,
  100. "auth_at" => date("Y-m-d", $res->auth_at),
  101. "core" => $core_info,
  102. ),
  103. ));
  104. }
  105. }
  106. } elseif ($dopost == 'get_statistics') {
  107. require_once(DEDEINC."/libraries/statistics.class.php");
  108. //获取统计信息
  109. $sdate = empty($sdate) ? 0 : intval($sdate);
  110. $stat = new DedeStatistics;
  111. $rs = $stat->GetInfoByDate($sdate);
  112. echo json_encode(array(
  113. "code" => 200,
  114. "msg" => "",
  115. "result" => $rs,
  116. ));
  117. exit;
  118. } elseif ($dopost == 'get_statistics_multi') {
  119. require_once(DEDEINC."/libraries/statistics.class.php");
  120. //获取统计信息
  121. $sdates = empty($sdates) ? array() : explode(",",preg_replace("[^\d\,]","",$sdates)) ;
  122. $stat = new DedeStatistics;
  123. $rs = $stat->GetInfoByDateMulti($sdates);
  124. echo json_encode(array(
  125. "code" => 200,
  126. "msg" => "",
  127. "result" => $rs,
  128. ));
  129. exit;
  130. } elseif ($dopost == 'safe_mode') {
  131. $safemsg = "系统运行模式为安全模式,模板管理、标签管理、数据库管理、模块管理等功能已暂停,如果您需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值TRUE修改为FALSE恢复使用";
  132. $unsafemsg = "系统运行模式为开发模式,模板管理、标签管理、数据库管理、模块管理等功能已恢复,如果您不需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值FALSE修改为TRUE暂停使用";
  133. $modeStr = DEDEBIZ_SAFE_MODE? $safemsg : $unsafemsg;
  134. ShowMsg($modeStr, "javascript:;");
  135. exit;
  136. }
  137. ?>