aisais
07-12-2008, 10:00 PM
Hi,
This mini-mod will display last x threads in a marquee above navbar.
I mostly used this code http://www.vbulletin.com/forum/showthread.php?t=158895 by Floris from VB team.
and TIPs from Colin F ( thanx guys )
How to install:
First you have to activate External Source Provider.
Go to: Admin Control Panel > vBulletin Options > External Data Provider:
and choose JavaScript ( first choice ).
Then copy this code and add it right at the top of Navbar template.
<!-- last x active threads -->
<if condition="$vbulletin->options['externaljs']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" HEIGHT="30" align="center">
<tbody>
<tr>
<td class="thead" colspan="2" align="center">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_external')"><img id="collapseimg_forumhome_external" src="$stylevar
[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_external].gif" alt="" border="0" /></a>
<a href="search.php?$session[sessionurl]do=getnew">Last Active Threads</a>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_external" style="$vbcollapse[collapseobj_forumhome_external]">
<tr>
<td class="alt1" width="100%">
<div align="center" style="padding:0pt"><marquee DIRECTION="left" width="100%" height="20" behavior=scroll scrollamount="7" onmouseover="this.stop()" onmouseout="this.start
()"><script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js&lastpost=1"></script></script>
<script language="" type="text/javascript">
<!--
for (var x in threads)
{
document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"&goto=newpost\"><img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/firstnew.gif\" alt=\"\" border=\"0\"
/></a> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <span class=\"smallfont\">($vbphrase[posted_by]: "+threads[x].poster+")
</span> :: ");
}
//-->
</script>
</marquee></div>
</td>
</tr>
</tbody>
</table>
</if>
<!-- last x active threads -->
please be aware that I am not a coder. I just helped myself by collecting some parts of code from here and there. I can't prmise to provide any support for this mod
configuriation:
1- to change number of threads, find this line
for (x = 0; x < 10; x++)and replace 10 with the number you desire.
2- to limit the output to the latest threads in one or more specific forums, find this line
<script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js"></script></script> and change numbers with your forum IDs of choice.
3- you can also adjust scrolling speed and direction pretty easy.
I hope you find this helpful.
** UPDATE ***
Update Notification:
I found this " secret" option lately while reading the tech manuals for Vb.
To have the marquee show the last 10 threads based on LAST POST time ( i.e active threads), please do this:
1- Find:
<script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js"></script>
2- add the option: &lastpost=1 to the end of the script. e.g
<script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js&lastpost=1"></script>
I update the above code to reflect this change and included a text file for reference.
This mini-mod will display last x threads in a marquee above navbar.
I mostly used this code http://www.vbulletin.com/forum/showthread.php?t=158895 by Floris from VB team.
and TIPs from Colin F ( thanx guys )
How to install:
First you have to activate External Source Provider.
Go to: Admin Control Panel > vBulletin Options > External Data Provider:
and choose JavaScript ( first choice ).
Then copy this code and add it right at the top of Navbar template.
<!-- last x active threads -->
<if condition="$vbulletin->options['externaljs']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" HEIGHT="30" align="center">
<tbody>
<tr>
<td class="thead" colspan="2" align="center">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_external')"><img id="collapseimg_forumhome_external" src="$stylevar
[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_external].gif" alt="" border="0" /></a>
<a href="search.php?$session[sessionurl]do=getnew">Last Active Threads</a>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_external" style="$vbcollapse[collapseobj_forumhome_external]">
<tr>
<td class="alt1" width="100%">
<div align="center" style="padding:0pt"><marquee DIRECTION="left" width="100%" height="20" behavior=scroll scrollamount="7" onmouseover="this.stop()" onmouseout="this.start
()"><script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js&lastpost=1"></script></script>
<script language="" type="text/javascript">
<!--
for (var x in threads)
{
document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"&goto=newpost\"><img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/firstnew.gif\" alt=\"\" border=\"0\"
/></a> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <span class=\"smallfont\">($vbphrase[posted_by]: "+threads[x].poster+")
</span> :: ");
}
//-->
</script>
</marquee></div>
</td>
</tr>
</tbody>
</table>
</if>
<!-- last x active threads -->
please be aware that I am not a coder. I just helped myself by collecting some parts of code from here and there. I can't prmise to provide any support for this mod
configuriation:
1- to change number of threads, find this line
for (x = 0; x < 10; x++)and replace 10 with the number you desire.
2- to limit the output to the latest threads in one or more specific forums, find this line
<script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js"></script></script> and change numbers with your forum IDs of choice.
3- you can also adjust scrolling speed and direction pretty easy.
I hope you find this helpful.
** UPDATE ***
Update Notification:
I found this " secret" option lately while reading the tech manuals for Vb.
To have the marquee show the last 10 threads based on LAST POST time ( i.e active threads), please do this:
1- Find:
<script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js"></script>
2- add the option: &lastpost=1 to the end of the script. e.g
<script type="text/javascript" src="external.php?forumids=2,32,35,27,3,12,6,30,31&type=js&lastpost=1"></script>
I update the above code to reflect this change and included a text file for reference.