Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[991]PHP網站開發 進階應用技巧2」目錄
MarkDown
16-2 test1.php
1. 網頁多媒體
2. Superfish下拉選單
2-1 index.php(遞迴範例)
3. 連動選單
3-1 menu1.php
3-2 menu2.php
3-3 menu1.php(索引與值都相同的精簡寫法)
3-4 demo/index.php
4. 表格內容排序
4-1 index.php
5. 拉動表格進行排序
5-1 index.php
5-2 checkbox.html
6. 即時聊天系統
6-1 index.php
7. PHP檔案操作(上)
7-1 index.php
7-2 iconize_l.css
8. PHP檔案操作(下)
8-1 index.php
8-2 index.php 中文目錄修正
9. 相片EXIF資訊及上傳
9-1 index.php
10. 目錄管理及相片特效
10-1 index.php
10-2 exif.php
11. 多媒體RSS
11-1 index.php
11-2 mrss.php
12. 樹狀目錄+HTML5
12-1 index.php
12-2 dtree.js
13. DHX入門(上)
13-1 index.php
13-2 index2.php
13-3 index3.php
13-4 index4.php
14. DHX編輯器及選單
14-1 index.php
14-2 input.php
14-3 setup.php
14-4 list.php
14-5 view.php
14-6 menu.xml
15. 點擊編輯
15-1 index.php
15-2 save.php
16. curl網頁採集
16-1 index.php
16-2 test1.php
17. 讀取RSS
17-1 index.php
18. 無刷新登入
18-1 index.php
18-2 login.php
18-3 index.php(AJAX版)
18-4 login.php(AJAX版)
17-1 index.php
\[991\]PHP網站開發 進階應用技巧2 ====================== [](http://120.115.2.76/tad/tad_book3/file/9901/17.zip) ### 一、SimplePie 基本語法(
) [
下載simple.inc 1.3 版
](http://120.115.2.76/tad/tad_book3/file/9901/simplepie.zip)
<?php require\_once 'simplepie.inc'; $feed = new SimplePie('RSS網址','快取目錄',快取時間); $feed->init(); $feed->handle\_content\_type(); echo $feed->get\_title()."<br>"; foreach ($feed->get\_items(0, 15) as $item){ $title=$item->get\_title(); echo $title."<br>"; } ?>
1.完整API文件:
### 二、SimplePie 常用的設定類API 1.set\_feed\_url(RSS網址):設定RSS feed 2.enable\_cache(true):開啟或關閉cache機制(預設為true) 3.enable\_order\_by\_date(true) :是否以日期排序來抓出內容 4.set\_cache\_duration(3600):設定快取時間,以秒為單位 5.set\_cache\_location('./cache'):設定快取目錄,可設$\_SERVER\['TMP'\] 6.set\_item\_limit(0):在多個feed下,設定每個feed要抓回的項目數量 7.strip\_attributes($屬性陣列):要過濾掉的HTML標籤屬性陣列 8.strip\_comments(false) :過濾掉HTML註解 9.strip\_htmltags($標籤陣列):要過濾掉的HTML標籤陣列 ### 三、SimplePie 執行API 1.error():傳回錯誤訊息 2.handle\_content\_type():設定適當地HTTP檔頭及編碼 3.init():feed初始化並解析之 ### 四、取得feed基本資料 1.get\_copyright() :取得feed版權資訊 2.get\_description() :取得說明 3.get\_encoding() :取得編碼 4.get\_favicon():取得網址圖示 5.get\_item():取得單一項目 6.get\_items():取得所有項目 7.get\_item\_quantity():取得feed 項目的總數量 8.get\_language() :取得feed 項目的語言 9.get\_link():取得連結 10.get\_links():取得所有連結 11.get\_permalink():取得第一個feed的連結 12.get\_title() :取得feed 標題 13.get\_type() :取得feed 類型(傳回值需再判斷) ### 五、常用的feed的logo資料 1.get\_image\_height():取得logo圖片的高度 2.get\_image\_link():取得logo圖片的連結 3.get\_image\_title():取得logo圖片的標題 4.get\_image\_url():取得logo圖片的網址 5.get\_image\_width():取得logo圖片的寬度 ### 六、取得item基本資料 1.get\_author():取得文章的單一作者 2.get\_authors():取得文章的所有作者 3.get\_categories():取得文章的所有分類 4.get\_category():取得文章的單一分類 5.get\_content():取得文章的全文 6.get\_contributor():取得文章的貢獻者 7.get\_contributors():取得文章的所有貢獻者 8.get\_copyright() :取得文章的版權資訊 9.get\_date(日期格式):取得文章的日期 10.get\_description():取得文章的摘要 11.get\_enclosure():取得文章的附件 12.get\_enclosures():取得文章的所有附件 13.get\_feed():取得文章的所屬feed(多feed常用) 14.get\_id():取得文章的id 15.get\_link():取得文章的連結 16.get\_links():取得文章的所有連結 17.get\_local\_date() :取得文章的當地時間 18.get\_permalink():取得文章的主要連結 19.get\_title():取得文章的標題 ### 七、取得author基本資料(需配合$item->get\_author()) 1.get\_email():取得作者的Email 2.get\_link():取得作者的連結 3.get\_name():取得作者的姓名
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
110
人線上 (
74
人在瀏覽
線上書籍
)
會員: 0
訪客: 110
更多…