PDA

View Full Version : "Latest Threads" on Separate Server


Trommsdorff
05-12-2002, 05:58 AM
Hello All,

I think this is my first post on the .org boards of vBulletin, so a big "hola" to all you other helpful webmasters.

I did a few searches looking for how to do this, but didn't find what I'm looking for. I've also been driving all day so I'm definately not the sharpest tack in the box right now...

Anyways, here's my situation.

I have the vBulletin BB setup at www.mysite.net

I have my "main" site setup at www.mysite.com

They are two separate servers about 1200 miles apart. I want to include a "Latest Threads" type section on my .com site, so that I can direct traffic to my .net vBulletin site.

However, all these "recent topics" hacks (which work great as far as the few I've tried) won't work accross separate servers.

Here are some server info:

My .com server is NT IIS without PHP installed. I tried SSI but that only works when the script or text doc is on the same server.

The .net is a unix server with PHP installed (obviously).

The .com page I wanted to include it can be either .htm or .shtm.

Any suggestsions?

scsa20
05-12-2002, 09:24 AM
hmm...it could be easyer if you just move your main site (the .com one seems like it) over to your board site (which seems like the .net one) and make it so it's like www.mysite.com/forums or something......or if you had PHP on your main site, then you could of done an include statement accross sea ;) but it seems like it doesn't have PHP...so I don't know what to tell you :( I'm sorry :(

Regs
05-12-2002, 05:22 PM
Try this:

https://vborg.vbsupport.ru/showthread.php?s=&threadid=28872&highlight=VBSyndicate

Cheers,

~Regs.

Logician
05-13-2002, 10:26 AM
if you know "very little" PHP, you can modify this code according to your needs:

-- cut --
<table width="100%" border="0" cellspacing="1" cellpadding="00">

<?php
$servername= "localhost";
$dbusername = "username";
$dbpassword ="password";
$dbname= "dbname";
$forumlocation= "http://domain.com/yourboard/";

mysql_connect("$servername", "$dbusername", "$dbpassword") or die("Couldnt find MYSQL!");
mysql_select_db("$dbname") or die ("Couldnt find DB!");

// Get the latest 10 message from forum 15 and 4
$cekilen_mesleki=mysql_query("
select threadid, title, postusername, postuserid, dateline, forumid
from thread WHERE
visible= '1' AND (forumid='15' OR forumid='4')
order by dateline DESC LIMIT 10
");


if (mysql_error()) {echo "mySQL error:"; echo mysql_error(); exit;}
$mesleki_number=mysql_numrows($cekilen_mesleki); //number of news fetched
if ($mesleki_number<=0) {echo "<tr><td bgcolor=\"#FFFFFF\">No New Message!</td></tr>";}//no news on database!
else {
$ii=1;
while ($gelen= mysql_fetch_row($cekilen_mesleki))
{
if ($ii % 2) {$tdcolor="#FFFFFF";} else {$tdcolor="#eeeeee";}
echo '<td><td bgcolor="'.$tdcolor.'"><a href="'.$forumlocation.'showthread.php?s=&threadid='.$gelen[0].'">'.$gelen[1]."</a><br><i>".$gelen[2]."</i> ";

echo "</td></tr>";
$ii++;
}

} //else kapa parantez
?>

</table>

-- cut --
1- Make the necessary modifications (password, db name etc..)

2- Rename index.html to index.php in www.mysite.com

3- Insert this code to the relevant part of index.php in www.mysite.com