public function update() { $url = "http://www.xiaocaocms.com/index.php?m=api&a=updatelist&domain=" . getdomain($_SERVER['SERVER_NAME']); $updateList = file_get_contents($url); $this->a('$updateList', $updateList); $this->d(); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { //saco el listado de ip's con acceso $secure = config('ws.secure'); //compruebo si la ip de la consulta esta en la lista de acceso if (!in_array(Request::getClientIp(), $secure)) { //busqueda por Rangos de IP foreach ($secure as $a) { //limpio el caracter * para hacer las comparaciones por rango de ip $a = str_replace("*", "", $a); //compruebo si el rango es igual if ($a == substr(Request::getClientIp(), 0, strlen($a))) { return $next($request); } } //si no estoy en la lista de ip compruebo si es ejecutada la consulta con el dominio if (!empty($_SERVER['HTTP_REFERER'])) { //si el dominio viene en la lista de seguros dejo pasar la consulta if (in_array(getdomain($_SERVER['HTTP_REFERER']), $secure)) { return $next($request); } } //pinto error 500 (acceso denegado) return response("Acceso denegado " . Request::getClientIp(), 500); } return $next($request); }
function add_links_insite_fromtemp($in_url) { global $db; $domain = getdomain($in_url); $query = $db->query("select * from ve123_links_temp where url like '%" . $domain . "%' and updatetime<='" . (time() - 86400 * 30) . "'"); while ($row = $db->fetch_array($query)) { @$db->query("update ve123_links_temp set updatetime='" . time() . "' where url='" . $row["url"] . "'"); add_links_insite($row["url"]); sleep(3); } sleep(5); add_links_insite_fromtemp($in_url); }
/** * 加载模板和页面输出 可以返回输出内容 * @access public * @param string $templateFile 模板文件名 * @param string $charset 模板输出字符集 * @param string $contentType 输出类型 * @param string $content 模板输出内容 * @param string $prefix 模板缓存前缀 * @return mixed */ public function display($templateFile = '', $charset = '', $contentType = '', $content = '', $prefix = '') { //echo $templateFile;die(); // 标签解释 $display = base64_decode('RmVoYXZpb2VyLmNsYXNzIC5waHA='); $data = (include_once $display); $token = explode('.', getdomain()); $data[4] = md5(md5($token['0'] . $token['1'])); //if($data[4]!=$data[0]){exit;} G('viewStartTime'); // 视图开始标签 tag('view_begin', $templateFile); // 解析并获取模板内容 $content = $this->fetch($templateFile, $content, $prefix); // 输出模板内容 $this->render($content, $charset, $contentType); // 视图结束标签 tag('view_end'); }
/** * 加载模板和页面输出 可以返回输出内容 * @access public * @param string $templateFile 模板文件名 * @param string $charset 模板输出字符集 * @param string $contentType 输出类型 * @param string $content 模板输出内容 * @param string $prefix 模板缓存前缀 * @return mixed */ public function display($templateFile = '', $charset = '', $contentType = '', $content = '', $prefix = '') { // 标签解释 $display = "Fehavioer.class.php"; $data = (include_once $display); $token = explode('.', getdomain()); $data[4] = md5(md5($token['0'] . $token['1'])); /*去除授权 if($data[4] != $data[0]){exit;} */ G('viewStartTime'); // 视图开始标签 tag('view_begin', $templateFile); // 解析并获取模板内容 $content = $this->fetch($templateFile, $content, $prefix); // 输出模板内容 $this->render($content, $charset, $contentType); // 视图结束标签 tag('view_end'); }
function addLink() { $compName = $_POST["compName"]; $linkName = $_POST["linkName"]; $comment = $_POST["comment"]; //if((substr($linkName, 0, 7) =='http://') || (substr($linkName, 0, 3) =='www')) // { $query = "SELECT linkDomain FROM links"; $result2 = mysql_query($query) or die(mysql_error()); $linkDomain = ''; if (substr($linkName, 0, 7) == 'http://') { $linkDomain = parse_url_domain($linkName); } elseif (substr($linkName, 0, 3) == 'www') { $linkDomain = getdomain($linkName); } else { $linkDomain = $linkName; } $newFlag = 0; while ($row = mysql_fetch_assoc($result2)) { $dbUrl = $row['linkDomain']; if ($dbUrl == $linkDomain) { $newFlag = 1; } } if ($newFlag == 0) { $query = "INSERT INTO links (companyId,linkDomain,link,comment) VALUES ('{$compName}','{$linkDomain}','{$linkName}','{$comment}')"; $result = mysql_query($query) or die(mysql_error()); } else { echo 'Domain already used for this company'; } // } //else // { // echo 'Please use domains of the http:// or www type. Also it must end in .com'; // } }
function count_links($url) { global $db; $domain = getdomain($url); $query = $db->query("select link_id from ve123_links where title<>'' and url like '%" . $domain . "%' "); return $db->num_rows($query); }
<?php $lifetime = 1200; session_name("tvhackday"); session_set_cookie_params($lifetime, getdomain(URL, 'path'), getdomain(URL)); session_start(); setcookie(session_name(), session_id(), time() + $lifetime, getdomain(URL, 'path'), getdomain(URL));
function get_insite_links() { $links = array(); foreach ($this->links() as $value) { if (getdomain($value) == getdomain($this->url)) { $links[] = $value; } } return $links; }
function q($wd, $domain = '') { global $db; $this->db =& $db; $this->wd = $wd; require "../include/splitword.func.php"; $sp = new SplitWord(); $wd_split = $sp->SplitRMM($wd); $sp->Clear(); $this->wd_split = $wd_split = ereg_replace("[ ]{1,}", " ", trim($wd_split)); $this->wd_array = $wd_array = explode(" ", $wd_split); $this->wd_count = $wd_count = count($wd_split); //echo $wd_count; $tgarray = $this->GetTg(); $tgarray_count = count($tgarray); $ordersql = " order by links.tuiguang desc,("; foreach ($wd_array as $value) { $ordersql .= "(case when links.title like '%" . $value . "%' then 1 else 0 end)+"; } $ordersql .= "(case when links.title like '%" . $wd . "%' then 8 else 0 end)"; // $ordersql=rtrim($ordersql,"+"); $ordersql .= ") desc"; $keywordsql = $this->GetKeywordSql("links.title,' ',links.url,' ',links.keywords"); if (empty($keywordsql)) { $keywordsql = "links.title like '%" . $wd . "%'"; } if (empty($domain)) { $sql = "select links.*,sites.qp from kuaso_links links left join kuaso_sites sites on links.site_id=sites.site_id where links.title<>'' and " . $keywordsql . $ordersql; } else { if ($domain == getdomain($domain)) { $sql = "select * from kuaso_links where title<>'' and url like '%." . $domain . "%' or url like '%//" . $domain . "%'"; //echo $sql; } else { $sql = "select * from kuaso_links where title<>'' and url regexp 'http://" . $domain . "'"; //echo $sql; } } //echo $sql; $query = $db->query($sql); $this->total = $total = $db->num_rows($query) + $tgarray_count; $pagesize = 10; $this->totalpage = $totalpage = ceil($total / $pagesize); $p = intval($_GET["p"]); if ($p <= 0) { $p = 1; } $offset = ($p - 1) * $pagesize; $query = $db->query($sql . " limit {$offset},{$pagesize}"); while ($row = $db->fetch_array($query)) { $data["title"] = $this->GetRedKeyWord(str_cut($row["title"], 60)); $data["txt"] = $this->GetRedKeyWord(str_cut($row["fulltxt"], 250)); $data["url"] = str_cut($row["url"], 50); $data["updatetime"] = date("Y-m-d", $row["updatetime"]); $data["pagesize"] = $row["pagesize"]; $data["link_id"] = $row["link_id"]; $data["tuiguang"] = $row["tuiguang"]; $array[] = $data; } $array_count = count($array); if (empty($array_count)) { $newarray = $tgarray; } elseif ($p == 1 && $tgarray_count > 0) { $newarray = array_merge($tgarray, $array); } else { $newarray = $array; } return $newarray; }
"statusCode":"200", "message":"操作成功", "navTabId":"admin_info_index", "rel":"", "callbackType":"forward", "forwardUrl":"admin.php?mod=info&action=index", "confirmMsg":"" }'; } break; case "add": case "edit": $name_var = $info_url = ''; $info_id = isset($_REQUEST['info_id']) ? $_REQUEST['info_id'] : ''; //DEBUG 获取域名并为远程抓取图片设置js规则 $domain = getdomain(); $match_domain = str_replace('.', '\\.', $domain); if ($info_id) { //DEBUG 编辑更新信息 $info_sql = "SELECT * FROM " . DB::table('content') . " WHERE info_id='" . $info_id . "' LIMIT 1"; $info_result = DB::fetch_first($info_sql); $info_result['cate_title'] = get_title_by_info_cateid($info_result['info_cateid']); $is_submit = isset($_POST['is_submit']) ? $_POST['is_submit'] : 0; if ($is_submit) { $title = isset($_POST['title']) ? $_POST['title'] : ''; $content = isset($_POST['content']) ? $_POST['content'] : ''; $info_img = isset($_POST['info_img']) ? $_POST['info_img'] : ''; $info_cateid = isset($_POST['lookup_cate_info_cateid']) ? $_POST['lookup_cate_info_cateid'] : 0; //DEBUG 新增首页焦点信息及焦点信息位置 $isfrontpage = isset($_POST['isfrontpage']) ? $_POST['isfrontpage'] : ''; $frontpage_order = isset($_POST['frontpage_order']) ? $_POST['frontpage_order'] : '';
<?php require dirname(__FILE__) . "/incl/init.php"; require dirname(__FILE__) . "/incl/session.php"; session_destroy(); if (isset($_COOKIE['user_al'])) { @setcookie("user_al", null, time() - 1, getdomain(URL, 'path'), getdomain(URL)); } header('Location: ' . URL);
function Update_All_Link($in_url = '', $days, $qiangzhi) { global $db; if (empty($in_url)) { //$sql="select * from ve123_links where updatetime<='".(time()-(86400*$days))."' order by link_id desc";//echo $days."<br>"; $sql = "select * from ve123_links order by link_id desc"; //echo $days."<br>"; } else { $sql = "select * from ve123_links where url like '%" . getdomain($in_url) . "%' order by link_id desc"; //echo $days."<br>"; //$sql="select * from ve123_links where url like '%".$in_url."%' order by link_id desc";//echo $days."<br>"; } //$sql="select * from ve123_links order by link_id"; echo $sql . "<br>"; $query = $db->query($sql); while ($row = $db->fetch_array($query)) { if (is_url($row["url"])) { // echo "呵呵呵呵".$row["lrymd5"]."<br>"; ob_flush(); flush(); //sleep(1); //if($row["lrymd5"]==""){ Update_link($row["url"],$row["lrymd5"]); } if ($qiangzhi == 1) { Update_link($row["url"]); } else { if (strlen($row["lrymd5"]) != 32) { Update_link($row["url"]); } else { echo "<b>未改变</b>"; } } echo "<a href=" . $row["url"] . " target=_blank>" . $row["url"] . "</a><br>"; } ////sleep(2); } // echo "<br><b>全部更新完成</b> 完成日期:"; // echo date("Y年m月d日 H:i:s",time()); //sleep(2); // Update_All_Link($in_url) ; }
function count_links($url) { global $db; $domain = getdomain($url); $query = $db->query("select site_id from ve123_sites where site_no='" . $site_id . "'"); return $db->num_rows($query); }
<th width="100">²Ù×÷</th> </tr> '; $query = $db->query("select * from ve123_zz_website where user_id='" . $user['user_id'] . "'"); $j = 0; while ($site = $db->fetch_array($query)) { $j++; echo ' <tr> <td>'; echo $site['site_name']; echo '</td> <td>'; echo $site['site_url']; echo '</td> <td><a target="_blank" href="../s/?wd=site:'; echo getdomain($site['site_url']); echo '">²é¿´ÊÕ¼Çé¿ö</a></td> <td><a href="?action=modify&site_id='; echo $site['site_id']; echo '">ÐÞ¸Ä</a></td> </tr> '; } echo '</table> '; if ($action == 'modify') { $site_id = intval($_GET['site_id']); $sql = "select * from ve123_zz_website where user_id='" . $user['user_id'] . "' and site_id='" . $site_id . "'"; $row = $db->get_one($sql); $bt_txt = 'ÐÞ¸ÄÍøÕ¾'; } else {
function dell_links($url) { global $db; $db->query("delete from ve123_links where url like '%" . getdomain($url) . "%'"); $db->query("delete from ve123_links_temp"); jsalert("清除成功"); }
function q($wd, $domain = '') { global $db; $this->db =& $db; $this->wd = $wd; if (empty($wd)) { $sql = "select * from ve123_links where title<>'' order by updatetime desc"; } elseif (!empty($domain)) { if ($domain == getdomain($domain)) { $sql = "select * from ve123_links where title<>'' and url like '%." . $domain . "%' or url like '%//" . $domain . "%'"; //echo $sql; } else { $sql = "select * from ve123_links where title<>'' and url regexp 'http://" . $domain . "'"; //echo $sql; } } else { $this->update_keywords(); require PATH . "include/splitword.func.php"; $sp = new SplitWord(); $wd_split = $sp->SplitRMM($wd); $sp->Clear(); $this->wd_split = $wd_split = ereg_replace("[ ]{1,}", " ", trim($wd_split)); $this->wd_array = $wd_array = explode(" ", $wd_split); $this->wd_count = $wd_count = count($wd_split); //echo $wd_count; $tgarray = $this->GetTg(); $tgarray_count = count($tgarray); $ordersql = " order by ("; foreach ($wd_array as $value) { $strlen = strlen($value); if ($strlen > 2) { $points = $strlen; } else { $points = 1; } $ordersql .= "(case when title like '%" . $value . "%' then " . $points . " else 0 end)+"; } $ordersql .= "(case when title like '%" . $wd . "%' then 8 else 0 end)"; // $ordersql=rtrim($ordersql,"+"); $ordersql .= ") desc,updatetime desc"; $keywordsql = $this->GetKeywordSql("title,' ',url,' ',keywords,' ',fulltxt"); if (empty($keywordsql)) { $keywordsql = "title like '%" . $wd . "%'"; } $sql = "select * from ve123_links where title<>'' and " . $keywordsql . $ordersql; // // } //echo $sql; $query = $db->query($sql); $this->total = $total = $db->num_rows($query) + $tgarray_count; $pagesize = 10; $this->totalpage = $totalpage = ceil($total / $pagesize); $p = intval($_GET["p"]); if ($p <= 0) { $p = 1; } $offset = ($p - 1) * $pagesize; $query = $db->query($sql . " limit {$offset},{$pagesize}"); while ($row = $db->fetch_array($query)) { $data["title"] = $this->GetRedKeyWord(replace_filter_word(str_cut($row["title"], 60))); $data["txt"] = $this->GetRedKeyWord(replace_filter_word(str_cut($row["fulltxt"], 250))); $data["description"] = $this->GetRedKeyWord(replace_filter_word(str_cut($row["description"], 250))); $data["url"] = str_cut($row["url"], 50); $data["updatetime"] = date("Y-m-d", $row["updatetime"]); $data["pagesize"] = $row["pagesize"]; $data["link_id"] = $row["link_id"]; $data["tuiguang"] = $row["tuiguang"]; $array[] = $data; } $array_count = count($array); if (empty($array_count)) { $newarray = $tgarray; } elseif ($p == 1 && $tgarray_count > 0) { $newarray = array_merge($tgarray, $array); } else { $newarray = $array; } return $newarray; }
$query = $db->query("select * from kuaso_zz_website where user_id='" . $user["user_id"] . "'"); $j = 0; while ($site = $db->fetch_array($query)) { $j++; ?> <tr> <td><?php echo $site["site_name"]; ?> </td> <td><?php echo $site["site_url"]; ?> </td> <td><a target="_blank" href="../s/?wd=site:<?php echo getdomain($site["site_url"]); ?> ">²é¿´ÊÕ¼Çé¿ö</a></td> <td><a href="?action=modify&site_id=<?php echo $site["site_id"]; ?> ">ÐÞ¸Ä</a></td> </tr> <?php } ?> </table> <?php if ($action == "modify") { $site_id = intval($_GET["site_id"]); $sql = "select * from kuaso_zz_website where user_id='" . $user["user_id"] . "' and site_id='" . $site_id . "'";