The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to show random posts with javascript on an html page ?
I am currently using a javascript code to display the latest posts from the forum on our site's html homepage. I would like to show also random posts from selected subforums. What should I change in this code to achieve this ?
Code:
<script type="text/javascript" src="http://www.forum.com/forum/external.php?forumids=26,2,43,44,28,3&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 40) { threads[i].title = threads[i].title.substring(0, 40) + '...'; } document.writeln("<li><a href=\"http://www.forum.com/forum/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a> (" + threads[i].poster + ", " + threads[i].threaddate + ") </li>"); } //--> </script> |
#2
|
|||
|
|||
I think you need to have a connection from the database first before showing the posts.. Or calling a function from vbulletin..
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|