/php/xuzhou58/xuzhou58.com/dede/co_do.php
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
- <?php
- require_once(dirname(__FILE__)."/config.php");
- require_once(DEDEINC."/oxwindow.class.php");
- if(!isset($nid))
- {
- $nid=0;
- }
- $ENV_GOBACK_URL = empty($_COOKIE["ENV_GOBACK_URL"]) ? "co_url.php" : $_COOKIE["ENV_GOBACK_URL"];
-
- //????
- //???????????????
- /*
- function co_delete()
- */
- if($dopost=="delete")
- {
- CheckPurview('co_Del');
- $nid = intval($nid);
- $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` where nid='$nid'");
- $dsql->ExecuteNoneQuery("Delete From `#@__co_note` where nid='$nid'");
- $dsql->ExecuteNoneQuery("Delete From `#@__co_urls` where nid='$nid'");
- ShowMsg("????????!","co_main.php");
- exit();
- }
-
- //??????
- //????????????????????????????????
- /*
- function url_clear()
- */
- else if($dopost=="clear")
- {
- CheckPurview('co_Del');
- if(!isset($ids))
- {
- $ids='';
- }
- if(empty($ids))
- {
- if(!empty($nid))
- {
- $nid = intval($nid);
- $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` where nid='$nid'");
- }
- ShowMsg("?????????????!","co_main.php");
- exit();
- }
- else
- {
- if(!empty($clshash))
- {
- $dsql->SetQuery("Select nid,url From `#@__co_htmls` where aid in($ids) ");
- $dsql->Execute();
- while($arr = $dsql->GetArray())
- {
- $nhash = md5($arr['url']);
- $nid = $row['nid'];
- $dsql->ExecuteNoneQuery("Delete From `#@__co_urls ` where nid='$nid' And hash='$nhash' ");
- }
- }
- $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` where aid in($ids) ");
- ShowMsg("???????????!",$ENV_GOBACK_URL);
- exit();
- }
- }
- else if($dopost=="clearct")
- {
- CheckPurview('co_Del');
- if(!empty($ids))
- {
- $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set isdown=0,result='' where aid in($ids) ");
- }
- ShowMsg("????????!",$ENV_GOBACK_URL);
- exit();
- }
-
- /*
- function url_clearall()
- */
- else if($dopost=="clearall")
- {
- CheckPurview('co_Del');
- $dsql->ExecuteNoneQuery("Delete From `#@__co_htmls` ");
- ShowMsg("?????????????!","co_main.php");
- exit();
- }
-
- //????
- /*
- function co_replace() { }
- */
- else if($dopost=="replace")
- {
- //if()
- //$nid $aid $regtype $fdstring $rpstring
- $rpstring = trim($rpstring);
- if($regtype=='string')
- {
- $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set `result`=REPLACE(`result`,'$fdstring','$rpstring') where nid='$nid' ");
- }
- else
- {
- //??????????????????
- if(empty($rpok))
- {
- $fdstring = stripslashes($fdstring);
- $rpstring = stripslashes($rpstring);
- $hiddenrpvalue = "<textarea name='fdstring' style='display:none'>{$fdstring}</textarea>\r\n<textarea name='rpstring' style='display:none'>{$rpstring}</textarea>\r\n";
- $fdstring = str_replace("\\/","#ASZZ#",$fdstring);
- $fdstring = str_replace('/',"\\/",$fdstring);
- $fdstring = str_replace('#ASZZ#',"\\/",$fdstring);
- $result = $rs = stripslashes($rs);
- if($fdstring!='')
- {
- $result = trim(preg_replace("/$fdstring/isU",$rpstring,$rs));
- }
- $wintitle = "????-????";
- $wecome_info = "<a href='co_main.php'>????</a>::????";
- $win = new OxWindow();
- $win->Init("co_do.php","js/blank.js","POST");
- $win->AddHidden('dopost',$dopost);
- $win->AddHidden('nid',$nid);
- $win->AddHidden('regtype','regex');
- $win->AddHidden('aid',$aid);
- $win->AddHidden('rpok','ok');
- $win->AddTitle("?????????????????????????????????????{$hiddenrpvalue}");
- $win->AddItem("??????","<textarea name='rs' style='width:90%;height:250px'>{$rs}</textarea>\r\n");
- $win->AddItem("??????????","<textarea name='okrs' style='width:90%;height:250px'>{$result}</textarea>\r\n");
- $winform = $win->GetWindow("ok");
- $win->Display();
- exit();
- }
- else
- {
- if($fdstring!='')
- {
- $dsql->SetQuery("Select `aid`,`result` From `#@__co_htmls` where nid='$nid' ");
- $dsql->Execute();
- while($row = $dsql->GetArray())
- {
- $fdstring = stripslashes($fdstring);
- $rpstring = stripslashes($rpstring);
- $fdstring = str_replace("\\/","#ASZZ#",$fdstring);
- $fdstring = str_replace('/',"\\/",$fdstring);
- $fdstring = str_replace('#ASZZ#',"\\/",$fdstring);
- $result = trim(preg_replace("/$fdstring/isU",$rpstring,$row['result']));
- $result = addslashes($result);
- $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set `result`='$result' where aid='{$row['aid']}' ");
- }
- }
- }
- }
- ShowMsg("?????????????","co_view.php?aid=$aid");
- exit();
- }
-
- //????
- /*
- function co_copy()
- */
- else if($dopost=="copy")
- {
- CheckPurview('co_AddNote');
- if(empty($mynotename))
- {
- $wintitle = "????-????";
- $wecome_info = "<a href='co_main.php'>????</a>::????";
- $win = new OxWindow();
- $win->Init("co_do.php","js/blank.js","POST");
- $win->AddHidden("dopost",$dopost);
- $win->AddHidden("nid",$nid);
- $win->AddTitle("?????????");
- $win->AddItem("??????","<input type='text' name='mynotename' value='' size='30' />");
- $winform = $win->GetWindow("ok");
- $win->Display();
- exit();
- }
- $row = $dsql->GetOne("Select * From `#@__co_note` where nid='$nid'");
- foreach($row as $k=>$v)
- {
- if(!isset($$k))
- {
- $$k = addslashes($v);
- }
- }
- $usemore = (empty($usemore) ? '0' : $usemore);
- $inQuery = " INSERT INTO `#@__co_note`(`channelid`,`notename`,`sourcelang`,`uptime`,`cotime`,`pnum`,`isok`,`listconfig`,`itemconfig`,`usemore`)
- VALUES ('$channelid','$mynotename','$sourcelang','".time()."','0','0','0','$listconfig','$itemconfig','$usemore'); ";
- $dsql->ExecuteNoneQuery($inQuery);
- ShowMsg("????????!",$ENV_GOBACK_URL);
- exit();
- }
-
- //??Rss?????
- /*-----------------------
- function co_testrss()
- -------------------------*/
- else if($dopost=="testrss")
- {
- CheckPurview('co_AddNote');
- $msg = '';
- if($rssurl=='')
- {
- $msg = '?????RSS???';
- }
- else
- {
- include(DEDEINC."/dedecollection.func.php");
- $arr = GetRssLinks($rssurl);
- $msg = "? {$rssurl} ??????<br />";
- $i=1;
- if(is_array($arr))
- {
- foreach($arr as $ar)
- {
- $msg .= "<hr size='1' />\r\n";
- $msg .= "link: {$ar['link']}<br />title: {$ar['title']}<br />image: {$ar['image']}\r\n";
- $i++;
- }
- }
- }
- $wintitle = "????-??";
- $wecome_info = "<a href='co_main.php'>????</a>::RSS????";
- $win = new OxWindow();
- $win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand");
- $win->Display();
- exit();
- }
-
- //??????????
- /*-----------------------
- function co_testregx()
- -------------------------*/
- else if($dopost=="testregx")
- {
- CheckPurview('co_AddNote');
- $msg = '';
- if($regxurl=='')
- {
- $msg = '???????????';
- }
- else
- {
- include(DEDEINC."/dedecollection.func.php");
- $msg = "??????<br />";
- $lists = GetUrlFromListRule($regxurl,'',$startid,$endid,$addv);
- foreach($lists as $surl)
- {
- $msg .= $surl[0]."<br />\r\n";
- }
- }
- $wintitle = "????-??????";
- $wecome_info = "<a href='co_main.php'>????</a>::??????????";
- $win = new OxWindow();
- $win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand");
- $win->Display();
- exit();
- }
-
- //???????
- /*--------------------
- function co_all()
- ---------------------*/
- else if($dopost=="coall")
- {
- CheckPurview('co_PlayNote');
- $mrow = $dsql->GetOne("Select count(*) as dd From `#@__co_htmls` ");
- $totalnum = $mrow['dd'];
- if($totalnum==0)
- {
- ShowMsg("??????????","-1");
- exit();
- }
- $wintitle = "????-???????";
- $wecome_info = "<a href='co_main.php'>????</a>::???????";
- $win = new OxWindow();
- $win->Init("co_gather_start_action.php","js/blank.js","GET");
- $win->AddHidden('startdd','0');
- $win->AddHidden('pagesize','5');
- $win->AddHidden('sptime','0');
- $win->AddHidden('nid','0');
- $win->AddHidden('totalnum',$totalnum);
- $win->AddMsgItem("?????????<a href='co_url.php'><u>????</u></a>???????????????");
- $winform = $win->GetWindow("ok");
- $win->Display();
- exit();
- }
-
- ?>