Jamit Software Forum

Jamit Job Board Customers => User-to-User Support => Topic started by: laserjobs on September 24, 2010, 05:26:41 am



Title: All rss xml feeds not showing correct time and date ***(SOLVED)***
Post by: laserjobs on September 24, 2010, 05:26:41 am
All the jobs are coming up with the same time and date. Is there a bug in the script that creates the time and date as the XML file creation date?
http://www.photonicsjobs.com/rss.xml
http://www.photonicsjobs.com/jb-get-xml.php?feed_id=11

The RSS sometimes has nothing in it as well.

This is Version 3.6.5


Title: Re: All rss xml feeds not showing correct time and date
Post by: laserjobs on September 24, 2010, 06:18:50 am
The problem is with the pubDate not properly formatted
Code:
<pubDate>2010-Sep-23</pubDate>

pubDate
The publication date for the content in the channel. For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes. All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred). Sat, 07 Sep 2002 00:00:01 GMT

Anyone know how to fix this in rss.php?

Code:
$sql = "select *, `post_date` AS DAY,  DATE_FORMAT(`post_date`, '%a, %d %b %Y %H:%i:%s $gmt_diff') AS formatted_date from posts_table WHERE  `approved`='Y' AND expired='N' ".jb_escape_sql($extra_sql)." ORDER BY `post_date` DESC LIMIT ".$JB_POSTS_PER_RSS;




$PostingForm = &JB_get_DynamicFormObject(1, 'rss_feed');
$result = JB_mysql_query($sql) or die (mysql_error());


while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {


$PostingForm->set_values($row);

$TITLE = $PostingForm->get_raw_template_value ("TITLE");

$DESCRIPTION = $PostingForm->get_raw_template_value ("DESCRIPTION");
$row['formatted_date'] = JB_get_formatted_date($row['post_date']);


// force whitespace & strip tags.

$DESCRIPTION = str_replace('<',' <',$DESCRIPTION);
$DESCRIPTION = str_replace('>','> ',$DESCRIPTION);
$DESCRIPTION = html_entity_decode(strip_tags($DESCRIPTION));
$DESCRIPTION = preg_replace('/[\n\r\t]/',' ',$DESCRIPTION);
$DESCRIPTION = str_replace('  ',' ',$DESCRIPTION);

$output .=
"<item>\n"
."<title>".JB_rss_xmlentities($TITLE)."</title>\n"
."<link>".JB_job_post_url($row['post_id'], $JobListAttributes, JB_BASE_HTTP_PATH.'index.php')."</link>\n"
."<description>".JB_rss_xmlentities (JB_truncate_html_str ($DESCRIPTION,  255, $trunc_str_len))."...</description>\n"
."<pubDate>".$row['formatted_date']."</pubDate>\n"


Title: Re: All rss xml feeds not showing correct time and date
Post by: Peter on September 24, 2010, 02:01:01 pm
Code:
$timestamp = strtotime($olddate); // $olddate is anything, such as 2010-Sep-23

$newdate = gmtdate('r', $timestamp); // Thu, 21 Dec 2000 16:01:07 +0200



Title: Re: All rss xml feeds not showing correct time and date
Post by: laserjobs on September 24, 2010, 04:20:48 pm
Okay after hacking away there is a line that needs to be commented out in the rss.php script

Code:
// $row['formatted_date'] = JB_get_formatted_date($row['post_date']);