* Pranta <!--parser:xtscript-->
# Outer container
print <div id="xt_feed" class="xt_feed">

# Feed selection menu
var $offset=0
var $action=<xt:url noquery="yes"/>
print <div class="xt_feed_select">
print <form class="form" 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_title=<h2>$feed_title</h2>
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 <div class="xt_feed_title">$feed_title</div>
print <div class="xt_feed_inner">
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)
call substr $val=$feed;$start=$start_item;$length=($end_item-$start_item-6)
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
print <!--/parser:xt_pagination-->
print </div>
# Close outer container
print </div>
<!--/parser:xtscript-->

Join @ http://pranta.usa.cc/forum
2014-07-09 05:30 · (0)

Online: Guests: 1