Display related topics and new topics in the same category
Posted November 19th 2011, 12:43pm
Demo:[spoiler]Image[/spoiler]
Instruction:
[spoiler]Go to Templates >> viewtopic_body, find
<!-- BEGIN promot_trafic -->
<div class="main" id="ptrafic_close" style="display:none">
<div class="main-head clearfix">
<p class="h2">{PROMOT_TRAFIC_TITLE}</p>
<p class="options"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><img src="{TABS_MORE_IMG}" alt="+" align="" border="0" /></a></p>
</div>
</div>
<div class="main" id="ptrafic_open" style="display:''">
<div class="main-head clearfix">
<p class="h2">{PROMOT_TRAFIC_TITLE}</p>
<p class="options"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><img src="{TABS_LESS_IMG}" alt="-" align="" border="0" /></a></p>
</div>
<div class="main-content clearfix">
<!-- BEGIN link -->
» <a href="{promot_trafic.link.U_HREF}" target="_blank" title="{promot_trafic.link.TITLE}">{promot_trafic.link.TITLE}</a>

<!-- END link -->
</div>
</div>
<!-- END promot_trafic -->

Replace it with this code or Put this code above it
<!-- CopyrightNotice='Related topics and new topics. Copyright ©  by Fmvi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script
-->
<table class="forumline" width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td class="thead" height="28">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<h1>
News posts
</h1>
</td>

</tr>
</table>
</td>
</tr>
<tr>
<td id="cungchuyenmuc" class="row2 postbody" valign="top">
</td>
</tr>
</table>
<table class="forumline" width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td class="thead" height="28">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<h1>
Related posts
</h1>
</td>

</tr>
</table>
</td>
</tr>
<tr>
<td id="bailienquan" class="row2 postbody" valign="top">
</td>
</tr>
</table>
<script type="text/javascript">
var CopyrightNotice='Related topics and new topics. Copyright © by Fmvi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script';
$(function () {
$('#cungchuyenmuc').load('/f{FORUM_ID}-forum td:not("td:contains(\"Announcement\"), td:contains(\"Sticky\"), td:contains(\"Global announcement\")") .topic-title a.topictitle:lt(10)', function () {
$('#cungchuyenmuc a.topictitle').wrap("<p></p>");
});
var topictitleFMvi = '{TOPIC_TITLE}';
var fmviTopictitle = topictitleFMvi.replace(/ /gi, '+');
$('#bailienquan').load('/search?mode=searchbox&search_keywords=' + fmviTopictitle + '&show_results=topics td:not("td:contains(\"Announcement\"), td:contains(\"Sticky\"), td:contains(\"Global announcement\")") .topic-title a.topictitle:lt(10)', function () {
$('#bailienquan a.topictitle').wrap("<p></p>");
});
});
</script>
[/spoiler]
[spoiler]Go to Templates >> viewtopic_body >> Find
<!-- BEGIN promot_trafic -->
<div class="main" id="ptrafic_close" style="display:none">
<div class="main-head clearfix">
<p class="h2">{PROMOT_TRAFIC_TITLE}</p>
<p class="options"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><img src="{TABS_MORE_IMG}" alt="+" align="" border="0" /></a></p>
</div>
</div>
<div class="main" id="ptrafic_open" style="display:''">
<div class="main-head clearfix">
<p class="h2">{PROMOT_TRAFIC_TITLE}</p>
<p class="options"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><img src="{TABS_LESS_IMG}" alt="-" align="" border="0" /></a></p>
</div>
<div class="main-content clearfix">
<!-- BEGIN link -->
» <a href="{promot_trafic.link.U_HREF}" target="_blank" title="{promot_trafic.link.TITLE}">{promot_trafic.link.TITLE}</a>

<!-- END link -->
</div>
</div>
<!-- END promot_trafic -->

Replace it with this code or Put this code above it
        <!-- CopyrightNotice='Related topics and new topics. Copyright ©  by Fmvi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script
-->
<div class="main">
<div class="main-head clearfix">
<p class="h2">
New posts
</p>
</div>
<div id="cungchuyenmuc" class="main-content frm">
</div>
<div class="main-head clearfix">
<p class="h2">
Related posts
</p>
</div>
<div id="bailienquan" class="main-content frm">
</div>
</div>
<script type="text/javascript">
var CopyrightNotice='Related topics and new topics. Copyright © by Fmvi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script';
$(function () {
$('#cungchuyenmuc').load('/f{FORUM_ID}-forum .tdtopics:not(".tdtopics:contains(\"Announcement\"), .tdtopics:contains(\"Sticky\"), .tdtopics:contains(\"Global announcement\")") .topic-title a.topictitle:lt(10)', function () {
$('#cungchuyenmuc a.topictitle').wrap("<p></p>");
});
var topictitleFMvi = '{TOPIC_TITLE}';
var fmviTopictitle = topictitleFMvi.replace(/ /gi, '+');
$('#bailienquan').load('/search?mode=searchbox&search_keywords=' + fmviTopictitle + '&show_results=topics .tdtopics:not(".tdtopics:contains(\"Announcement\"), .tdtopics:contains(\"Sticky\"), .tdtopics:contains(\"Global announcement\")") .topic-title a.topictitle:lt(10)', function () {
$('#bailienquan a.topictitle').wrap("<p></p>");
});
});
</script>
[/spoiler]
[spoiler]Go to Modules >> HTML & JAVASCRIPT >> Javascript codes management >> Placement : In the topics
var CopyrightNotice='Related topics and new topics. Copyright ©  by Fmvi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script';
$(function(){$(".topic-actions:last").before("<div style='display:none; font-size: 1.3em; line-height: 1.4em;' id='closeFMvi' class='post row2'><span class='corners-top'><span></span></span><span class='gensmall'><a href='javascript:ShowHideLayer(\"openFMvi\",\"closeFMvi\");'><img border='0' alt='+' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_more' title='+'></a></span><span class='ptrafic'> Bài viết mới cùng chuyên mục</span><span class='corners-bottom'><span></span></span></div><div style='font-size:1.3em;line-height:1.4em' id='openFMvi' class='post row2'><span class='corners-top'><span></span></span><span class='gensmall'><a href='javascript:ShowHideLayer(\"openFMvi\",\"closeFMvi\");'><img border='0' alt='-' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_less' title='-'></a></span><span class='ptrafic'> Bài viết mới cùng chuyên mục</span><div class='clear'></div><div id='cungchuyenmuc'></div><span class='corners-bottom'><span></span></span></div><div style='display:none; font-size: 1.3em; line-height: 1.4em;' id='hideFMvi' class='post row2'><span class='corners-top'><span></span></span><span class='gensmall'><a href='javascript:ShowHideLayer(\"showFMvi\",\"hideFMvi\");'><img border='0' alt='+' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_more' title='+'></a></span><span class='ptrafic'> Bài viết liên quan</span><span class='corners-bottom'><span></span></span></div><div style='font-size:1.3em;line-height:1.4em' id='showFMvi' class='post row2'><span class='corners-top'><span></span></span><span class='gensmall'><a href='javascript:ShowHideLayer(\"showFMvi\",\"hideFMvi\");'><img border='0' alt='-' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_less' title='-'></a></span><span class='ptrafic'> Bài viết liên quan</span><div class='clear'></div><div id='bailienquan'></div><span class='corners-bottom'><span></span></span></div>");var linkchuyenmuc=$("a.nav[href^='/f']:first").attr("href");$('#cungchuyenmuc').load(linkchuyenmuc+' .dterm:not(".dterm:contains(\"Announcement\"), .dterm:contains(\"Sticky\"), .dterm:contains(\"Global announcement\")") .topic-title a.topictitle:lt(10)',function(){$('#cungchuyenmuc a.topictitle').wrap("<p></p>")});var topictitleFMvi=$(".page-title:first").text();var fmviTopictitle=topictitleFMvi.replace(/ /gi,'+');$('#bailienquan').load('/search?mode=searchbox&search_keywords='+fmviTopictitle+'&show_results=topics .dterm:not(".dterm:contains(\"Announcement\"), .dterm:contains(\"Sticky\"), .dterm:contains(\"Global announcement\")") .topic-title a.topictitle:lt(10)',function(){$('#bailienquan a.topictitle').wrap("<p></p>")})});
[/spoiler]
[spoiler]Go to Modules >> HTML & JAVASCRIPT >> Javascript codes management >> Placement : In the topics
        var CopyrightNotice='Related topics and new topics. Copyright ©  by Fmvi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script';
$(function(){$('.topic-options:last').before("<div style='height:20px'></div><div style='display: none;' class='clearfix' id='closeFMvi'><div class='maintitle floated'><h3>Bài viết mới cùng chuyên mục</h3><div class='right rtl-inversion-right'><a href='javascript:ShowHideLayer(\"openFMvi\",\"closeFMvi\");'><img border='0' alt='+' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_more' title='+'></a></div></div></div><div style='' class='clearfix' id='openFMvi'><div class='maintitle floated'><h3>Bài viết mới cùng chuyên mục</h3><div class='right rtl-inversion-right'><a href='javascript:ShowHideLayer(\"openFMvi\",\"closeFMvi\");'><img border='0' align='' alt='-' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_less' title='-'></a></div></div><div id='cungchuyenmuc'></div></div><div style='display: none;' class='clearfix' id='hideFMvi'><div class='maintitle floated'><h3>Bài viết liên quan</h3><div class='right rtl-inversion-right'><a href='javascript:ShowHideLayer(\"showFMvi\",\"hideFMvi\");'><img border='0' alt='+' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_more' title='+'></a></div></div></div><div style='' class='clearfix' id='showFMvi'><div class='maintitle floated'><h3>Bài viết liên quan<span class='fmvilienquan'></span></h3><div class='right rtl-inversion-right'><a href='javascript:ShowHideLayer(\"showFMvi\",\"hideFMvi\");'><img border='0' alt='-' src='http://illiweb.com/fa/empty.gif' class='sprite-tabs_less' title='-'></a></div></div><div id='bailienquan'></div></div>");var linkchuyenmuc=$("a.nav[href^='/f']:first").attr("href");$('#cungchuyenmuc').load(linkchuyenmuc+' .ipbtable .row1:not(".row1:contains(\"Announcement\"), .row1:contains(\"Sticky\"), .row1:contains(\"Global announcement\")") a.topictitle:lt(10)',function(){$('#cungchuyenmuc a.topictitle').wrap("<p></p>")});var topictitleFMvi=$(".maintitle:first h3").text();var fmviTopictitle=topictitleFMvi.replace(/ /gi,'+');$('#bailienquan').load('/search?mode=searchbox&search_keywords='+fmviTopictitle+'ShareActions&show_results=topics .ipbtable .row2:not(".row2:contains(\"Announcement\"), .row2:contains(\"Sticky\"), .row2:contains(\"Global announcement\")") a.topictitle:lt(10)',function(){$('#bailienquan a.topictitle').wrap("<p></p>")})});
[/spoiler]

Note:
  1. The code above only has 10 topics, if you want to increase or decrease it, find a.topictitle:lt(10), and then replace the 10 with the number you want.
  2. It also removes the global announcement, announcement and sticky. If your forum is not English, please change these following words in the code: Announcement, Sticky, Global announcement.
  3. If you want to get the global announcement, announcement and sticky, please remove the following code:
    Phpbb2
            :not("td:contains(\"Announcement\"), td:contains(\"Sticky\"), td:contains(\"Global announcement\")")

    PunBB
            :not("td:contains(\"Announcement\"), td:contains(\"Sticky\"), td:contains(\"Global announcement\")")

    Phpbb3
            :not(".dterm:contains(\"Announcement\"), .dterm:contains(\"Sticky\"), .dterm:contains(\"Global announcement\")")

    Invision
            :not(".row2:contains(\"Announcement\"), .row2:contains(\"Sticky\"), .row2:contains(\"Global announcement\")")
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Display related topics and new topics in the same category
Posted November 19th 2011, 7:59pm
where is this tutorial will be show ? in widget ? or where
φ
Posts:
Avatar
Guest
Display related topics and new topics in the same category
Posted November 19th 2011, 9:02pm
bottom of a topic, before or after of promot_trafic
φ
Posts:
Avatar
Guest
Display related topics and new topics in the same category
Posted November 20th 2011, 5:42am
battuvuong said:
bottom of a topic, before or after of promot_trafic

what do you mean ? under each post ? something like that ?
φ
Posts:
Avatar
Guest
Display related topics and new topics in the same category
Posted November 20th 2011, 7:28am
φ
Posts:
Avatar
Guest
Display related topics and new topics in the same category
Posted December 1st 2011, 5:53pm
Thanks ... it's very awesome.
φ
Posts: 15
Joined: September 22nd 2011, 11:00pm
Location: Yoshi's Island
Display related topics and new topics in the same category
Posted January 19th 2012, 10:29pm
Related topics part works fine but The 'new posts' part does not seem to be working on my forum???
φ
Posts:
Avatar
Guest

Who is online

Users browsing this forum: No registered users and 1 guest