Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%pubDate%> not working

Quote Reply
<%pubDate%> not working

I have a "Link of the Day" plugin set up by GT (if I remember correctly):
http://www.englishclub.com/ref/idiom-of-the-day.php


The RSS Feed template is shown below.


The problem is that pubDate is not showing the correct date in the RSS feed. It actually consistently shows:
Mon, 23 Jun 2008 00:00:00 +0000


The server time is functioning correctly.


Any ideas why <%pubDate%> is not working? Many thanks...

--


<?xml version="1.0" encoding="<%config.header_charset || iso-8859-1%>"?> <rss version="2.0"> <channel> <title><%site_title%> - <%catname%> of the day</title> <link><%build_root_url%></link> <description><%catname%> of the day rss</description> <language>en-us</language> <copyright>&copy; 2012</copyright> <item> <title><%Plugins::LinkofDay::xml($Title)%></title> <description><%Plugins::LinkofDay::xml($Description)%></description> <link><%detailed_url%></link> <pubDate><%pubDate%></pubDate> </item> </channel> </rss>

Thanks,
--Jo
Quote Reply
Re: [iplay] <%pubDate%> not working In reply to
pubDate isn't a standard template variable, so you'll have to find the code that's generating that variable to see what's wrong.

Adrian
Quote Reply
Re: [brewt] <%pubDate%> not working In reply to
Thank you Adrian. Do you happen to know if there is a standard template variable that would update the date each time the page is rebuilt (every night)?

Thanks,
--Jo
Quote Reply
Re: [iplay] <%pubDate%> not working In reply to
If you're building static files, then I guess you could just use the current time. Normally, for an RSS feed, you would just use the Add_Date or Mod_Date.

Adrian
Quote Reply
Re: [brewt] <%pubDate%> not working In reply to
Thanks again Adrian. I tried that and it returns the same Wed Aug 06 2008.


I realize now that it's pulling all the data from the original entry, which of course isn't getting updated, and then building the Idiom of the Day page by cron. So the original Add date or even Mod date won't work.


Do you know if there's any way to add server date/time?


Thanks for your help.

Thanks,
--Jo
Quote Reply
Re: [iplay] <%pubDate%> not working In reply to
To get the "server time", you can use:

Code:
<%GT::Date::date_get()%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] <%pubDate%> not working In reply to
Many thanks Andy. At least that puts the right date in the RSS feed Whistle


Is it possible to convert it to a format like this:

Wed, 04 Feb 2008 13:00:00 GMT

Thanks,
--Jo

Last edited by:

iplay: Dec 28, 2011, 2:51 AM
Quote Reply
Re: [Andy] <%pubDate%> not working In reply to
Also, I've just realised that there is a global called "RSS" as below:

sub {
my $date = GT::Date::date_get();
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Add_Date ASC");
my $cond = GT::SQL::Condition->new( 'Add_Date', '=', $date, VIEWABLE);
my $loop = $search_db->select ($cond)->fetchall_hashref;
return {linksloop=>$loop};
}

Does this throw any light on things?

Wink

Thanks,
--Jo
Quote Reply
Re: [iplay] <%pubDate%> not working In reply to
Hi,

This should work:

Code:
<%GT::Date::date_get('%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%')%> GMT

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] <%pubDate%> not working In reply to
Thanks, but that prints out as:

1970-01-01 GMT

Frown

http://www.englishclub.com/ref/idiom-of-the-day.php

Thanks,
--Jo

Last edited by:

iplay: Dec 28, 2011, 6:03 AM
Quote Reply
Re: [iplay] <%pubDate%> not working In reply to
Hi,

Please try this instead:

Code:
<%set today = GT::Date::date_get()%>
<%GT::Date::date_transform($today,'%yyyy%-%mm%-%dd%','%ddd%, %dd% %mmm% %yyyy%')%> GMT

This works for me here:

http://www.ultranerds.co.uk/cgi-bin/page.cgi?p=test

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] <%pubDate%> not working In reply to
Brilliant Andy! That does seem to work:
http://www.englishclub.com/ref/idiom-of-the-day.php
http://www.englishclub.com/ref/idiom-of-the-day.xml


Any chance of getting the time back in there?

Wed, 25 Dec 2011 13:00:00 GMT

Thanks,
--Jo


Thanks,
--Jo

Last edited by:

iplay: Dec 28, 2011, 7:34 AM
Quote Reply
Re: [iplay] <%pubDate%> not working In reply to
Sure, just change it to:

Code:
<%set today = GT::Date::date_get()%>
<%GT::Date::date_transform($today,'%yyyy%-%mm%-%dd%','%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%')%> GMT

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] <%pubDate%> not working In reply to
Thanks Andy! That seems to have fixed it good and proper Smile

Thanks,
--Jo