Help me to change this JS to related post
3 posters
Page 1 of 1
Help me to change this JS to related post
- Code:
<div class='show' id='slidebox'><div class='slidebox-title slidebox-www'><span style='float:left;margin:0 15px;'>Maybe you are interested in</span><span><a href='javascript:void(0);' id='slidebox-close' title='close'>×</a></span><span><a href='javascript:void(0);' id='slidebox-minimize' title='minimize'>−</a></span><span><a href='javascript:void(0);' id='slidebox-maximize' title='maximize'>+</a></span></div><div class='slidebox-container'><ul class='related-post-style-2' id='sliding-tab'/></div></div>
<style>
/* Widget Recommended Content */
#slidebox{background:#fff;width:100%;max-width:355px;height:255px;position:fixed;overflow:hidden;border:none;right:-360px;z-index:99;text-align:left;box-shadow:0 1px 0 0 rgba(0,0,0,0.03);transition:all .4s ease-out}
.slidebox-title{background:#3a5795;color:#fff;display:block;height:45px;line-height:45px;width:100%;font-size:14px;text-transform:capitalize;font-weight:700;letter-spacing:.5px}
.slidebox-title span a{font-family:initial;float:right;height:40px;margin:0 0 0 15px;text-align:center;color:#fff;font-size:20px}
a#slidebox-close,a#slidebox-close{margin-right:15px}
.slidebox-title >span >h2{font-size:20px!important;font-weight:normal!important}
.slidebox-container{border:none;float:left;width:100%;height:auto;margin:3px}
.slidebox-container >div{border:none;margin:3px 0;padding:10px 0}
.slidebox-container >div >span{font-size:14px}
.show{bottom:84px}
.hide{bottom:-205px}
.related-post{font-size:70%}
.related-post h4{font-size:150%;margin:0 0 .5em}
.related-post-style-2{padding-top:5px;list-style:none}
.related-post-style-2 li{padding:0 10px 10px 10px;overflow:hidden}
.related-post-style-2 li:first-child{border-top:none}
.related-post-style-2 .related-post-item-thumbnail img {width:45px;height:45px;max-width:none;max-height:none;border:0;padding:0;border-radius:3px;float:left;margin:2px 10px 0 0}
.related-post-style-2 .related-post-item-title{font-weight:700;font-size:110%;line-height:normal}
a.related-post-item-title{color:#95a5a6;transition:all .4s ease-out}
a:hover.related-post-item-title{color:#2ecc71;text-decoration:none}
.related-post-style-2 .related-post-item-summary{display:block;overflow:hidden}
</style>
<script type="text/javascript">
$(window).scroll(function() {
$("#slidebox").css($(this).scrollTop() > 700 ? {
right: "0px"
} : {
right: "-360px"
});
}), $(document).ready(function() {
var i = $("#slidebox"),
s = $("#slidebox-close"),
o = $("#slidebox-minimize"),
l = $("#slidebox-maximize");
l.hide(), s.click(function() {
i.css({
right: "-350px"
}), i.fadeOut("slow")
}), o.click(function() {
i.toggleClass("hide"), $(this).hide(), l.show()
}), l.click(function() {
i.toggleClass("hide"), $(this).hide(), o.show()
})
});
</script>
<script type="text/javascript">
$(function () {
$.ajax({
url: "/feed/?f={FORUM_ID}",
success: function (ta) {
for (var i = 1; i < 5; i++) {
var DL = $(ta).find("link:eq(" + i + ")").text();
var title = $(ta).find("title:eq(" + i + ")").text();
$('<li><div class="news-item"><div><div class="related-post-style-2"><div class="crop"><a href="' + DL + '" class="related-post-item-thumbnail" rel="bookmark"></a></div><span></span><div style="clear: both;"></div></div></div></div></li>').appendTo('#sliding-tab');
$('<a class="related-post-item-title" href="' + DL + '">' + title + '</a>').appendTo('.news-item:eq(' + (i - 2) + ') .related-post-style-2 span');
$('<img src="' + $(".news-item:eq(" + (i - 2) + ") .crop a:eq(0)").load(DL + ".postbody .messageContent img:eq(0)") + '" alt="Loading.." />').appendTo('.news-item:eq(' + (i - 2) + ') .crop a:eq(0)');
}
}
});
});
</script>
Help me to change this JS.
( url: "/feed/?f={FORUM_ID}",) change this link to ( url: "/search_keywords of topic title) like related post.
Thank you
Re: Help me to change this JS to related post
What does the code do?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Help me to change this JS to related post
helllo : you view code http://www.hotrofm.net/t219-code-recommended-content-cung-chuyen-muc ???
You want code to related-post ? code in viewtopic (code in punbb)
B1.
B2:
You can edit css
You want code to related-post ? code in viewtopic (code in punbb)
B1.
- Code:
<script type="text/javascript">
$(function () {
var hotrofm = '{TOPIC_TITLE}';
var topics = hotrofm.replace(/ /gi, '+');
$('#sliding-tab').load('/search?mode=searchbox&search_keywords=' + topics + '&show_results=topics .tdtopics:not(".tdtopics:contains(\"Announcement\"), .tdtopics:contains(\"Sticky\"), .tdtopics:contains(\"Global announcement\")") .topic-title a.topictitle:lt(8)', function () {
$('#sliding-tab a.topictitle').wrap("<li></li>");
});
});
</script>
B2:
You can edit css
Re: Help me to change this JS to related post
vietkanpy wrote:helllo : you view code http://www.hotrofm.net/t219-code-recommended-content-cung-chuyen-muc ???
You want code to related-post ? code in viewtopic (code in punbb)
B1.
- Code:
<script type="text/javascript">
$(function () {
var hotrofm = '{TOPIC_TITLE}';
var topics = hotrofm.replace(/ /gi, '+');
$('#sliding-tab').load('/search?mode=searchbox&search_keywords=' + topics + '&show_results=topics .tdtopics:not(".tdtopics:contains("Announcement"), .tdtopics:contains("Sticky"), .tdtopics:contains("Global announcement")") .topic-title a.topictitle:lt(8)', function () {
$('#sliding-tab a.topictitle').wrap("<li></li>");
});
});
</script>
B2:
You can edit css
I need this code for PHPBB3.
Re: Help me to change this JS to related post
Please only post links to tutorials in English as this is the official English support forum.vietkanpy wrote:helllo : you view code http://www.hotrofm.net/t219-code-recommended-content-cung-chuyen-muc ???
You want code to related-post ? code in viewtopic (code in punbb)
B1.
- Code:
<script type="text/javascript">
$(function () {
var hotrofm = '{TOPIC_TITLE}';
var topics = hotrofm.replace(/ /gi, '+');
$('#sliding-tab').load('/search?mode=searchbox&search_keywords=' + topics + '&show_results=topics .tdtopics:not(".tdtopics:contains("Announcement"), .tdtopics:contains("Sticky"), .tdtopics:contains("Global announcement")") .topic-title a.topictitle:lt(8)', function () {
$('#sliding-tab a.topictitle').wrap("<li></li>");
});
});
</script>
B2:
You can edit css
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» related topic wedget / latest post widget ???
» Changing posting option from "SEND" to "POST"
» Post transfer or date of the post change
» Profile Post Info Change
» Can We change post content ?
» Changing posting option from "SEND" to "POST"
» Post transfer or date of the post change
» Profile Post Info Change
» Can We change post content ?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum