Front page
Split forum twig
GuestBook Twig
Youtube RSS Xtscript
Paged RSS Xtscript
This sites css
Index
Login
•
Signup
Home
»
Xtscript
»
blog
»
random blog post list entry
» View post
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-->
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-->
#
14-03-29 09:41 •
(1)
Home
»
Xtscript
»
blog
»
random blog post list entry
» View post
Online: Guests: 1
test no4
10
4th test
testing
4
one two three
retest
20
ere we go
test
29
and just a test
slottyslot
KMan2100
DemolitionMissions
VanossGaming
Uploaded
Length
Views
Rating
||
••
1
••
frmtmplt.png
18.2KB
frmtmplt thumb.png
447B
blog.png
6.65KB
balls.png
7.17KB
blog template.png
16.75KB
1
2
»
Log in