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


PHP header::news方法代碼示例

本文整理匯總了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");
 }
開發者ID:quantm,項目名稱:mywebprovn,代碼行數:55,代碼來源:news.php


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