compile_check = true; // url of an rss file $url = $_GET['rss_url']; if ( $url ) { // assign a variable to smarty for use in the template $smarty->assign('rss_url', $url); // use MagpieRSS to fetch remote RSS file, and parse it $rss = fetch_rss( $url ); // if fetch_rss returned false, we encountered an error if ( !$rss ) { $smarty->assign( 'error', magpie_error() ); } $smarty->assign('rss', $rss ); $item = $rss->items[0]; $date = parse_w3cdtf( $item['dc']['date'] ); $smarty->assign( 'date', $date ); } // parse smarty template, and display using the variables we assigned $smarty->display('simple.smarty'); ?>