Today I would ask you a way to move a widget in bottom (before or after sceditor, idk) or in case it's too hard, would be good on top.
I tried using this code to move the widget on top:
- Code:
$(function(){
var forumname = 'Similar Topics';
$('.module:contains("' + forumname + '")').css('width', '100%').detach().prependTo('#main-content');
});
but it gives me a blank page with only "View all similar topics", how can I solve this?
This is the widget code by ange:
- CODE:
- Code:
<style type="text/css">
#fa_topics_similar a {
font-size:10px;
font-weight:normal;
display:block;
padding:3px; 0;
}
#fa_topics_similar a b {
font-weight:normal;
}
#fa_ts_more {
text-align:center;
font-weight:bold;
margin-top:3px;
}
</style>
<div id="fa_topics_similar">
</div><script type="text/javascript">//<![CDATA[
(function() {
var amount = 5,
lang = {
see_more : 'View all similar topics',
loading : 'Finding similar topics...',
error_node : '<code>#fa_topics_similar</code> is null',
error_version : 'Forum version could not be identified'
},
url = '/search?search_keywords=',
node = document.getElementById('fa_topics_similar'),
temp = document.createElement('DIV'),
topics,
hideModule = function(node) {
switch (node.parentNode.tagName) {
case 'TD' : // phpbb2
jQuery(node).closest('.forumline').hide();
break;
case 'DIV' : // phpbb3, punbb, invision
jQuery(node).closest('.module').hide();
break;
default :
document.write('<p style="color:#F30;font-size:12px;">' + lang.error_version + '<p>');
break;
}
};
if (/\/t\d+/.test(window.location.href) && node) {
url += encodeURIComponent(document.title.replace(/(.*?)(?:\s-\s.*)/, function(M, S) { return S }));
node.innerHTML = lang.loading;
jQuery.get(url + '&change_version=prosilver', function(d) {
topics = jQuery('a.topictitle', d);
node.innerHTML = '';
if (topics[0]) {
for (var i = 0, j = amount + 1; i < j; i++) {
if (topics[i]) {
topics[i].href = topics[i].href.replace(/\?.*/, '');
if (!new RegExp(topics[i].href).test(window.location.href)) {
jQuery('.coloradmin', topics[i]).removeAttr('style class');
temp.appendChild(topics[i]);
}
}
}
node.appendChild(temp);
} else {
hideModule(node);
}
});
document.write('<div id="fa_ts_more"><a href="' + url + '">' + lang.see_more + '</a></div>');
} else if (node) {
hideModule(node);
} else {
document.write('<p style="color:#F30;font-size:12px;">' + lang.error_node + '<p>');
}
}());
// par ange tuteur
//]]></script>
It works good, and it shows up only in topics, but i'm not able to move it on bottom (or top)
Thank you!
Last edited by Simone Boi on December 18th 2020, 12:50 pm; edited 1 time in total