Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > General Discussion > Customizations (Themes / Templates)

Customizations (Themes / Templates) Help with customizing the themes and templates. Post your own custom themes for others to enjoy.

Closed Thread
 
Thread Tools Search this Thread Display Modes

time and date in rss feed.
Old 10-05-2006, 10:21 AM   #1
holdencn
University of Toronto
 
holdencn is offline
Join Date: Jan 2005
Location: Toronto
Posts: 10
Send a message via MSN to holdencn
Cool time and date in rss feed.

I need to display the time in the rss feed. can someone show me how to accomplish this?

Thanks
Chad
 

Old 10-12-2006, 01:25 PM   #2
ddrager
Chester County Bar
 
ddrager's Avatar
 
ddrager is offline
Join Date: Mar 2006
Posts: 13
Default

You can see the code for this here:

http://www.easyphpcalendar.com/forum...ead.php?t=5549

But... the variable [time] can not be formatted as in the standardized way, so I do not think it is possible at this time. You could certainly insert it anywhere in the description or title, but not in the ISO 8601 format that the RSS dc: feed requires.

Let me know if you find otherwise

-Dave
http://systembash.com
 

fixed it myself
Old 10-12-2006, 01:48 PM   #3
holdencn
University of Toronto
 
holdencn is offline
Join Date: Jan 2005
Location: Toronto
Posts: 10
Send a message via MSN to holdencn
Wink fixed it myself

I actually was forced to create my own RSS feed using the table fields from the database. The time was never displaying correctly.

The below code will give you a properly formatted RSS 2.0 feed.

Code:
<?php header("Content-type: text/xml");?> 
<?php echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">" ?>
<?php
$host = "localhost"; 
$username = "mysql_login"; 
$password = "mysql_password"; 
$database = "db_name"; 
$server = mysql_connect($host, $username, $password) or die(mysql_error()); 
$connection = mysql_select_db($database, $server); 

$m = date("m");
$d = date("d");
$y = date("Y");

$datenow = cal_to_jd(CAL_GREGORIAN,$d,$m,$y); 
/* the calendar uses gregorian dates for the date field. This will convert todays date to gregorian time for comparison to the table. As you can see in the line below, we only want to call future dates. */

$eventsq = "SELECT * from epc_calendar WHERE startDate >= '$datenow' LIMIT 5";
$eventsr = mysql_query($eventsq);
$eventsc = mysql_num_rows($eventsr);
?>
<channel>
    <title>My Calendar</title>
    <link>http://www.urltoevent.com</link>
    <description>Events RSS Feed</description>
    <language>en-us</language>
<?php     for ($i=0; $i<$eventsc; $i++) {
        $evdate = "";
        @extract(mysql_fetch_assoc($eventsr));
        $evdate = cal_from_jd($startDate,CAL_GREGORIAN); /* here we convert the gregorian date to an array of variables */
        extract($evdate); /* extract the variables */
        echo "<item>\n";
        echo "<title>".$title."</title>\n";
        echo "<link>http://www.urltoevent.com/</link>\n";
        echo "<description><![CDATA[".$descr."]]></description>\n";
        echo "<dc:creator>My Events</dc:creator>\n";
        echo "<pubDate>".$evdate[abbrevdayname].", ".$evdate[day]." ".$evdate[abbrevmonth]." ".$evdate[year]." $startTime EST"."</pubDate>\n"; /*this adds your time and date together to create the format needed by the feed. */
        echo "</item>\n";
        $cal = ""; /* reset the date */ }
?>
</channel>
</rss>

This is quick and dirty, but it works like a charm and you can change whatever you want in it to suit your needs. If the css stuff they posted before doesn't work for you, try this.

Chad
www.maifith.com
 

Old 10-12-2006, 02:05 PM   #4
ddrager
Chester County Bar
 
ddrager's Avatar
 
ddrager is offline
Join Date: Mar 2006
Posts: 13
Default

Excellent, thanks for sharing! That was what I was going to do next since the templates can not seem to do it, but that will save me a lot of time!
 

Date event
Old 03-21-2007, 08:04 PM   #5
baseonez
Calendar User
 
baseonez is offline
Join Date: Mar 2007
Posts: 9
Exclamation Date event

Nice script!! hey guys im been wondering how we can get a event dates work with rss because the orginal calendar events listed would be like

dates / day event
Headline
Description

but RSS feed only show

Headline
description

So the date and day event is missing... so im wondering if we can figure that clue to solve that issues. cause it seems cofused by having people seeing events in rss with no dates and day for events.. so hope hear from ya guys.. thanks..


nick
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing Outlook file... teeohhem Customizations (Themes / Templates) 3 09-28-2006 09:30 PM
TBA instead of date and time requirement muskiediver General 1 08-31-2006 03:36 PM
Formatting the Date and Times from the Desciption Parser XplosiveConcepts General Support 6 06-30-2006 03:53 PM
Errors In Setup Manager under Time & Date mrcomputerman General Support 3 09-11-2005 08:08 PM
Problems with time in the Netherlands hansdezwart General Support 2 07-17-2004 02:10 AM



All times are GMT -4. The time now is 11:52 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.

| Home | Register | Today's Posts | Search | New Posts |