• BLOG AiSEO
#
# Number of random posts to display in the list
var $posts_to_display=5
# Check for post or post list
get __xtblog_entry
if not $__xtblog_entry
# Convert the post list into a javascript array
# Trim data
var $trim_start=call strpos $haystack=$blog_list;$needle=div class="xt_item"
var $trim_end=call strrpos $haystack=$blog_list;$needle=span
var $blog_list=call substr $val=$blog_list;$start=-1;$length=6
# Remove carriage returns
var $cr=call urldecode $val=%0A
var $blog_list=call str_replace $subject=$blog_list;$search=$cr;$replace
# Remove excess white space
var $ws=call urldecode $val=++
var $blog_list=call str_replace $subject=$blog_list;$search=$ws;$replace
# Separate into array elements
var $close_div=call urldecode $val=%3C%2Fdiv%3E
var $blog_list=call str_replace $subject=$blog_list;$search=$close_div;$replace=$close_div','
var $blog_list='$blog_list$close_div'
# Set up the standard blog post list divs (#encoded to protect building tool#)
call urldecode $val=%3Cdiv+class%3D%22xt_blog_parent%22+id%3D%22xt_blog%22%3E%3Cdiv+class%3D%22xt_list%22%3E%3Cdiv+class%3D%22xt_blog_post_list%22%3E
# Output the random post list
print
# Close the post list divs
print $close_div$close_div$close_div
else
# Fix a bug in the comment form
var $blog_list=call str_replace $subject=$blog_list;$search=name="__xtblog_entry" value="";$replace=name="__xtblog_entry" value="$__xtblog_entry"
# Output the post
print $blog_list
endif
;=1