* tiaxgame I want to code division
blog band 'TWIG' and
code 'same category'
follow tags
2014-07-12 23:54 · (0)
* tiaxgame paging and same category
2014-07-12 23:55 · (0)
* tiaxgame http://blogtwig.xtgem.com/_xtgem_templates/index/__xtblog_entry/10264087-?__xtblog_block_id=1#xt_blog
2014-07-13 00:12 · (0)
* Graham * tiaxgame This version of "related posts" has the related posts list under the "tags"
The outer div for the related posts now has the class "xt_blog_related_posts"
Showing "related posts" after a new comment has been fixed
The __blog_block_id variable is required for it to work
It is still based on the standard blog twig file so custom twigs may not work depending on what you change
<!--parser:xtscript-->
# </xt:code>
var $blog= <xt:blog tzone="0" format="Y-m-d" display="5" show_time="0" entries_per_page="5" comments_per_page="20" comments_sort="-1" entries_sort="-1" display_limit="0" display_symbol="" version="2" t_back_to_posts="" t_comments="" t_comments_empty="" t_post_a_comment="" t_name="" t_comment="" t_post="" t_tags="" t_search="" t_created="" t_showing_tagged_posts="" t_no_entries_found="" t_no_search_results_found="" t_show_all_comments="" t_see_parent_thread="" t_show_all_replies="" t_show_replies="" t_reply="" t_posting_as="" t_comments_login_required="" t_login="" t_signup="" t_confirm_email="" t_report_spam="" />
# <xt:code>

get __xtblog_entry
if not $__xtblog_entry
print $blog
goto @end
endif
var $blog=call str_replace $subject=$blog; $search=name="__xtblog_entry" value="";$replace=name="__xtblog_entry" value="$__xtblog_entry" 
var $split_pos=call strpos $haystack=$blog;$needle=h2 
var $blog1a=call substr $val=$blog;$start=0;$length=($split_pos-1)
var $blog1b=call substr $val=$blog;$start=($split_pos-1)
var $tag_start=call strpos $haystack=$blog;$needle=__xtblog_tag
if not $tag_start 
print $blog
goto @end
endif
var $tag_start=($tag_start+13)
var $tag_end=call strpos $haystack=$blog;$needle=#;$offset=$tag_start
var $tag=call substr $val=$blog;$start=$tag_start;$length=($tag_end-$tag_start)
var $blog2= <xt:blog entries_per_page="0"  entries_sort="-1" version="2"  display="5" tag="$tag" />
var $blog2= call str_replace $subject=$blog2;$search=__xtblog_block_id=2;$replace=__xtblog_block_id=1
var $blog2= call str_replace $subject=$blog2;$search=id="xt_blog";$replace
var $blog2= call str_replace $subject=$blog2;$search=xt_blog_parent;$replace=xt_blog_related_posts
var $current_datum=call strpos $haystack=$blog2;$needle=$__xtblog_entry
var $blog2a=call substr $val=$blog2;$start=0;$length=$current_datum
var $current_entry_start=call strrpos $haystack=$blog2a;$needle=div class="xt_item"
var $blog2a=call substr $val=$blog2;$start=0;$length=($current_entry_start-1)
var $next_entry_start=call strpos $haystack=$blog2;$needle=div class="xt_item";$offset=$current_datum
if $next_entry_start
var $blog2b=call substr $val=$blog2;$start=($next_entry_start-1)
else
var $blog2b=call urldecode $val=%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E
endif
var $is_entry=call strpos $haystack=$blog2a$blog2b;$needle=div class="xt_item"
if $is_entry 
print $blog1a<h3>Related posts</h3>
print $blog2a$blog2b$blog1b
else
print $blog
endif
@end
<!--/parser:xtscript-->

Copy code

Test for THIS version here
2014-07-13 11:43 · (0)
* tiaxgame * Graham i can't add 'related posts" :(
How do i do!?
2014-07-13 13:45 · (0)
* Graham * tiaxgame This is based on a standard twig file and a blog that is not using other xtscripts it actually uses 2 blog functions one embedded in the other so whether you can use it or not depends on your other scripts
2014-07-13 14:02 · (0)
* Arifmtp * tiaxgame back to the standard
2014-07-13 14:26 · (0)

Online: Guests: 1