ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์Programmingอยากทำ rss แบบ pantip ครับ -..-
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: อยากทำ rss แบบ pantip ครับ -..-  (อ่าน 1587 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
mikeyx
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 270
ออฟไลน์ ออฟไลน์

กระทู้: 4,020



ดูรายละเอียด เว็บไซต์
« เมื่อ: 17 พฤศจิกายน 2007, 09:22:31 »

พอจะมี code แบบ ไกล์ไลน์มั้ยครับ
หลักการผมเข้าใจว่า ดึงข้อมูลจาก ฐานข้อมูลมา
แล้วก็เขียนลงใน file xml

ผลที่ได้ก็จะเป็น http://yousite.com/name.xml
ผมเข้าไปดู ใน help ของ php แล้ว งงมาก ค้นหาใน google ก็แล้ว
ไม่มีครับ T_T ใครพอจะมีตัวอย่าง code ให้เอาไปแกะ ๆ งัด ๆแงะ ๆ บ้างครับ
ขอบคุณครับ
บันทึกการเข้า
payu
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 125
ออฟไลน์ ออฟไลน์

กระทู้: 1,887



ดูรายละเอียด
« ตอบ #1 เมื่อ: 17 พฤศจิกายน 2007, 09:59:59 »


ลองดูที่นี่ครับ rss 2.0 spec
โค๊ด:
http://www.rssboard.org/rss-specification
http://en.wikipedia.org/wiki/RSS_(file_format)

นี่ xml ตัวอย่างที่ gen ออกมา
โค๊ด:
<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Liftoff News</title>
      <link>http://liftoff.msfc.nasa.gov/</link>
      <description>Liftoff to Space Exploration.</description>
      <language>en-us</language>
      <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>

      <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs>
      <generator>Weblog Editor 2.0</generator>
      <managingEditor>editor@example.com</managingEditor>
      <webMaster>webmaster@example.com</webMaster>
      <item>

         <title>Star City</title>
         <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
         <description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's &lt;a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm"&gt;Star City&lt;/a&gt;.</description>
         <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
         <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>

      </item>
   </channel>
</rss>

หลักการก็แค่ไปอ่านข้อมูลจาก db แล้วก็ echo ออกมาให้ได้ output ตามตัวอย่างแค่นั้นเองครับ
บันทึกการเข้า

mikeyx
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 270
ออฟไลน์ ออฟไลน์

กระทู้: 4,020



ดูรายละเอียด เว็บไซต์
« ตอบ #2 เมื่อ: 17 พฤศจิกายน 2007, 10:33:32 »

โอว์ขอบคุณมากครับ
บันทึกการเข้า
หน้า: [1]   ขึ้นบน
พิมพ์