當前位置: 首頁>>代碼示例>>PHP>>正文


PHP collection::get_url_lists方法代碼示例

本文整理匯總了PHP中collection::get_url_lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP collection::get_url_lists方法的具體用法?PHP collection::get_url_lists怎麽用?PHP collection::get_url_lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在collection的用法示例。


在下文中一共展示了collection::get_url_lists方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: col_url_list

 public function col_url_list()
 {
     $nodeid = isset($_GET['nodeid']) ? intval($_GET['nodeid']) : showmessage(L('illegal_parameters'), HTTP_REFERER);
     if ($data = $this->db->get_one(array('nodeid' => $nodeid))) {
         pc_base::load_app_class('collection', '', 0);
         $urls = collection::url_list($data);
         $total_page = count($urls);
         if ($total_page > 0) {
             $page = isset($_GET['page']) ? intval($_GET['page']) : 0;
             $url_list = $urls[$page];
             $url = collection::get_url_lists($url_list, $data);
             $history_db = pc_base::load_model('collection_history_model');
             $content_db = pc_base::load_model('collection_content_model');
             $total = count($url);
             $re = 0;
             if (is_array($url) && !empty($url)) {
                 foreach ($url as $v) {
                     if (empty($v['url']) || empty($v['title'])) {
                         continue;
                     }
                     $v = new_addslashes($v);
                     $v['title'] = strip_tags($v['title']);
                     $md5 = md5($v['url']);
                     if (!$history_db->get_one(array('md5' => $md5, 'siteid' => $this->get_siteid()))) {
                         $history_db->insert(array('md5' => $md5, 'siteid' => $this->get_siteid()));
                         $content_db->insert(array('nodeid' => $nodeid, 'status' => 0, 'url' => $v['url'], 'title' => $v['title'], 'siteid' => $this->get_siteid()));
                     } else {
                         $re++;
                     }
                 }
             }
             $show_header = $show_dialog = true;
             if ($total_page <= $page) {
                 $this->db->update(array('lastdate' => SYS_TIME), array('nodeid' => $nodeid));
             }
             include $this->admin_tpl('col_url_list');
         } else {
             showmessage(L('not_to_collect'));
         }
     } else {
         showmessage(L('notfound'));
     }
 }
開發者ID:shenhua4286,項目名稱:gxw,代碼行數:43,代碼來源:node.php

示例2: public_test

 /**
  * 測試文章URL采集
  */
 public function public_test()
 {
     $nodeid = isset($_GET['nodeid']) ? intval($_GET['nodeid']) : showmessage(L('illegal_parameters'), HTTP_REFERER);
     if ($data = $this->db->getby_nodeid($nodeid)) {
         Loader::lib('collection:collection', false);
         $urls = collection::url_list($data, 1);
         if (!empty($urls)) {
             foreach ($urls as $v) {
                 $url = collection::get_url_lists($v, $data);
             }
         }
         $show_header = $show_dialog = true;
         include $this->view('public_test');
     } else {
         showmessage(L('notfound'));
     }
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:20,代碼來源:NodeController.php

示例3: explode

    //print_r($html[1]);exit;
    if (is_array($html)) {
        $html = explode('</div>', $html[1]);
    }
    $data['content'] = str_replace('src="/uploadfile/', 'src="http://www.chinacatholic.org/uploadfile/', $html[0]);
    //移出margin-left屬性
    //	$data['content']=str_replace('margin-left: 240px;', '', $data['content']);
    //	$data['content'] = preg_replace('/(<p.+?)style=".+?"(>.+?)/i', "$1$2", $data['content']);
    $data['content'] = preg_replace('/margin-left.*[1,10]px;/', '', $data['content']);
    //print_r($html[0]);exit;
    //	echo($data['content']);
    return $data;
}
@set_time_limit(600);
foreach ($urls as $k => $url_list) {
    $url = collection::get_url_lists($url_list, $cjconfig);
    //var_dump($url );exit;
    if (is_array($url) && !empty($url)) {
        foreach ($url as $v) {
            //if (empty($v['url']) || empty($v['title']) || (strpos($v['url'],'www.chinacatholic.org')<1)) continue;
            if (empty($v['url']) || empty($v['title']) || strpos($v['url'], 'www.chinacatholic.org') < 1) {
                echo '<b>invalid url:' . $v['url'] . '</b><br/>';
                continue;
            }
            //$v = new_addslashes($v);
            $v['url'] = str_replace('/index/id', '', $v['url']);
            $v['title'] = strip_tags($v['title']);
            $md5 = md5($v['url']);
            if (!$db->get_one('id', 'faithlife', " md5url='{$md5}' ")) {
                $cinfo = get_content($v['url']);
                //獲取發布時間、作者、來源、內容
開發者ID:gaoerjun,項目名稱:Web,代碼行數:31,代碼來源:caiji.php


注:本文中的collection::get_url_lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。