Hello again!
It's been a while. How y'all doing?
Please, be aware the stuff below is copyrighted! Thank you.
We've got 2 scripts running on our website. 1 'Preview topics' script running on the sub-forums:
in effect giving us something like this in the subs: http://prntscr.com/a5w4xa , and 1 custom built and copyrighted 'Latest Topics' script (running on all the pages):
giving us something like this: http://prntscr.com/a5w5bt .
Also, we've got a special 'Block Users from Viewing the topics' JS in place, running on the Index as well as the topics:
Now, in the 'Latest topics' table, we want the same 'Preview Topic' symbol and function like in the first script, combining the two, just behind the topic titles. Could someone please built us a properly functioning script for that?
Thanks in advance.
Forum version: phpBB3
Forum address: http://www.friendcodes.nl
It's been a while. How y'all doing?
Please, be aware the stuff below is copyrighted! Thank you.
We've got 2 scripts running on our website. 1 'Preview topics' script running on the sub-forums:
- Code:
$(function(){
var isPunbb = '';
if ($('.pun').length) var isPunbb = 'class="pun"';
$('a.topictitle').after(' <img id="topicPreview" src="http://i56.servimg.com/u/f56/18/45/41/65/new_wi10.gif" title="Voorbeeldweergave" alt="Voorbeeldweergave" style="cursor:pointer;"/>');
$('img#topicPreview').click(function() {
$('body').append('<div id="preview-filter" style="position:fixed;left:0;right:0;top:0;bottom:0;background:url(http://i39.servimg.com/u/f39/18/21/41/30/overla10.png);cursor:pointer;z-index:10;"></div><div id="topicPreview-container" '+isPunbb+' style="width:auto;top:20%;left:15%;right:15%;padding:4px;position:fixed;z-index:50;background:#EEE;border:1px solid #CCC;border-radius:5px;"><div id="topicPreviewing" style="max-height:460px;overflow-y:auto;"><center><span class="topicPreview-loading" style="font-weight:bold;font-size:16px;">Momentje. Bezig met laden ...</span></center></div></div>');
$('#topicPreviewing').load($(this).siblings('a.topictitle').attr('href')+' .post:eq(0)');
$('#preview-filter').click(function(){$('#preview-filter, #topicPreview-container').remove()});
});
});
in effect giving us something like this in the subs: http://prntscr.com/a5w4xa , and 1 custom built and copyrighted 'Latest Topics' script (running on all the pages):
- Code:
$(function(){
var a ="";
$('#right').css('display','none');
a = $('#right .module .inner').html();
if(a=== null){ return; };
$('.introduction').after('<div class="forabg"><div class="inner rctopicslist"><span class="corners-top"></span><ul class="topiclist"><li class="header"><dl class="icon"><dd class="rctoptitle"><div class="table-title"><h2>Meest Recente Berichten</h2></div></dd><dd class="rctoptime"><span>Datum \& Tijd</span></dd><dd class="rctopauthor"><span>Auteur</span></dd></dl></li></ul></div></div>');
a = a.replace(/<a href="\/t(.*)<\/a><br>/g,'<div id="topicc"><span id="rctitle"><a href="\/t$1</a></span>').replace(/<a href="\/u(.*)\/a>/g,'<span id="author"><a href="/u$1/a></span><span id="thedate">').replace(/<br><br>/g,'</span></div>');
$('#right .module .inner').html(a);
$('.module .inner #topicc').each(function(){
var l = $(this).find('#rctitle').html();
var m = $(this).find('#author').html();
var n = $(this).find('#thedate').html();
$('.rctopicslist').append('<ul class="topiclist rcforums"><li class="rcrow"><dl class="icon"><dd class="rctoptitle"><div class="table-title"><h2>'+l+'</h2></div></dd><dd class="rctoptime"><span>'+n+'</span></dd><dd class="rctopauthor"><span>'+m+'</span></dd></dl></li></ul>');
});
});
giving us something like this: http://prntscr.com/a5w5bt .
Also, we've got a special 'Block Users from Viewing the topics' JS in place, running on the Index as well as the topics:
- Code:
$(function(){
if(_userdata.session_logged_in==0){
if(location.href.match(/\/t\d+-(.*)/)){
alert('Je moet ingelogd zijn om berichten te kunnen bekijken. Registreer je nu op Friendcodes of log in!\n\nYou need to be logged in to be able to watch the topics. Please register with Friendcodes now or log in!');
location.href="/";
}
$('.topiclist a[href^="/t"]').parent().each(function(){
var atext = $(this).html();
var atext2 = atext.replace(/(.*)href="(.*)"(.*)<\/a>/,'$1href="/"$3<font color="red"></font></a>');
$(this).html(atext2);
})}
});
Now, in the 'Latest topics' table, we want the same 'Preview Topic' symbol and function like in the first script, combining the two, just behind the topic titles. Could someone please built us a properly functioning script for that?
Thanks in advance.
Forum version: phpBB3
Forum address: http://www.friendcodes.nl
Last edited by RoXaNNeX on 2/22/2016, 18:11; edited 1 time in total