Hi all.
First of all I must say I am not a php developer so I am afraid I don't know much about it.
I am using the bloging software on my site called Super Simple Blog. This software includes a file called feed_maker.php which I have posted below:
<?php
/********************************************
feed_maker.php
This class is used for generating an RSS
feed.
********************************************/
class GenerateFeed{
var $TABLENAME;
var $websiteRoot;
var $pageTitle;
var $rssDesc;
var $rssLink;
var $rssFileName;
var $blogPageName;
function makeFeed($table, $webroot, $title, $desc, $link, $rssfile){
$this->TABLENAME = $table;
$this->websiteRoot = $webroot;
$this->pageTitle = $title;
$this->rssDesc = $desc;
$this->rssLink = $link;
$this->rssFileName = $rssfile;
//empty array which will be pushed all of the
//possible images for the home page.
//These are displayed when the page loads.
$spl = array();
// Query the database.
$query = "SELECT * FROM $this->TABLENAME ORDER BY uid DESC";
$result = mysql_query ($query);
//init a counter
$i = 0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$spl[$i] = $row;
$i++;
$ima = split(", ", $row['image']); //build array out of images list
$com = nl2br($row['comment']);
//if there is more than 1 image per entry
for($h=0; $h<count($ima); $h++){
$j = $h+1;
if($imagesPerEntry != 1){
if(substr($ima[$h],-4) != '.pdf'){ //filter out PDFs
$com = str_replace("[$j]", "<img src="$this->websiteRoot/blogImages/$ima[$h]" />", $com);
}
}
if($imagesPerEntry == 1){
if(!empty($ima[$h])) {
if(substr($ima[$h],-4) != '.pdf'){ //filter out PDFs
$com = str_replace("[$j]", "<img src="$this->websiteRoot/blogImages/$ima[$h]" />", $com);
}
}
}
}
//output the database
//each row will be 1 item
$addBlock .= "nn<item>
n
<title>{$row['title']}</title>
n
<link>$this->rssLink?entry={$row['uid']}</link>
n
<description><![CDATA[$com]]></description>
n
</item>nn";
}
// Write the three blocks to file
//this is the file that we are writing
$fileT = $this->rssFileName;
$fileT = fopen($fileT, "w");
//start off every feed with this
$startBlock = <<<EOR
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>$this->pageTitle</title>
<description>$this->rssDesc</description>
<link>$this->rssLink</link>
EOR;
//end every feed with this
$endBlock = "</channel>nn</rss>";
fwrite($fileT, $startBlock);
fwrite($fileT, $addBlock);
fwrite($fileT, $endBlock);
fclose($fileT);
//end of method
}
//end of class
}
?>
This file creates an rss feed from my blog.
My question is; would it be possible to add some code to this file which would give each item in the feed its own time and date stamp, for example;
Code: <pubDate>Fri, 15 Jan 2010 12:00:00 +0000</pubDate>
I can't find any support for this feed_maker.php file so that is why I have come here.
Thanks in advance
Must-Know Topics of PHP
Can you guys list the must-know topics of PHP. I am still a learner and I am trying to cover most of the important topics in PHP.
How to submit a form to the same page?
I have a table containing information about books in my library and this table has the following columns: id, title, category. What I want to do is to make a form that will allow me to sort these
Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database is setup correctly with the tables (User, ShopCart, ShopCartLine, Product, Order, OrderLine,
PHP, jAVASCRIPT setting input values, why isn't it working?
Hi:I am calling this javascript:<script language="javascript">function set_item_values(x){document.forms.form1.GetElementById(x).value =
DirectoryIterator and Hacked Website
Hi Everyone.My problem:Some one has been sneaking in to my website hidden Iframes. I've changed passwords & reset permissions to read, but then the permissions get changed to include write and
frame help
on the bottom frame is menu.htmlCode: <body><form action='link.php' method='post' name='changer'><label>URL<input type="text"
Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to retrieving and displaying data, but if I click on a valid link in the following code, the content and
PHP5/Zend 2.0 - Resources
PHP5 Snapshots
Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexpected T_ELSE in /home/a1408362/public_html/admin.php on line 41". I can't see why in the code
Web Application Recipe
Hi Guys! I am working with the Web Application recipes. I am currently working on the send password page. The page is working, but I sends the same password and username regardless of the email