<!--parser:xtscript--> # Default feed ( title and url separate with | ) var $default_feed=Yahoo world news|https://uk.news.yahoo.com/rss/world # More Feeds ( title and url separate with | ) ( feed data chunks separate with , I use separate lines for clarity ) var $feeds=$default_feed,BBC world news|http://feeds.bbci.co.uk/news/world/rss.xml var $feeds=$feeds,Yahoo oddly enough|https://uk.news.yahoo.com/rss/oddly-enough var $feeds=$feeds,BBC science and enviroment news|http://feeds.bbci.co.uk/news/science_and_environment/rss.xml # Other settings var $per_page=3 var $items=0 var $time_ago=1 var $template=<a href=".link." target="_blank"><span class="title">.title.</span></a><div class="post"><div class="descr">.description.<div class="meta"><span name="pubdate">.pubDate.</span></div></div></div> get feed # Cookies if $feed call cookie::set $name=last_feed;$val=$feed;$expire=2419200;$force_current=1 else var $feed=call cookie::get $name=last_feed;$default=$default_feed endif <!--/parser:xtscript-->Copy code
# Feed selection menu var $offset=0 var $action=<xt:url noquery="yes"/> print <div class="controls compo"> print <form class="" action="$action" method="post"> print <select class="select" name="feed"> @loop0 var $next_feed = call strpos $haystack=$feeds,;$needle=,;$offset=$offset if not $next_feed goto @end_select endif var $this_feed= call substr $val=$feeds,;$start=$offset;$length=($next_feed-$offset) var $split=call strpos $haystack=$this_feed;$needle=| var $option_title=call substr $val=$this_feed;$start=0;$length=$split if $feed==$this_feed print <option value="$this_feed" selected="selected"> else print <option value="$this_feed"> endif print $option_title</option> var $offset=($next_feed+1) goto @loop0 @end_select # Submit and close form print </select><input class="xt_button submit" type="submit" value="go"/></form></div> # Main RSS function call var $feed_split=call strpos $haystack=$feed;$needle=| var $feed_title=call substr $val=$feed;$start=0;$length=$feed_split var $feed_url= call substr $val=$feed;$start=($feed_split+1) get_or_default __xt_content_page;1 var $count=1 var $offset=2 var $template=call htmlspecialchars $val=$template var $feed=<xt:feed feed="$feed_url" number="$items" template="||$template" />|| var $feed_end=call strlen $val=$feed
print <!--parser:xt_pagination--> @loop var $start_item=$offset var $end_item=call strpos $haystack=$feed;$needle=||;$offset=$offset if not $count > ($__xt_content_page*$per_page) or not $count <= ($__xt_content_page-1*$per_page) print <div class="thread"> call substr $val=$feed;$start=$start_item;$length=($end_item-$start_item-6) print </div> endif
if $count==$per_page print <!--parser:xt_page_split--> var $count=0 endif var $offset=($end_item+2) if $offset < $feed_end var $count=($count+1) goto @loop endif