Sorry for the title, not sure what to call this
using various things ive read and picked up today, ive managed to get this far (not that bad for newb I guess), however I cant seem to get it work properly
What im trying to do, is parse the most recent posts on Proboards Forum, using PHP, I want the link, the title and comments, this eventually will form part of a RSS feed (programming still do, not my current problem)
I cant seem to get this to keep parsing, it only does the first entry
heres the link im parsing
http://yorksfishing.proboards4.com/index.cgi?action=recent
heres my code so far
<?php
$handle = fopen("http://yorksfishing.proboards4.com/index.cgi?action=recent", "rb");
$contents = '';
if($handle)
{
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
}
if ($contents)
{
$start= strpos($contents, "Topic:");
$finish= strpos($contents, "(Read");
$length= $finish-$start;
$code=Substr($contents, $start, $length);
$oldlink = "/index.cgi";
$newlink = "http://yorksfishing.proboards4.com/index.cgi";
$forumlink = str_replace($oldlink, $newlink, $code);
$start2= strpos($contents, "<!-- google_ad_section_start -->");
$finish2= strpos($contents, "<!-- google_ad_section_end -->");
$length2= $finish2-$start2;
$code2=Substr($contents, $start2, $length2);
$oldmarker = "<!-- google_ad_section_start -->";
$newmarker = "Comments: ";
$forumpost = str_replace($oldmarker, $newmarker, $code2);
}
echo $forumlink;
echo "<br>";
echo strip_tags($forumpost);
?>
heres my current output
http://www.yorkshirefishing.net/testrecent.php
I just want the above code, to do what its doing on the first recent post, and carry on for the next 24
Jeese hope that makes some sense
Thanks in advance
Si