vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




How to list recent threads on another page

Susan
02-05-2006, 02:40 PM
How can you create links to recent threads on a vb forum on another html page within the site. Does this require special php coding?

I want to list the latest 5 new threads on my about.html page. Any tips or suggestions?

thanks

Taylor
02-05-2006, 04:11 PM
You will be happy to learn vBulletin provides an xml feed via external.php
<table width="400">
<tr>
<td><span style="font-size:large;font-weight:bold;text-decoration:underline;"> Forum Activity</span></td>
</tr>
<script src="http://www.yourdomain.com/forum/external.php?type=js" type="text/javascript"></script>
<script type="text/javascript">
<!--
for (i = 0; i < 10; i++)
{
document.writeln("<tr><td>");
document.writeln("<strong><a href=\"http://www.yourdomain.com/forum/showthread.php?threadid="+threads[i].threadid+"\">"+threads[i].title+"</a></strong><br/></td>");
document.writeln("<td>Posted By:<strong>"+threads[i].poster+"</strong></td></tr>");
}
//-->
</script>
</table>

You could insert the table into an exiting page if you wish. You can adjust the records returned like so: for (i = 0; i < 10; i++) maybe you only wish 5: for (i = 0; i < 5; i++)

Hope this helps..

que
02-12-2006, 09:50 AM
Hey that's cool taylor. I may try it in my next newsletter..

ivankan
09-10-2006, 07:32 PM
urs one is great.. just some more question, which part should i adjust in order to show the subforum instead of forum, and do u know how to display the most popular topic in html on the other page. thanks

Noppid
09-10-2006, 08:22 PM
Here is a tutorial and code to do this with a table I coded some time ago.

Latest vBulletin Threads on HTML Pages with Javascript (http://www.cpurigs.com/forums/showthread.php?t=1951)

Noppid
09-10-2006, 08:24 PM
urs one is great.. just some more question, which part should i adjust in order to show the subforum instead of forum, and do u know how to display the most popular topic in html on the other page. thanks

You can select specific forums with the addition of a variable to the URL.

To display only the threads in forums 1,2,3 add...


&forumids=1,2,3


to the URL od the feed. But be aware, you will be limted then to displaying only those forum's threads.

ivankan
09-11-2006, 04:19 AM
again, i copy the code and change the yourdomain to my site, but still nothing appear except FORUM ACTIVITY... is there any more thing i need to amend

Noppid
09-11-2006, 05:24 AM
Why don't you show us an example so we can get a better idea?

ivankan
09-18-2006, 07:42 PM
<table width="400"> <tr> <td><span style="font-size:large;font-weight:bold;text-decoration:underline;"> Forum Activity</span></td> </tr> <script src="http://www.bbqsheep.com/forum/external.php?type=js" type="text/javascript"></script> <script type="text/javascript"> <!-- for (i = 0; i < 10; i++) { document.writeln("<tr><td>"); document.writeln("<strong><a href=\"http://www.bbqsheep.com/forum/showthread.php?threadid="+threads[i].threadid+"\">"+threads[i].title+"</a></strong><br/></td>"); document.writeln("<td>Posted By:<strong>"+threads[i].poster+"</strong></td></tr>"); } //--> </script> </table>

then i just put in the <body> of html code in dreamweaver....
wat else need to change

ivankan
09-18-2006, 07:44 PM
i found out quite messy .. i've done it again


<table width="400"> <tr> <td><span style="font-size:large;font-weight:bold;text-decoration:underline;"> Forum Activity</span></td> </tr> <script src="http://www.bbqsheep.com/forum/external.php?type=js" type="text/javascript"></script> <script type="text/javascript">
<!-- for (i = 0; i < 10; i++)
{ document.writeln("<tr><td>");
document.writeln("<strong>
<ahref="http://www.bbqsheep.com/forum/showthread.php?threadid="+threads[i].threadid+"\">
"+threads[i].title+"</a></strong><br/></td>");
document.writeln("<td>Posted By:<strong>"+threads[i].poster+"</strong></td></tr>"); } //--> </script> </table>

Noppid
09-18-2006, 07:57 PM
Actually. I meant a link to it live. I'd like to see the result.

ivankan
09-24-2006, 04:13 PM
http://www.bbqsheep.com/

Noppid
09-24-2006, 04:17 PM
Where is the output supposed to appear? I see what may be one thread link in the middle. Is that it?

EDIT:

Move this line of code to the header and see what happens.

<script src="http://www.bbqsheep.com/forum/external.php?type=js" type="text/javascript"></script>

I didn't check this is a debugger, there may be other issues.

ivankan
09-24-2006, 04:17 PM
that's the result
http://www.bbqsheep.com/

Noppid
09-24-2006, 04:51 PM
I see no change, put this line of code above the <head> tag.

<script src="http://www.bbqsheep.com/forum/external.php?type=js" type="text/javascript"></script>

ivankan
09-25-2006, 01:34 AM
still no change

Noppid
09-25-2006, 05:39 AM
hehe, there is no out put from your external data feed at all. Is it enabled in the ACP?

ivankan
09-25-2006, 10:19 PM
where can i enable it

friscogal
09-25-2006, 11:43 PM
Here is a tutorial and code to do this with a table I coded some time ago.

Latest vBulletin Threads on HTML Pages with Javascript (http://www.cpurigs.com/forums/showthread.php?t=1951)

noppid, can i do this to my myspace acct?

Noppid
09-26-2006, 05:02 AM
noppid, can i do this to my myspace acct?


I have no idea how myspace works. But if you can add javascript to a myspace page, I would think so.


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum