Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

date manipulation script

  • Loading branch information...
commit 444536889333aea9afac285e5a813962e1b23d13 1 parent b6442a5
dhawes authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 rss/magpie/scripts/smarty_plugin/modifier.rss_date_parse.php
31 rss/magpie/scripts/smarty_plugin/modifier.rss_date_parse.php
View
@@ -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;
+ }
+}
+
+
+
+
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.