Author Topic: RSS feed v.2  (Read 1357 times)

0 Members and 1 Guest are viewing this topic.

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
RSS feed v.2
« on: July 29, 2009, 01:35:19 AM »
Edit----
Im very sorry this took so long to fix and that i haven't really been on latley... iv been VERY busy lol
----Edit

Hey everyone,

Well I just finished my RSS feed Mod v.2 and I can really say im proud of what I created.

What my RSS feed does is shows the newest(20) videos (which it can be modified to show by rating or anything you want - all you need to do is ask)

Demo My Rss Feed

--------------Tutorial---------------
Step 1. Create file named rss.php

Step 2. Inside rss.php insert the below code
Code: [Select]
<?php
header 
("Content-Type: application/rss+xml");
include_once (
"db.php"); ?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Site Title</title>
<description>Site Deptioscrin</description>
<link>Site Link</link>
<image>
<title>Msic Videos</title>
<description>Site Deptioscrin</description>
<url>Image Url</url>
<link>Clinking image will bring you to this url</link>
</image>
<?
$sql = "SELECT * FROM pp_files WHERE approved = '1' ORDER BY id DESC limit 20";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
$row['name'] = str_replace("&", "&amp;", $row['name']);
?>
<item>
<title><?=$row['name']; ?></title>
<description><![CDATA[<img height=89 width=120 src="<?=$row['picture']; ?>" align="left"

hspace="3" vspace="3">
<p><b>Description:</b></p>
<p><?=$row['description']; ?></p>
<p><b>Uploaded:</b> <?=$row['date']; ?></p>]]></description>
<link>http://(site url)/videos.php?id=<?=$row['id']; ?></link>
<guid isPermaLink="true">http://(site url)/videos.php?id=<?=$row['id']; ?></guid>
</item>
<?
}
?>
<atom:link href="(site url)/rss.php" rel="self" type="application/rss+xml" />
</channel>
</rss>

Step 3. Edit everything that needs to be edited

Step 4. Place
Code: [Select]
<a href="http://(site url)/rss.php">RSS Feed</a>where ever you want the Link to appear

If you need any help feel free to ask
 
-Jeff-
« Last Edit: September 23, 2009, 01:50:26 AM by Jeff »

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: RSS feed
« Reply #1 on: July 30, 2009, 02:59:28 AM »
Nice add on. Should be included as a option to Enable/Disable in the Admin panel.

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: RSS feed
« Reply #2 on: July 30, 2009, 03:29:27 AM »
ya that wouldnt be that hard i dont think... :-P but i would have to wait till the new version comes out... because with how much there changing. im sure it will break after update :-P

Offline Chris (krissy)

  • Project Leader
  • Sr phpd Member
  • *****
  • Posts: 219
  • Karma: 1000
    • View Profile
    • PHPDirector
Re: RSS feed
« Reply #3 on: August 11, 2009, 12:30:01 PM »
Good Work :)

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: RSS feed
« Reply #4 on: September 10, 2009, 08:25:33 PM »
Thanks.... it was really hard to create this :-P haha

Offline bondservnt

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: RSS feed
« Reply #5 on: September 23, 2009, 12:59:42 AM »
links are broken... site redirected.  rss feed code broken when run on new server.

ughg!

I wanted to include my RSS feed from this script onto another website!

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: RSS feed v.2
« Reply #6 on: September 23, 2009, 01:49:01 AM »
Im very sorry about that... i have been really busy but i have fixed it for you guys

-jeff