国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

123 satır
4.1KB

  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. 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? "&nbsp;<span class='text-danger'>[未审核]</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. }
  63. ?>
  64. </table>
  65. <?php
  66. exit;
  67. } elseif ($dopost == "system_info") {
  68. if (!extension_loaded("openssl")) {
  69. echo json_encode(array(
  70. "code" => -1001,
  71. "msg" => "PHP不支持OpenSSL,无法完成商业版授权",
  72. "result" => null,
  73. ));
  74. exit;
  75. }
  76. if (empty($cfg_auth_code)) {
  77. echo json_encode(array(
  78. "code" => -1002,
  79. "msg" => "当前站点尚未升级商业版授权",
  80. "result" => null,
  81. ));
  82. exit;
  83. }
  84. openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
  85. $core_info = new stdClass;
  86. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  87. $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
  88. $client->appid = $cfg_bizcore_appid;
  89. $client->key = $cfg_bizcore_key;
  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. }
  123. ?>