* Graham  
This will output a random blog post list entry
This is for version 2 blogs you can add your language settings etc into the blog function
<!--parser:xtscript-->
var $blog=<xt:blog entries_per_page="999" display="5" version="2"/>
get __xtblog_entry
if not $__xtblog_entry
var $last_post=call strrpos $haystack=$blog;$needle=xt_item
var $random=call mt_rand $min=0; $max=($last_post-12)
var $item_start=call strpos $haystack=$blog;$needle=xt_item;$offset=$random
var $item_end=call strpos $haystack=$blog;$needle=/div;$offset=$item_start
var $item=call substr $val=$blog;$start=($item_start-12);$length=($item_end-$item_start+17)
print <div class="xt_blog_parent"> <div class="xt_list"> <div class="xt_blog_post_list">$item</div></div></div>
else
print $blog
endif
<!--/parser:xtscript-->

Copy code


Here is the same code for a version 1 blog
<!--parser:xtscript-->
var $blog=<xt:blog entries_per_page="999" display="5" version="1"/>
get __xtblog_entry
if not $__xtblog_entry
var $last_post=call strrpos $haystack=$blog;$needle=xt_blog_title_link
var $random=call mt_rand $min=0; $max=($last_post-10)
var $item_start=call strpos $haystack=$blog;$needle=xt_blog_title_link;$offset=$random
var $item_end=call strpos $haystack=$blog;$needle=</span><br />;$offset=$item_start
var $item=call substr $val=$blog;$start=($item_start-10);$length=($item_end-$item_start+17)
print <div class="xt_blog" id="xt_blog"> <div class="xt_blog_post_list">$item</div></div>
else
print $blog
endif
<!--/parser:xtscript-->

Copy code
14-03-29 08:41 • (1)

Online: Guests: 1
Uploaded  Length  Views  Rating ||
12