<!DOCTYPE html >
<html lang="en">
<head>
<meta name="robots" content="noindex , nofollow" />
<!--parser:xtscript-->
get page
assign $page=test_post
# Set the target landing page
assign $target=http://syntax.xtgem.com/manual/basics/default_1.html
# Get the blog posts html
assign $blog=<xt:blog version="1" entries_per_page="1000" />
# Strip out the excess html and convert the data to post name and __xtblog_entry value separated by |
assign $blog=call strip_tags $val=$blog;$allowable_tags=<a><br>;
assign $remove=call strpos $haystack=$blog;$needle=xtblog_entry;
assign $remove=call substr $val=$blog;$start=0;$length=($remove+12)
assign $blog= call str_replace $subject=$blog;$search=$remove;$replace
assign $blog= call trim $val=$blog
assign $blog= call str_replace $subject=$blog; $search=#xt_blog"> ;$replace=|
assign $blog= call str_replace $subject=$blog; $search=</a> <br />; $replace=|
#get the size of the data
assign $data_length=call strlen $val=$blog
# Find the entry with the same name as the blog post
assign $name_pos=call strripos $haystack=$blog;$needle=|$page|
# Get  the value of __xtblog_entry for this name
assign $entry_pos=call strripos $haystack=$blog;$needle==;$offset=-($data_length-$name_pos)
assign $blog_entry=call substr $val=$blog;$start=($entry_pos+1);$length=24
# Javascript to redirect to the landing page with the value of __xtblog_entry set in the URL 
print {{
<script type="text/javascript">
location.href='$target?page=$page&__xtblog_entry=$blog_entry';
</script>
<noscript>
<meta http-equiv="refresh" content="1;$target?func=$page&__xtblog_entry=$blog_entry" />
</noscript>}}

<!--/parser:xtscript-->
    <title>XtGem.com</title>
</head>
<body style="display:none">
</body>
</html>
