Jamit Software Forum
Welcome, Guest. Please login or register.
September 25, 2023, 10:56:06 am

Login with username, password and session length
Search:     Advanced search
May 5th, 2010 - Jamit Software Launches the Market!
3,080 Posts in 791 Topics by 2,022,685 Members
Latest Member: RusselJane
* Home Help Search Login Register
+  Jamit Software Forum
|-+  Jamit Job Board Customers
| |-+  User-to-User Support
| | |-+  All rss xml feeds not showing correct time and date ***(SOLVED)***
« previous next »
Pages: [1] Print
Author Topic: All rss xml feeds not showing correct time and date ***(SOLVED)***  (Read 8400 times)
laserjobs
Jammers
Newbie
*
Posts: 9


« 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
« Last Edit: September 24, 2010, 11:11:33 pm by laserjobs » Logged
laserjobs
Jammers
Newbie
*
Posts: 9


« Reply #1 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"
« Last Edit: September 24, 2010, 06:21:52 am by laserjobs » Logged
Peter
Administrator
Hero Member
*****
Posts: 248



« Reply #2 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

Logged

SECURE your site BEFORE you wish you had! Use plugins by COLOSSAL MIND!
laserjobs
Jammers
Newbie
*
Posts: 9


« Reply #3 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']);
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.041 seconds with 18 queries.