本文整理汇总了PHP中header::news方法的典型用法代码示例。如果您正苦于以下问题:PHP header::news方法的具体用法?PHP header::news怎么用?PHP header::news使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类header
的用法示例。
在下文中一共展示了header::news方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: giaoduc
function giaoduc()
{
redirect('/');
if (isset($_REQUEST['id'])) {
$data['popup'] = "hide";
$url = $_REQUEST['id'];
} else {
$data['popup'] = "show";
$url = "http://www.giaoduc.edu.vn/";
}
$indexpage = "?giaoduc";
$this->initiate_news($url, $indexpage);
$this->converturl($url, $base);
$content = '';
$this->start_transfer("www.giaoduc.edu.vn");
$this->getcontent($content);
if (substr_count($url, "/") == 3) {
// index page
preg_match_all('@<div id="r1" class="bodymiddle">(.*?)<div id="p3" class="bodycenter-cols">@s', $content, $matches, PREG_SET_ORDER);
$content = '';
foreach ($matches as $match) {
$content .= '<div id="r1" class="bodymiddle">' . $match[1] . '<div id="p3" class="bodycenter-cols">';
}
$content = preg_replace('@<div id="p3" class="bodycenter-cols">@s', '</div>', $content);
// ----------------------------------------
} elseif (substr_count($url, "/") > 4) {
// article
preg_match_all('@_UpdatePanel1">(.*?)<div id="searchbydate">@s', $content, $matches1, PREG_SET_ORDER);
$content = '';
foreach ($matches1 as $match) {
$content .= '_UpdatePanel1">' . $match[1] . '<div id="searchbydate">';
}
$content = preg_replace('@_UpdatePanel1">@s', '', $content);
$content = preg_replace('@<div id="searchbydate">@s', '</div>', $content);
// ----------------------------------------
} else {
// channel
preg_match_all('@_UpdatePanel1">(.*?)<div id="searchbydate">@s', $content, $matches, PREG_SET_ORDER);
$content = '';
foreach ($matches as $match) {
$content .= '_UpdatePanel1">' . $match[1] . '<div id="searchbydate">';
}
$content = preg_replace('@_UpdatePanel1">@s', '', $content);
$content = preg_replace('@<div id="searchbydate">@s', '</div>', $content);
}
$content = str_replace('<img', '<img alt="Đọc báo Giáo Dục Online" ', $content);
// ----------------------------------------
$this->updatecontent($content);
$this->modify_urls();
$this->getcontent($content);
$data['content'] = $content;
$this->load->view('/news/giaoduc', $data);
$header = new header();
$header->news("Báo Giáo Dục TP Hồ Chí Minh");
}