国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

165 líneas
6.7KB

  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 GNU GPL v2 (https://www.dedebiz.com/license)
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__).'/config.php');
  12. require_once(DEDEINC.'/image.func.php');
  13. require_once(DEDEINC.'/dedetag.class.php');
  14. if (empty($dopost)) {
  15. require_once(DEDEINC.'/inc/inc_fun_funAdmin.php');
  16. $verLockFile = DEDEDATA.'/admin/ver.txt';
  17. $fp = fopen($verLockFile, 'r');
  18. $upTime = trim(fread($fp, 64));
  19. fclose($fp);
  20. $oktime = substr($upTime, 0, 4).'-'.substr($upTime, 4, 2).'-'.substr($upTime, 6, 2);
  21. $offUrl = SpGetNewInfo();
  22. include DedeInclude('templets/index_body.htm');
  23. exit();
  24. } else if ($dopost == 'setskin') {
  25. $cskin = empty($cskin) ? 1 : $cskin;
  26. $skin = !in_array($cskin, array(1, 2, 3, 4)) ? 1 : $cskin;
  27. $skinconfig = DEDEDATA.'/admin/skin.txt';
  28. PutFile($skinconfig, $skin);
  29. } elseif ($dopost == 'get_seo') {
  30. //直接采用DedeBIZ重写方法
  31. exit;
  32. } elseif ($dopost == 'get_articles') {
  33. ?>
  34. <div class="table-responsive">
  35. <table class="table table-borderless">
  36. <tbody>
  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,10";
  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 ? '待审核' : '已审核';
  59. $pubdate = GetDateMk($row['pubdate']);
  60. $row['title'] = cn_substr($row['title'], 40);
  61. echo "<tr><td><a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a></td><td width='70'>{$rowarcrank}</td><td width='110'>{$pubdate}</td></tr>";
  62. }
  63. ?>
  64. </tbody>
  65. </table>
  66. </div>
  67. <?php }?>
  68. <?php
  69. exit;
  70. } elseif ($dopost == "system_info") {
  71. if (empty(trim($cfg_auth_code))) {
  72. $indexHTML = '';
  73. if (file_exists(DEDEROOT."/index.html")) {
  74. $indexHTML = file_get_contents(DEDEROOT."/index.html");
  75. } else {
  76. $row = $dsql->GetOne("SELECT * FROM `#@__homepageset`");
  77. $row['templet'] = MfTemplet($row['templet']);
  78. $pv = new PartView();
  79. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$row['templet']);
  80. $row['showmod'] = isset($row['showmod']) ? $row['showmod'] : 0;
  81. if ($row['showmod'] == 0) {
  82. ob_start();
  83. $pv->Display();
  84. $indexHTML = ob_get_contents();
  85. ob_end_clean();
  86. }
  87. }
  88. $pattern = '/<a\s[^>]*href=["\']?([^"\'>\s]*)["\']?[^>]*>/is';
  89. preg_match_all($pattern, $indexHTML, $matches);
  90. $hasPowered = false;
  91. foreach ($matches[1] as $href) {
  92. if (preg_match("#^https://www.dedebiz.com#",$href)) {
  93. $hasPowered = true;
  94. }
  95. }
  96. $poweredStr = $hasPowered ? "" : "请保留<a href='https://www.dedebiz.com/powered_by_dedebiz' class='text-success'>底部版权信息</a>,";
  97. echo json_encode(array(
  98. "code" => -1002,
  99. "msg" => "站点已授权社区版,{$poweredStr}更多官方技术支持,请选择<a href='https://www.dedebiz.com/auth' class='text-success'>商业版</a>",
  100. "result" => null,
  101. ));
  102. exit;
  103. }
  104. if (!extension_loaded("openssl")) {
  105. echo json_encode(array(
  106. "code" => -1001,
  107. "msg" => "PHP不支持OpenSSL,无法完成商业版授权",
  108. "result" => null,
  109. ));
  110. exit;
  111. }
  112. openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
  113. $core_info = new stdClass;
  114. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  115. $client = new DedeBizClient();
  116. $core_info = $client->SystemInfo();
  117. $client->Close();
  118. }
  119. if (!empty($decotent)) {
  120. $res = json_decode($decotent);
  121. if (isset($res->sid)) {
  122. echo json_encode(array(
  123. "code" => 200,
  124. "msg" => "",
  125. "result" => array(
  126. "domain" => $res->domain,
  127. "title" => $res->title,
  128. "stype" => $res->stype == 1 ? "企业" : "个人",
  129. "auth_version" => $res->auth_version,
  130. "auth_at" => date("Y-m-d", $res->auth_at),
  131. "core" => $core_info,
  132. ),
  133. ));
  134. }
  135. }
  136. } elseif ($dopost == 'get_statistics') {
  137. require_once(DEDEINC."/libraries/statistics.class.php");
  138. $sdate = empty($sdate) ? 0 : intval($sdate);
  139. $stat = new DedeStatistics;
  140. $rs = $stat->GetInfoByDate($sdate);
  141. echo json_encode(array(
  142. "code" => 200,
  143. "msg" => "",
  144. "result" => $rs,
  145. ));
  146. exit;
  147. } elseif ($dopost == 'get_statistics_multi') {
  148. require_once(DEDEINC."/libraries/statistics.class.php");
  149. $sdates = empty($sdates) ? array() : explode(",",preg_replace("[^\d\,]","",$sdates)) ;
  150. $stat = new DedeStatistics;
  151. $rs = $stat->GetInfoByDateMulti($sdates);
  152. echo json_encode(array(
  153. "code" => 200,
  154. "msg" => "",
  155. "result" => $rs,
  156. ));
  157. exit;
  158. } elseif ($dopost == 'safe_mode') {
  159. $safemsg = "系统运行模式为安全模式,模板管理、标签管理、数据库管理、模块管理等功能已暂停,如果您需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值TRUE修改为FALSE恢复使用";
  160. $unsafemsg = "系统运行模式为开发模式,模板管理、标签管理、数据库管理、模块管理等功能已恢复,如果您不需要这些功能,在/system/common.inc.php文件大约第10行代码找到DEDEBIZ_SAFE_MODE后面值FALSE修改为TRUE暂停使用";
  161. $modeStr = DEDEBIZ_SAFE_MODE? $safemsg : $unsafemsg;
  162. ShowMsg($modeStr, "javascript:;");
  163. exit;
  164. }
  165. ?>