]> git.mjollnir.org Git - moodle.git/commitdiff
smarty template file example
authordhawes <dhawes>
Sun, 23 Jan 2005 15:58:04 +0000 (15:58 +0000)
committerdhawes <dhawes>
Sun, 23 Jan 2005 15:58:04 +0000 (15:58 +0000)
rss/magpie/scripts/templates/simple.smarty [new file with mode: 0644]

diff --git a/rss/magpie/scripts/templates/simple.smarty b/rss/magpie/scripts/templates/simple.smarty
new file mode 100644 (file)
index 0000000..c0761cf
--- /dev/null
@@ -0,0 +1,46 @@
+<html>
+<head>
+<title>A Simple RSS Box:  I'm not a designer</title>
+</head>
+<body>
+
+<form>
+<b>RSS File:</b> 
+<input type=text" name="rss_url" value="{$rss_url}" size="50"> 
+<input type="submit">
+</form>
+
+<b>Displaying:</b> {$rss_url}
+<p>
+
+{* if $error display the error 
+  elseif parsed RSS object display the RSS 
+  else solicit user for a URL 
+*}
+
+{if $error }
+<b>Error:</b> {$error}
+{elseif $rss}
+<table border=1>
+  <tr>
+    <th colspan=2>
+      <a href="{$rss->channel.link}">{$rss->channel.title}</a>
+    </th>
+  </tr>
+       {foreach from=$rss->items item=item}
+        <tr>
+         <td>
+         <a href="{$item.link}">{$item.title}</a>
+         </td>
+         <td>
+          {$item.dc.date|rss_date_parse|date_format:"%A, %B %e, %Y"}
+         </td>
+       </tr>
+       {/foreach}
+</table>
+{else}
+  Enter the URL of an RSS file to display.
+{/if}
+
+</body>
+</html>