Dismounted - No, that doesn't work ($userinfo[username] contains my username when viewing someone else's profile) - but thanks for replying
Maybe I need to figure out a different way to insert my table...
---------------UPDATE----------------
Ok, there has to be a way.
If you wanted to modify this page:
http://www.scubaaddict.com/scuba-for...stposter&t=162
how would you get to that user's id, or username? It isn't in a variable anywhere. I did a print_r($vbulletin) and there is nothing with that users id or username on the above page, so how does it display the username on that page?
---------------UPDATE----------------
The only way I see to get the userid on the member profile is to drop in a conditional in the include that queries based on the querystring parameter provided.
PHP Code:
if (isset($_GET['u'])) {
$profile_uid =$_GET['u'];
} elseif (isset($_GET['find']) && ($_GET['find'] == 'lastposter') && (isset($_GET['t']))) {
mysql_select_db("message_boards");
$sql = "SELECT post.userid FROM thread LEFT JOIN post on thread.lastpostid = post.postid WHERE thread.threadid = ".$_GET['t'];
$profile_query = mysql_query($sql);
$profile_result = mysql_fetch_array($profile_query);
$profile_uid = $profile_result['userid'];
} elseif (isset($_GET['find']) && ($_GET['find'] == 'lastposter') && (isset($_GET['f']))) {
mysql_select_db("message_boards");
$sql = "SELECT post.userid FROM forum LEFT JOIN post on forum.lastpostid = post.postid WHERE forum.forumid = ".$_GET['f'];
$profile_query = mysql_query($sql);
$profile_result = mysql_fetch_array($profile_query);
$profile_uid = $profile_result['userid'];
}
It works for me whether they click on the users name in the forum, thread or post view.
Seems expensive, so if anyone knows of a better way, please let me know.
Addict