国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

174 lines
5.9KB

  1. <?php
  2. /**
  3. * 管理后台首页主体
  4. *
  5. * @version $Id: index_body.php 1 11:06 2010年7月13日Z 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. $dedecmsidc = DEDEDATA.'/admin/idc.txt';
  24. $fp = fopen($dedecmsidc, 'r');
  25. $dedeIDC = fread($fp, filesize($dedecmsidc));
  26. fclose($fp);
  27. include DedeInclude('templets/index_body.htm');
  28. exit();
  29. }
  30. /*---------------------------------
  31. 载入右边内容
  32. function _getRightSide() { }
  33. ---------------------------------*/
  34. else if ($dopost == 'getRightSide') {
  35. $query = " SELECT COUNT(*) AS dd FROM `#@__member` ";
  36. $row1 = $dsql->GetOne($query);
  37. $query = " SELECT COUNT(*) AS dd FROM `#@__feedback` ";
  38. $row2 = $dsql->GetOne($query);
  39. $chArrNames = array();
  40. $query = "SELECT id, typename FROM `#@__channeltype` ";
  41. $dsql->Execute('c', $query);
  42. while ($row = $dsql->GetArray('c')) {
  43. $chArrNames[$row['id']] = $row['typename'];
  44. }
  45. $query = "SELECT COUNT(channel) AS dd, channel FROM `#@__arctiny` GROUP BY channel ";
  46. $allArc = 0;
  47. $chArr = array();
  48. $dsql->Execute('a', $query);
  49. while ($row = $dsql->GetArray('a')) {
  50. $allArc += $row['dd'];
  51. $row['typename'] = $chArrNames[$row['channel']];
  52. $chArr[] = $row;
  53. }
  54. ?>
  55. <table width="100%" class="table table-borderless">
  56. <tr>
  57. <td class="nline" style="width:50%;text-align:left">会员数:</td>
  58. <td class="nline" style="text-align:left"><?php echo $row1['dd']; ?></td>
  59. </tr>
  60. <tr>
  61. <td class="nline" style="text-align:left">文档数:</td>
  62. <td class="nline" style="text-align:left"><?php echo $allArc; ?></td>
  63. </tr>
  64. <?php
  65. foreach ($chArr as $row) {
  66. ?>
  67. <tr>
  68. <td class="nline" style="text-align:left"><?php echo $row['typename']; ?>:</td>
  69. <td class="nline" style="text-align:left"><?php echo $row['dd']; ?></td>
  70. </tr>
  71. <?php
  72. }
  73. ?>
  74. <tr>
  75. <td style="text-align:left">评论数:</td>
  76. <td style="text-align:left"><?php echo $row2['dd']; ?></td>
  77. </tr>
  78. </table>
  79. <?php
  80. exit();
  81. } else if ($dopost == 'getRightSideNews') {
  82. $query = "SELECT arc.id, arc.arcrank, arc.title, arc.channel, ch.editcon FROM `#@__archives` arc
  83. LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel
  84. WHERE arc.arcrank<>-2 ORDER BY arc.id DESC LIMIT 0, 6 ";
  85. $arcArr = array();
  86. $dsql->Execute('m', $query);
  87. while ($row = $dsql->GetArray('m')) {
  88. $arcArr[] = $row;
  89. }
  90. AjaxHead();
  91. ?>
  92. <table width="100%" class="table table-borderless">
  93. <?php
  94. foreach ($arcArr as $row) {
  95. if (trim($row['editcon']) == '') {
  96. $row['editcon'] = 'archives_edit.php';
  97. }
  98. $linkstr = "·<a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a>";
  99. if ($row['arcrank'] == -1) $linkstr .= "<span style='color:#dc3545'>(未审核)</span>";
  100. ?>
  101. <tr>
  102. <td class="nline"><?php echo $linkstr; ?></td>
  103. </tr>
  104. <?php
  105. }
  106. ?>
  107. </table>
  108. <?php
  109. exit;
  110. } else if ($dopost == 'setskin') {
  111. $cskin = empty($cskin) ? 1 : $cskin;
  112. $skin = !in_array($cskin, array(1, 2, 3, 4)) ? 1 : $cskin;
  113. $skinconfig = DEDEDATA.'/admin/skin.txt';
  114. PutFile($skinconfig, $skin);
  115. } elseif ($dopost == 'get_seo') {
  116. //直接采用DedeBIZ重写方法
  117. exit;
  118. } elseif ($dopost == "system_info") {
  119. if (!extension_loaded("openssl")) {
  120. echo json_encode(array(
  121. "code" => -1001,
  122. "msg" => "PHP不支持OpenSSL,无法完成商业版授权",
  123. "result" => null,
  124. ));
  125. exit;
  126. }
  127. if (empty($cfg_auth_code)) {
  128. echo json_encode(array(
  129. "code" => -1002,
  130. "msg" => "当前站点尚未购买商业版授权",
  131. "result" => null,
  132. ));
  133. exit;
  134. }
  135. openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
  136. $core_info = new stdClass;
  137. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  138. $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
  139. $client->appid = $cfg_bizcore_appid;
  140. $client->key = $cfg_bizcore_key;
  141. $core_info = $client->SystemInfo();
  142. $client->Close();
  143. }
  144. if (!empty($decotent)) {
  145. $res = json_decode($decotent);
  146. if (isset($res->sid)) {
  147. echo json_encode(array(
  148. "code" => 200,
  149. "msg" => "",
  150. "result" => array(
  151. "domain" => $res->domain,
  152. "title" => $res->title,
  153. "stype" => $res->stype == 1 ? "企业单位" : "个人",
  154. "auth_version" => $res->auth_version,
  155. "auth_at" => date("Y-m-d", $res->auth_at),
  156. "core" => $core_info,
  157. ),
  158. ));
  159. }
  160. }
  161. } elseif ($dopost == 'get_statistics') {
  162. require_once(DEDEINC."/libraries/statistics.class.php");
  163. //获取统计信息
  164. $sdate = empty($sdate) ? 0 : intval($sdate);
  165. $stat = new DedeStatistics;
  166. $rs = $stat->GetInfoByDate($sdate);
  167. echo json_encode(array(
  168. "code" => 200,
  169. "msg" => "",
  170. "result" => $rs,
  171. ));
  172. exit;
  173. }
  174. ?>