本文整理汇总了PHP中collection::url_list方法的典型用法代码示例。如果您正苦于以下问题:PHP collection::url_list方法的具体用法?PHP collection::url_list怎么用?PHP collection::url_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collection
的用法示例。
在下文中一共展示了collection::url_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
}
示例2: 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'));
}
}