国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
8.5KB

  1. <?php
  2. /**
  3. * 管理后台首页主体
  4. *
  5. * @version $Id: index_body.php 1 11:06 2010年7月13日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.com
  10. */
  11. require(dirname(__FILE__) . '/config.php');
  12. require(DEDEINC . '/image.func.php');
  13. require(DEDEINC . '/dedetag.class.php');
  14. $defaultIcoFile = DEDEDATA . '/admin/quickmenu.txt';
  15. $myIcoFile = DEDEDATA . '/admin/quickmenu-' . $cuserLogin->getUserID() . '.txt';
  16. if (!file_exists($myIcoFile)) $myIcoFile = $defaultIcoFile;
  17. //默认主页
  18. if (empty($dopost)) {
  19. require(DEDEINC . '/inc/inc_fun_funAdmin.php');
  20. $verLockFile = DEDEDATA . '/admin/ver.txt';
  21. $fp = fopen($verLockFile, 'r');
  22. $upTime = trim(fread($fp, 64));
  23. fclose($fp);
  24. $oktime = substr($upTime, 0, 4) . '-' . substr($upTime, 4, 2) . '-' . substr($upTime, 6, 2);
  25. $offUrl = SpGetNewInfo();
  26. $dedecmsidc = DEDEDATA . '/admin/idc.txt';
  27. $fp = fopen($dedecmsidc, 'r');
  28. $dedeIDC = fread($fp, filesize($dedecmsidc));
  29. fclose($fp);
  30. include DedeInclude('templets/index_body.htm');
  31. exit();
  32. }
  33. /*-----------------------
  34. 增加新项
  35. function _AddNew() { }
  36. -------------------------*/
  37. else if ($dopost == 'addnew') {
  38. if (empty($link) || empty($title)) {
  39. ShowMsg("链接网址或标题不能为空!", "-1");
  40. exit();
  41. }
  42. $fp = fopen($myIcoFile, 'r');
  43. $oldct = trim(fread($fp, filesize($myIcoFile)));
  44. fclose($fp);
  45. $link = preg_replace("#['\"]#", '`', $link);
  46. $title = preg_replace("#['\"]#", '`', $title);
  47. $ico = preg_replace("#['\"]#", '`', $ico);
  48. $oldct .= "\r\n<menu:item ico=\"{$ico}\" link=\"{$link}\" title=\"{$title}\" />";
  49. $myIcoFileTrue = DEDEDATA . '/admin/quickmenu-' . $cuserLogin->getUserID() . '.txt';
  50. $fp = fopen($myIcoFileTrue, 'w');
  51. fwrite($fp, $oldct);
  52. fclose($fp);
  53. ShowMsg("成功增加一个项目!", "index_body.php?" . time());
  54. exit();
  55. }
  56. /*---------------------------
  57. 保存修改的项
  58. function _EditSave() { }
  59. ----------------------------*/
  60. else if ($dopost == 'editsave') {
  61. $quickmenu = stripslashes($quickmenu);
  62. $myIcoFileTrue = DEDEDATA . '/admin/quickmenu-' . $cuserLogin->getUserID() . '.txt';
  63. $fp = fopen($myIcoFileTrue, 'w');
  64. fwrite($fp, $quickmenu);
  65. fclose($fp);
  66. ShowMsg("成功修改快捷操作项目!", "index_body.php?" . time());
  67. exit();
  68. }
  69. /*---------------------------
  70. 保存修改的项
  71. function _EditSave() { }
  72. ----------------------------*/
  73. else if ($dopost == 'movesave') {
  74. $movedata = str_replace('\\', "", $sortorder);
  75. $movedata = json_decode($movedata, TRUE);
  76. $movedata = serialize($movedata);
  77. $myIcoFileTrue = DEDEDATA . '/admin/move-' . $cuserLogin->getUserID() . '.txt';
  78. $fp = fopen($myIcoFileTrue, 'w');
  79. fwrite($fp, $movedata);
  80. fclose($fp);
  81. }
  82. /*-----------------------------
  83. 显示修改表单
  84. function _EditShow() { }
  85. -----------------------------*/
  86. else if ($dopost == 'editshow') {
  87. $fp = fopen($myIcoFile, 'r');
  88. $oldct = trim(fread($fp, filesize($myIcoFile)));
  89. fclose($fp);
  90. ?>
  91. <form name='editform' action='index_body.php' method='post'>
  92. <input type='hidden' name='dopost' value='editsave' />
  93. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  94. <tr>
  95. <td height='28' background="images/tbg.gif">
  96. <div style='float:left'><b>修改快捷操作项</b></div>
  97. <div style='float:right;padding:3px 10px 0 0;'>
  98. <a href="javascript:CloseTab('editTab')"><img src="images/close.gif" width="12" height="12" border="0" /></a>
  99. </div>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td style="height:6px;font-size:1px;border-top:1px solid #8DA659">&nbsp;</td>
  104. </tr>
  105. <tr>
  106. <td>
  107. 按原格式修改/增加XML项。
  108. </td>
  109. </tr>
  110. <tr>
  111. <td align='center'>
  112. <textarea name="quickmenu" rows="10" cols="50" style="width:94%;height:220px"><?php echo $oldct; ?></textarea>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td height="45" align="center">
  117. <input type="submit" name="Submit" value="保存项目" class="np coolbg" style="width:80px;cursor:pointer" />
  118. &nbsp;
  119. <input type="reset" name="reset" value="重设" class="np coolbg" style="width:50px;cursor:pointer" />
  120. </td>
  121. </tr>
  122. </table>
  123. </form>
  124. <?php
  125. exit();
  126. }
  127. /*---------------------------------
  128. 载入右边内容
  129. function _getRightSide() { }
  130. ---------------------------------*/
  131. else if ($dopost == 'getRightSide') {
  132. $query = " SELECT COUNT(*) AS dd FROM `#@__member` ";
  133. $row1 = $dsql->GetOne($query);
  134. $query = " SELECT COUNT(*) AS dd FROM `#@__feedback` ";
  135. $row2 = $dsql->GetOne($query);
  136. $chArrNames = array();
  137. $query = "SELECT id, typename FROM `#@__channeltype` ";
  138. $dsql->Execute('c', $query);
  139. while ($row = $dsql->GetArray('c')) {
  140. $chArrNames[$row['id']] = $row['typename'];
  141. }
  142. $query = "SELECT COUNT(channel) AS dd, channel FROM `#@__arctiny` GROUP BY channel ";
  143. $allArc = 0;
  144. $chArr = array();
  145. $dsql->Execute('a', $query);
  146. while ($row = $dsql->GetArray('a')) {
  147. $allArc += $row['dd'];
  148. $row['typename'] = $chArrNames[$row['channel']];
  149. $chArr[] = $row;
  150. }
  151. ?>
  152. <table width="100%" class="table table-borderless">
  153. <tr>
  154. <td width='50%' class='nline' style="text-align:left"> 会员数: </td>
  155. <td class='nline' style="text-align:left"> <?php echo $row1['dd']; ?> </td>
  156. </tr>
  157. <tr>
  158. <td class='nline' style="text-align:left"> 文档数: </td>
  159. <td class='nline' style="text-align:left"> <?php echo $allArc; ?> </td>
  160. </tr>
  161. <?php
  162. foreach ($chArr as $row) {
  163. ?>
  164. <tr>
  165. <td class='nline' style="text-align:left"> <?php echo $row['typename']; ?>: </td>
  166. <td class='nline' style="text-align:left"> <?php echo $row['dd']; ?>&nbsp; </td>
  167. </tr>
  168. <?php
  169. }
  170. ?>
  171. <tr>
  172. <td style="text-align:left"> 评论数: </td>
  173. <td style="text-align:left"> <?php echo $row2['dd']; ?> </td>
  174. </tr>
  175. </table>
  176. <?php
  177. exit();
  178. } else if ($dopost == 'getRightSideNews') {
  179. $query = "SELECT arc.id, arc.arcrank, arc.title, arc.channel, ch.editcon FROM `#@__archives` arc
  180. LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel
  181. WHERE arc.arcrank<>-2 ORDER BY arc.id DESC LIMIT 0, 6 ";
  182. $arcArr = array();
  183. $dsql->Execute('m', $query);
  184. while ($row = $dsql->GetArray('m')) {
  185. $arcArr[] = $row;
  186. }
  187. AjaxHead();
  188. ?>
  189. <table width="100%" class="table table-borderless">
  190. <?php
  191. foreach ($arcArr as $row) {
  192. if (trim($row['editcon']) == '') {
  193. $row['editcon'] = 'archives_edit.php';
  194. }
  195. $linkstr = "·<a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a>";
  196. if ($row['arcrank'] == -1) $linkstr .= "<font color='red'>(未审核)</font>";
  197. ?>
  198. <tr>
  199. <td class='nline'>
  200. <?php echo $linkstr; ?>
  201. </td>
  202. </tr>
  203. <?php
  204. }
  205. ?>
  206. </table>
  207. <?php
  208. exit;
  209. } else if ($dopost == 'showauth') {
  210. include('templets/index_body_showauth.htm');
  211. exit;
  212. } else if ($dopost == 'showad') {
  213. include('templets/index_body_showad.htm');
  214. exit;
  215. } else if ($dopost == 'setskin') {
  216. $cskin = empty($cskin) ? 1 : $cskin;
  217. $skin = !in_array($cskin, array(1, 2, 3, 4)) ? 1 : $cskin;
  218. $skinconfig = DEDEDATA . '/admin/skin.txt';
  219. PutFile($skinconfig, $skin);
  220. } elseif ($dopost == 'get_seo') {
  221. // 直接采用DedeBIZ重写方法
  222. exit;
  223. } elseif ($dopost == "system_info") {
  224. $client = new DedeBizClient('127.0.0.1', 8181);
  225. $client->appid = "1008665";
  226. $client->key = "I04NcaYUCmRukRDE";
  227. $rs = $client->SystemInfo();
  228. if ($rs->code === 200) {
  229. echo $rs->data;
  230. exit;
  231. }
  232. $client->Close();
  233. }
  234. ?>