PDA

View Full Version : Displaying some stats on another site ?


TimberFloorAu
03-13-2009, 10:31 PM
Hi.

We are working on a new website, and would like to display.

Members ( number of )
Threads ( number of )
Posts ( number of )

We would like to display the above on another site, is this possible. If so , how so please.

Example:

forum.com

has:
100 members
65 threads
138 posts

we want to display on:

website.com

forum.coms above stats: In a block, like:

Forum.com Stats:
100 members
65 threads
138 posts

Mr-Moo
03-14-2009, 04:09 PM
Are these on the same server?

TimberFloorAu
03-14-2009, 09:44 PM
No.

Mr-Moo
03-15-2009, 02:12 PM
Your best bet would be to create a custom Vbulletin page with all the functions included. Then echo out these statistics. Once these statistics are echoed out, you can include that PHP page onto your desired PHPpage/forum.

On a more complicated side-note, you can use the CURL function to pull data off of an external website source.

First of all, you need to enable curl support for php. To do this, remove the comment (to enable curl operation) from php.ini file

To get a remote file executed, we need to pass http request from a php file. CURL is used for this purpose. Here is a simple example that you can try.

<?php
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, “http://www.YOURFORUM.com/FILE.php”);
curl_setopt($ch, CURLOPT_HEADER, 0);
$file_contents = curl_exec($ch);
curl_close($ch);
// display file
//echo $file_contents;
echo “<pre>”;
print_r($file_contents);
?>

Let me know if this helps!