国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

127 строки
4.3KB

  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. else if ($dopost == 'setskin') {
  31. $cskin = empty($cskin) ? 1 : $cskin;
  32. $skin = !in_array($cskin, array(1, 2, 3, 4)) ? 1 : $cskin;
  33. $skinconfig = DEDEDATA.'/admin/skin.txt';
  34. PutFile($skinconfig, $skin);
  35. } elseif ($dopost == 'get_seo') {
  36. //直接采用DedeBIZ重写方法
  37. exit;
  38. } elseif($dopost == 'get_articles'){
  39. ?>
  40. <table width="100%" class="table table-borderless">
  41. <?php
  42. $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";
  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) > 1)
  52. {
  53. foreach($arcArr as $row)
  54. {
  55. if(trim($row['editcon'])==''){
  56. $row['editcon'] = 'archives_edit.php';
  57. }
  58. $rowarcrank = $row['arcrank']==-1? "&nbsp;<sapn class='btn btn-success btn-sm'>[未审核]</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">暂无文档</td></tr>
  65. <?php
  66. }
  67. ?>
  68. </table>
  69. <?php
  70. exit;
  71. } elseif ($dopost == "system_info") {
  72. if (!extension_loaded("openssl")) {
  73. echo json_encode(array(
  74. "code" => -1001,
  75. "msg" => "PHP不支持OpenSSL,无法完成商业版授权",
  76. "result" => null,
  77. ));
  78. exit;
  79. }
  80. if (empty($cfg_auth_code)) {
  81. echo json_encode(array(
  82. "code" => -1002,
  83. "msg" => "当前站点尚未升级商业版授权",
  84. "result" => null,
  85. ));
  86. exit;
  87. }
  88. openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
  89. $core_info = new stdClass;
  90. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  91. $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
  92. $client->appid = $cfg_bizcore_appid;
  93. $client->key = $cfg_bizcore_key;
  94. $core_info = $client->SystemInfo();
  95. $client->Close();
  96. }
  97. if (!empty($decotent)) {
  98. $res = json_decode($decotent);
  99. if (isset($res->sid)) {
  100. echo json_encode(array(
  101. "code" => 200,
  102. "msg" => "",
  103. "result" => array(
  104. "domain" => $res->domain,
  105. "title" => $res->title,
  106. "stype" => $res->stype == 1 ? "企业单位" : "个人",
  107. "auth_version" => $res->auth_version,
  108. "auth_at" => date("Y-m-d", $res->auth_at),
  109. "core" => $core_info,
  110. ),
  111. ));
  112. }
  113. }
  114. } elseif ($dopost == 'get_statistics') {
  115. require_once(DEDEINC."/libraries/statistics.class.php");
  116. //获取统计信息
  117. $sdate = empty($sdate) ? 0 : intval($sdate);
  118. $stat = new DedeStatistics;
  119. $rs = $stat->GetInfoByDate($sdate);
  120. echo json_encode(array(
  121. "code" => 200,
  122. "msg" => "",
  123. "result" => $rs,
  124. ));
  125. exit;
  126. }
  127. ?>