forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dhawes
committed
Jan 23, 2005
1 parent
b6442a5
commit 4445368
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
rss/magpie/scripts/smarty_plugin/modifier.rss_date_parse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* Smarty plugin | ||
* ------------------------------------------------------------- | ||
* Type: modifier | ||
* Name: rss_date_parse | ||
* Purpose: parse rss date into unix epoch | ||
* Input: string: rss date | ||
* default_date: default date if $rss_date is empty | ||
* | ||
* NOTE!!! parse_w3cdtf provided by MagpieRSS's rss_utils.inc | ||
* this file needs to be included somewhere in your script | ||
* ------------------------------------------------------------- | ||
*/ | ||
|
||
function smarty_modifier_rss_date_parse ($rss_date, $default_date=null) | ||
{ | ||
if($rss_date != '') { | ||
return parse_w3cdtf( $rss_date ); | ||
} elseif (isset($default_date) && $default_date != '') { | ||
return parse_w3cdtf( $default_date ); | ||
} else { | ||
return; | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
?> |