本文整理汇总了PHP中collection::get_content方法的典型用法代码示例。如果您正苦于以下问题:PHP collection::get_content方法的具体用法?PHP collection::get_content怎么用?PHP collection::get_content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collection
的用法示例。
在下文中一共展示了collection::get_content方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: public_test_content
/**
* 测试文章内容采集
*/
public function public_test_content()
{
$url = isset($_GET['url']) ? urldecode($_GET['url']) : exit('0');
$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);
print_r(collection::get_content($url, $data));
} else {
showmessage(L('notfound'));
}
}
示例2: col_content
public function col_content()
{
$nodeid = isset($_GET['nodeid']) ? intval($_GET['nodeid']) : showmessage(L('illegal_parameters'), HTTP_REFERER);
if ($data = $this->db->get_one(array('nodeid' => $nodeid))) {
$content_db = pc_base::load_model('collection_content_model');
//更新附件状态
$attach_status = false;
if (pc_base::load_config('system', 'attachment_stat')) {
$this->attachment_db = pc_base::load_model('attachment_model');
$attach_status = true;
}
pc_base::load_app_class('collection', '', 0);
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$total = isset($_GET['total']) ? intval($_GET['total']) : 0;
if (empty($total)) {
$total = $content_db->count(array('nodeid' => $nodeid, 'siteid' => $this->get_siteid(), 'status' => 0));
}
$total_page = ceil($total / 2);
$list = $content_db->select(array('nodeid' => $nodeid, 'siteid' => $this->get_siteid(), 'status' => 0), 'id,url', '2', 'id desc');
$i = 0;
if (!empty($list) && is_array($list)) {
foreach ($list as $v) {
$GLOBALS['downloadfiles'] = array();
$html = collection::get_content($v['url'], $data);
//更新附件状态
if ($attach_status) {
$this->attachment_db->api_update($GLOBALS['downloadfiles'], 'cj-' . $v['id'], 1);
}
$content_db->update(array('status' => 1, 'data' => array2string($html)), array('id' => $v['id']));
$i++;
}
} else {
showmessage(L('url_collect_msg'), '?m=collection&c=node&a=manage');
}
if ($total_page > $page) {
showmessage(L('collectioning') . ($i + ($page - 1) * 2) . '/' . $total . '<script type="text/javascript">location.href="?m=collection&c=node&a=col_content&page=' . ($page + 1) . '&nodeid=' . $nodeid . '&total=' . $total . '&pc_hash=' . $_SESSION['pc_hash'] . '"</script>', '?m=collection&c=node&a=col_content&page=' . ($page + 1) . '&nodeid=' . $nodeid . '&total=' . $total);
} else {
$this->db->update(array('lastdate' => SYS_TIME), array('nodeid' => $nodeid));
showmessage(L('collection_success'), '?m=collection&c=node&a=manage');
}
}
}