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
multiple recipients + dbuser mail recall
Hello,I am building a php login script.When the user registers the script will send him a confimation email using this codemail($usr_email, "Login Details", $message, "From:
Php navigation
I have four buttons on a php page.If i click a button it will redirect to different php pages.How would i do that with php?
records between 2 dates
Hello all,
unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.
php mail form text wont appear / javascript included
Guys/gals...I am running into a problem whereby I have a great piece of javascript code that mimicks multi-page forms (see www.mtsgroup.co.uk/multiPageForm.htm).....The problem is the php file wont
Storing user data help?
Hey Guys, I'm not use if this question is to broad but I can always give you more information if needed.I have a website where users can login which uses mysql anyway I have a little form asking some
This must be easy , pulling the last record of the day, every day, from a txt
I have a txt file logging weather data every minutes (so 1 record per minute). I want to extract the data from the (and only that one) last record for every single day in the log file. Each record as
Help Optimizing code
Good Morning,I wrote a small import function for a website of mine and I know there has to be a better way to handle what I'm doing. I'm hoping someone can take my code and make it run a hair faster
Run function every 5 mins ??
I have a function PostMessage()How can I run it every 5 mins ??
What are the two different files you download to update kernel?
What are the two different files you download to update kernel?