Quote:
Originally Posted by Choo
In my last project I had the same task and I think I can help you.
At first you need to include global php such way (it is important):
PHP Code:
$dir = getcwd();
chdir(PATH_TO_VB);
require './global.php';
chdir($dir);
After that you can work with vb's superobject using $GLOBALS['vbulletin'] variable. You mentioned 2 problems - last posts and authentification. OK... To get last posts you can use something like that:
PHP Code:
function get_posts($threadid)
{
$posts = array();
$query = $vbulletin->db->query_read("SELECT * FROM post ORDER BY dateline DESC LIMIT 10");
while($post = $vbulletin->db->fetch_array($query)) $posts[] = $post;
return $posts;
}
Where $vbulletin is vb's superobject.
And now about users. Look at $vbulletin->userinfo property, it contains information about logged user.
|
Saint! It works! Thanks for everything! One quick question: How would I show a users avatar?
--------------- Added [DATE]1240006133[/DATE] at [TIME]1240006133[/TIME] ---------------
Quote:
Originally Posted by ScottC2105
Saint! It works! Thanks for everything! One quick question: How would I show a users avatar?
|
I got it, just link to
http://forum_url_here/image.php?u=USER_ID_HERE and I can use $vbulletin->userinfo['id'] for USER_ID_HERE.

.