 |
06-05-2007, 09:27 PM
|
#1 | | Member Feedback Score: 0 reviews
Join Date: Oct 2005 Location: N.C.
Posts: 96
| Show recent threads on NON vb html page (Another site) I have a few forums I host for various race tracks.. I would like to display there last 10 threads of their forum on the homepage of their site. Is this possible?
I found this link HowTo Display Latest Active Threads on ANY normal HTML page - vBulletin Community Forum
But not sure what I am doing wrong..
Here is the code I have put on my external page. Quote:
<!-- show latest active threads -->
<table cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tbody>
<tr>
<td colspan="2">
<a href="search.php?do=getnew">Latest Active Threads In The County Line Forums</a>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="100%">
<div>
<script type="text/javascript" src="external.php?forumids=109,191,135&type=js"></script>
<script language="" type="text/javascript">
<!--
for (x = 0; x < 10; x++)
{
document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> (Posted By: "+threads[x].poster+")<br />");
}
//-->
</script></div>
</td>
</tr>
</tbody>
<!-- show latest active threads -->
</table>
| Forums I am trying to pull feeds from HERE
Page created HERE
I don't plan on using a single page, once I get it working I would like to put it in a table on the home page. |
| |
06-05-2007, 10:33 PM
|
#2 | | Forum Enthusiast Feedback Score: 4 reviews
Join Date: Sep 2005 Location: Alabama
Posts: 2,483
| If you use Javascript to pull the threads you won't get rewritten urls since javascript is a client side scripting language. You should use a PHP program such as simple pie to do it.
Here is my php code the shows the 15 latest threads on my sidebar that can be seen here: Ford Mustang | Mustang Forums for Ford Mustang Enthusiasts Code: <div class="dsl-content">
<div class="dsl-content-in">
<ul>
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/php/simplepie.inc');
$feed = new SimplePie();
$feed->feed_url('http://www.mustangevolution.com/forum/external.php?type=RSS2&forumids=257,275,256,134,279,142,282,255,133,258,207,125,169,285,281,246,303,302,233,227,204,268');
$feed->cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');
$feed->init();
$feed->handle_content_type();
$max = $feed->get_item_quantity(15);
for ($x = 0; $x < $max; $x++) {
$item = $feed->get_item($x);
$url = $item->get_permalink();
$title = $item->get_title();
echo "<li style=\"list-style: none; padding-bottom: 9px;\"><a style=\"border: 0px;\" href=\"$url\">$title</a></li>";
}
?>
</ul>
</div>
</div> You can download Simplepie here: SimplePie: Super-fast, easy-to-use, RSS and Atom Parsing. |
| |
06-05-2007, 11:09 PM
|
#3 | | Member Feedback Score: 0 reviews
Join Date: Oct 2005 Location: N.C.
Posts: 96
| Quote:
Originally Posted by BamaStangGuy If you use Javascript to pull the threads you won't get rewritten urls since javascript is a client side scripting language. You should use a PHP program such as simple pie to do it.
Here is my php code the shows the 15 latest threads on my sidebar that can be seen here: Ford Mustang | Mustang Forums for Ford Mustang Enthusiasts Code: <div class="dsl-content">
<div class="dsl-content-in">
<ul>
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/php/simplepie.inc');
$feed = new SimplePie();
$feed->feed_url('http://www.mustangevolution.com/forum/external.php?type=RSS2&forumids=257,275,256,134,279,142,282,255,133,258,207,125,169,285,281,246,303,302,233,227,204,268');
$feed->cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');
$feed->init();
$feed->handle_content_type();
$max = $feed->get_item_quantity(15);
for ($x = 0; $x < $max; $x++) {
$item = $feed->get_item($x);
$url = $item->get_permalink();
$title = $item->get_title();
echo "<li style=\"list-style: none; padding-bottom: 9px;\"><a style=\"border: 0px;\" href=\"$url\">$title</a></li>";
}
?>
</ul>
</div>
</div> You can download Simplepie here: SimplePie: Super-fast, easy-to-use, RSS and Atom Parsing. | Thanks I'll check that out.. Like what you have done with your site.. |
| |
06-05-2007, 11:39 PM
|
#4 | | Member Feedback Score: 0 reviews
Join Date: Oct 2005 Location: N.C.
Posts: 96
| Looks like this is for a php page.. All the pages I have created are html.. the site I want to show the recent threads on are not on the same server and have different urls.. I do not want to create a entire new page..
I want to display the posts from THIS forum on THIS site.
I know there has got to be a way to do this, Just can't find it right now.. |
| |
06-06-2007, 03:08 AM
|
#5 | | Member Feedback Score: 0 reviews
Join Date: Oct 2005 Location: N.C.
Posts: 96
| Here you go works great Build a Feed You Can Cut 'n Paste
Results.. I know I need to dress it up a bit but other than that it does the trick..
Bottom right. County Line Raceway |
| |
06-06-2007, 03:09 AM
|
#6 | | Forum Addict Feedback Score: 3 reviews
Join Date: Jul 2006 Location: Australia
Posts: 1,625
| I don't know if this helps: Google AJAX Feed API
__________________ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
| | vBulletin Setup > Software & Tech > Software > vBulletin |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT +1. The time now is 09:54 AM. |