PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/php/xuzhou58/xuzhou58.com/dede/co_do.php

http://jqbird.googlecode.com/
PHP | 291 lines | 246 code | 9 blank | 36 comment | 33 complexity | b356754f9ca5979296263b94ba939130 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0, LGPL-2.1, GPL-2.0
  1. <?php
  2. require_once(dirname(__FILE__)."/config.php");
  3. require_once(DEDEINC."/oxwindow.class.php");
  4. if(!isset($nid))
  5. {
  6. $nid=0;
  7. }
  8. $ENV_GOBACK_URL = empty($_COOKIE["ENV_GOBACK_URL"]) ? "co_url.php" : $_COOKIE["ENV_GOBACK_URL"];
  9. //????
  10. //???????????????
  11. /*
  12. function co_delete()
  13. */
  14. if($dopost=="delete")
  15. {
  16. CheckPurview('co_Del');
  17. $nid = intval($nid);
  18. $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` where nid='$nid'");
  19. $dsql->ExecuteNoneQuery("Delete From `#@__co_note` where nid='$nid'");
  20. $dsql->ExecuteNoneQuery("Delete From `#@__co_urls` where nid='$nid'");
  21. ShowMsg("????????!","co_main.php");
  22. exit();
  23. }
  24. //??????
  25. //????????????????????????????????
  26. /*
  27. function url_clear()
  28. */
  29. else if($dopost=="clear")
  30. {
  31. CheckPurview('co_Del');
  32. if(!isset($ids))
  33. {
  34. $ids='';
  35. }
  36. if(empty($ids))
  37. {
  38. if(!empty($nid))
  39. {
  40. $nid = intval($nid);
  41. $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` where nid='$nid'");
  42. }
  43. ShowMsg("?????????????!","co_main.php");
  44. exit();
  45. }
  46. else
  47. {
  48. if(!empty($clshash))
  49. {
  50. $dsql->SetQuery("Select nid,url From `#@__co_htmls` where aid in($ids) ");
  51. $dsql->Execute();
  52. while($arr = $dsql->GetArray())
  53. {
  54. $nhash = md5($arr['url']);
  55. $nid = $row['nid'];
  56. $dsql->ExecuteNoneQuery("Delete From `#@__co_urls ` where nid='$nid' And hash='$nhash' ");
  57. }
  58. }
  59. $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` where aid in($ids) ");
  60. ShowMsg("???????????!",$ENV_GOBACK_URL);
  61. exit();
  62. }
  63. }
  64. else if($dopost=="clearct")
  65. {
  66. CheckPurview('co_Del');
  67. if(!empty($ids))
  68. {
  69. $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set isdown=0,result='' where aid in($ids) ");
  70. }
  71. ShowMsg("????????!",$ENV_GOBACK_URL);
  72. exit();
  73. }
  74. /*
  75. function url_clearall()
  76. */
  77. else if($dopost=="clearall")
  78. {
  79. CheckPurview('co_Del');
  80. $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` ");
  81. ShowMsg("?????????????!","co_main.php");
  82. exit();
  83. }
  84. //????
  85. /*
  86. function co_replace() { }
  87. */
  88. else if($dopost=="replace")
  89. {
  90. //if()
  91. //$nid $aid $regtype $fdstring $rpstring
  92. $rpstring = trim($rpstring);
  93. if($regtype=='string')
  94. {
  95. $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set `result`=REPLACE(`result`,'$fdstring','$rpstring') where nid='$nid' ");
  96. }
  97. else
  98. {
  99. //??????????????????
  100. if(empty($rpok))
  101. {
  102. $fdstring = stripslashes($fdstring);
  103. $rpstring = stripslashes($rpstring);
  104. $hiddenrpvalue = "<textarea name='fdstring' style='display:none'>{$fdstring}</textarea>\r\n<textarea name='rpstring' style='display:none'>{$rpstring}</textarea>\r\n";
  105. $fdstring = str_replace("\\/","#ASZZ#",$fdstring);
  106. $fdstring = str_replace('/',"\\/",$fdstring);
  107. $fdstring = str_replace('#ASZZ#',"\\/",$fdstring);
  108. $result = $rs = stripslashes($rs);
  109. if($fdstring!='')
  110. {
  111. $result = trim(preg_replace("/$fdstring/isU",$rpstring,$rs));
  112. }
  113. $wintitle = "????-????";
  114. $wecome_info = "<a href='co_main.php'>????</a>::????";
  115. $win = new OxWindow();
  116. $win->Init("co_do.php","js/blank.js","POST");
  117. $win->AddHidden('dopost',$dopost);
  118. $win->AddHidden('nid',$nid);
  119. $win->AddHidden('regtype','regex');
  120. $win->AddHidden('aid',$aid);
  121. $win->AddHidden('rpok','ok');
  122. $win->AddTitle("?????????????????????????????????????{$hiddenrpvalue}");
  123. $win->AddItem("??????","<textarea name='rs' style='width:90%;height:250px'>{$rs}</textarea>\r\n");
  124. $win->AddItem("??????????","<textarea name='okrs' style='width:90%;height:250px'>{$result}</textarea>\r\n");
  125. $winform = $win->GetWindow("ok");
  126. $win->Display();
  127. exit();
  128. }
  129. else
  130. {
  131. if($fdstring!='')
  132. {
  133. $dsql->SetQuery("Select `aid`,`result` From `#@__co_htmls` where nid='$nid' ");
  134. $dsql->Execute();
  135. while($row = $dsql->GetArray())
  136. {
  137. $fdstring = stripslashes($fdstring);
  138. $rpstring = stripslashes($rpstring);
  139. $fdstring = str_replace("\\/","#ASZZ#",$fdstring);
  140. $fdstring = str_replace('/',"\\/",$fdstring);
  141. $fdstring = str_replace('#ASZZ#',"\\/",$fdstring);
  142. $result = trim(preg_replace("/$fdstring/isU",$rpstring,$row['result']));
  143. $result = addslashes($result);
  144. $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set `result`='$result' where aid='{$row['aid']}' ");
  145. }
  146. }
  147. }
  148. }
  149. ShowMsg("?????????????","co_view.php?aid=$aid");
  150. exit();
  151. }
  152. //????
  153. /*
  154. function co_copy()
  155. */
  156. else if($dopost=="copy")
  157. {
  158. CheckPurview('co_AddNote');
  159. if(empty($mynotename))
  160. {
  161. $wintitle = "????-????";
  162. $wecome_info = "<a href='co_main.php'>????</a>::????";
  163. $win = new OxWindow();
  164. $win->Init("co_do.php","js/blank.js","POST");
  165. $win->AddHidden("dopost",$dopost);
  166. $win->AddHidden("nid",$nid);
  167. $win->AddTitle("?????????");
  168. $win->AddItem("??????","<input type='text' name='mynotename' value='' size='30' />");
  169. $winform = $win->GetWindow("ok");
  170. $win->Display();
  171. exit();
  172. }
  173. $row = $dsql->GetOne("Select * From `#@__co_note` where nid='$nid'");
  174. foreach($row as $k=>$v)
  175. {
  176. if(!isset($$k))
  177. {
  178. $$k = addslashes($v);
  179. }
  180. }
  181. $usemore = (empty($usemore) ? '0' : $usemore);
  182. $inQuery = " INSERT INTO `#@__co_note`(`channelid`,`notename`,`sourcelang`,`uptime`,`cotime`,`pnum`,`isok`,`listconfig`,`itemconfig`,`usemore`)
  183. VALUES ('$channelid','$mynotename','$sourcelang','".time()."','0','0','0','$listconfig','$itemconfig','$usemore'); ";
  184. $dsql->ExecuteNoneQuery($inQuery);
  185. ShowMsg("????????!",$ENV_GOBACK_URL);
  186. exit();
  187. }
  188. //??Rss?????
  189. /*-----------------------
  190. function co_testrss()
  191. -------------------------*/
  192. else if($dopost=="testrss")
  193. {
  194. CheckPurview('co_AddNote');
  195. $msg = '';
  196. if($rssurl=='')
  197. {
  198. $msg = '?????RSS???';
  199. }
  200. else
  201. {
  202. include(DEDEINC."/dedecollection.func.php");
  203. $arr = GetRssLinks($rssurl);
  204. $msg = "? {$rssurl} ??????<br />";
  205. $i=1;
  206. if(is_array($arr))
  207. {
  208. foreach($arr as $ar)
  209. {
  210. $msg .= "<hr size='1' />\r\n";
  211. $msg .= "link: {$ar['link']}<br />title: {$ar['title']}<br />image: {$ar['image']}\r\n";
  212. $i++;
  213. }
  214. }
  215. }
  216. $wintitle = "????-??";
  217. $wecome_info = "<a href='co_main.php'>????</a>::RSS????";
  218. $win = new OxWindow();
  219. $win->AddMsgItem($msg);
  220. $winform = $win->GetWindow("hand");
  221. $win->Display();
  222. exit();
  223. }
  224. //??????????
  225. /*-----------------------
  226. function co_testregx()
  227. -------------------------*/
  228. else if($dopost=="testregx")
  229. {
  230. CheckPurview('co_AddNote');
  231. $msg = '';
  232. if($regxurl=='')
  233. {
  234. $msg = '???????????';
  235. }
  236. else
  237. {
  238. include(DEDEINC."/dedecollection.func.php");
  239. $msg = "??????<br />";
  240. $lists = GetUrlFromListRule($regxurl,'',$startid,$endid,$addv);
  241. foreach($lists as $surl)
  242. {
  243. $msg .= $surl[0]."<br />\r\n";
  244. }
  245. }
  246. $wintitle = "????-??????";
  247. $wecome_info = "<a href='co_main.php'>????</a>::??????????";
  248. $win = new OxWindow();
  249. $win->AddMsgItem($msg);
  250. $winform = $win->GetWindow("hand");
  251. $win->Display();
  252. exit();
  253. }
  254. //???????
  255. /*--------------------
  256. function co_all()
  257. ---------------------*/
  258. else if($dopost=="coall")
  259. {
  260. CheckPurview('co_PlayNote');
  261. $mrow = $dsql->GetOne("Select count(*) as dd From `#@__co_htmls` ");
  262. $totalnum = $mrow['dd'];
  263. if($totalnum==0)
  264. {
  265. ShowMsg("??????????","-1");
  266. exit();
  267. }
  268. $wintitle = "????-???????";
  269. $wecome_info = "<a href='co_main.php'>????</a>::???????";
  270. $win = new OxWindow();
  271. $win->Init("co_gather_start_action.php","js/blank.js","GET");
  272. $win->AddHidden('startdd','0');
  273. $win->AddHidden('pagesize','5');
  274. $win->AddHidden('sptime','0');
  275. $win->AddHidden('nid','0');
  276. $win->AddHidden('totalnum',$totalnum);
  277. $win->AddMsgItem("?????????‘<a href='co_url.php'><u>????</u></a>’???????????????");
  278. $winform = $win->GetWindow("ok");
  279. $win->Display();
  280. exit();
  281. }
  282. ?>