![]() |
| |||||||
| FAQ | The Drunks | Calendar | Arcade | Search | Today's Posts | Mark Forums Read |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| "It's a faaaake!" | For my new Hypersyllogistic web site, I've followed Gitch's suggestion on TrekWeb that I implement an RSS feed. But, for some reason, when I use Bloglines--which I guess is a fairly good RSS reader--only the first four entries in my article database show. Articles after that don't appear. Why might this be the case? I'm reproducing my code below, in case that might help: Code: <?php
header('Content-type: text/xml');
require '../includes/database.php';
?>
<rss version="2.0">
<channel>
<title>Hypersyllogistic: A Home for Politics without Histrionics</title>
<description>Hypersyllogistic features commentary and argument about politics and current events. Read screeds from the site's creator, Jason Vines, and then sound off on the forums!</description>
<link>http://www.hypersyllogistic.com</link>
<copyright>Jason Vines, 2000-2005.</copyright>
<?php
$query = "SELECT UNIX_TIMESTAMP(screed_time) AS time, DAYOFYEAR(screed_time) AS day, screed_title FROM screeds ORDER BY time DESC LIMIT 0, 10";
$result = mysql_query($query);
$array = mysql_fetch_array ($result);
while ($array = mysql_fetch_array ($result)) {
$time = strftime("%a, %d %b %Y %T %Z",$array['time']);
$day = $array['day'];
$screed_title = strip_tags($array['screed_title']);
?>
<item>
<title><?php print htmlentities($screed_title, ENT_QUOTES); ?></title>
<link>http://www.hypersyllogistic.com/pastscreed.php?id=<?php print $day; ?></link>
<pubDate><?php print $time; ?></pubDate>
</item>
<?php
}
?>
</channel>
</rss> I guess Bloglines could be what's screwing up; if that's the case, can anyone recommend a good RSS aggregator? EDIT: Here's a link to my RSS feed in question: http://www.hypersyllogistic.com/rss/rss.xml I've used an .htaccess file to make my server parse .xml files in the rss directory as .php files.
__________________ "People should not be afraid of their governments. Governments should be afraid of their people." -V for Vendetta "Don't tell me what I can't do!" -John Locke, Lost Visit me on the web: Hypersyllogistic | Flickr | Twitter ![]() |
| | |
| | #2 (permalink) |
| Consultant Fellationist Join Date: Dec 1969 Location: God's own country merry England
Posts: 435
![]() | I'd hate to give the impression that I have the faintest idea how RSS works - I simply ticked the "add to RSS feed" tickbox on my provider ;-)
__________________ ![]() If masturbation is self-abuse - you are obviously doing it wrong. |
| | |
| | #3 (permalink) |
| Astro-Monkey | A little bit of debugging... Code: <?php
header('Content-type: text/xml');
require '../includes/database.php';
?>
<rss version="2.0">
<channel>
<title>Hypersyllogistic: A Home for Politics without Histrionics</title>
<description>Hypersyllogistic features commentary and argument about politics and current events. Read screeds from the site's creator, Jason Vines, and then sound off on the forums!</description>
<link>http://www.hypersyllogistic.com</link>
<copyright>Jason Vines, 2000-2005.</copyright>
<?php
$query = "SELECT UNIX_TIMESTAMP(screed_time) AS time, DAYOFYEAR(screed_time) AS day, screed_title FROM screeds ORDER BY time DESC LIMIT 0, 10";
$result = mysql_query($query);
$array = mysql_fetch_array ($result);
$numResults = mysql_num_rows($result);
$numInArray = count($array);
$numIterations = 0;
echo 'Number of rows returned: ' . $numResults;
echo ' Numer of items in the array: ' . $numInArray;
while ($array = mysql_fetch_array ($result)) {
$numIterations++
$time = strftime("%a, %d %b %Y %T %Z",$array['time']);
$day = $array['day'];
$screed_title = strip_tags($array['screed_title']);
?>
<item>
<title><?php print htmlentities($screed_title, ENT_QUOTES); ?></title>
<link>http://www.hypersyllogistic.com/pastscreed.php?id=<?php print $day; ?></link>
<pubDate><?php print $time; ?></pubDate>
</item>
<?php
}
echo 'The while loop went for ' . $numIterations . ' iterations';
?>
</channel>
</rss>
__________________ The writers of this post apologize for you being too stupid to understand it. |
| | |
| | #4 (permalink) | |
| "It's a faaaake!" | Thanks so much for the help, Arik. Here are the results I received. http://www.hypersyllogistic.com/rss/rsstest.xml Quote:
![]()
__________________ "People should not be afraid of their governments. Governments should be afraid of their people." -V for Vendetta "Don't tell me what I can't do!" -John Locke, Lost Visit me on the web: Hypersyllogistic | Flickr | Twitter ![]() | |
| | |
| | #5 (permalink) | |
| Astro-Monkey | Quote:
Take out the first Code: $array = mysql_fetch_array ($result); ![]()
__________________ The writers of this post apologize for you being too stupid to understand it. | |
| | |
| | #6 (permalink) |
| "It's a faaaake!" | Thanks so much, Arik, my RSS feed appears to be working fine now. ![]()
__________________ "People should not be afraid of their governments. Governments should be afraid of their people." -V for Vendetta "Don't tell me what I can't do!" -John Locke, Lost Visit me on the web: Hypersyllogistic | Flickr | Twitter ![]() |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |