BLOG DESIGN SOLUTIONS Here is the function that will write your RSS file: function makerssfeed() { // set file to write $filename = $_SERVER[”DOCUMENT_ROOT”] . “/index.xml”; // open file $fh = @fopen($filename, “w”); if($fh) { $rssfile = “
http://your-domain-name.com A blog by Samuel Pepysen-gb“; // pull blogs from database $sql = “SELECT post_id, title, summary, . DATE_FORMAT(postdate, ‘%a, %d %b %Y %T GMT’) as pubdate . FROM posts ORDER BY postdate DESC LIMIT 10″; $result = mysql_query($sql); if ($mypost = mysql_fetch_array($result)) { do { $post_id = $mypost[”post_id”]; $pubdate = $mypost[”pubdate”]; $summary = format($mypost[”summary”]); $title = $mypost[”title”]; $title = strip_tags($title); $title = htmlentities($title); $rssfile .= ” \n”; $rssfile .= ” $pubdate\n”; $rssfile .= ” \n”; $rssfile .= ”
http://your-domain-name.com/ . post.php?post_id=$post_id\n”; $rssfile .= ” \n”; $rssfile .= ” \n”; } while ($mypost = mysql_fetch_array($result)); } $rssfile .=” “; // write to file $fw = @fwrite($fh, $rssfile);
This entry was posted
on Thursday, January 24th, 2008 at 10:22 am and is filed under Apache.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
WordPress database error: [Table 'armadillowebhosting_com_-_apache.wp_comments' doesn't exist] SELECT * FROM wp_comments WHERE comment_post_ID = '401' AND comment_approved = '1' ORDER BY comment_date