Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

date manipulation script

  • Loading branch information...
commit 444536889333aea9afac285e5a813962e1b23d13 1 parent b6442a5
dhawes authored
31 rss/magpie/scripts/smarty_plugin/modifier.rss_date_parse.php
... ... @@ -0,0 +1,31 @@
  1 +<?php
  2 +
  3 +/*
  4 + * Smarty plugin
  5 + * -------------------------------------------------------------
  6 + * Type: modifier
  7 + * Name: rss_date_parse
  8 + * Purpose: parse rss date into unix epoch
  9 + * Input: string: rss date
  10 + * default_date: default date if $rss_date is empty
  11 + *
  12 + * NOTE!!! parse_w3cdtf provided by MagpieRSS's rss_utils.inc
  13 + * this file needs to be included somewhere in your script
  14 + * -------------------------------------------------------------
  15 + */
  16 +
  17 +function smarty_modifier_rss_date_parse ($rss_date, $default_date=null)
  18 +{
  19 + if($rss_date != '') {
  20 + return parse_w3cdtf( $rss_date );
  21 + } elseif (isset($default_date) && $default_date != '') {
  22 + return parse_w3cdtf( $default_date );
  23 + } else {
  24 + return;
  25 + }
  26 +}
  27 +
  28 +
  29 +
  30 +
  31 +?>

0 comments on commit 4445368

Please sign in to comment.
Something went wrong with that request. Please try again.