PDA

View Full Version : another members data on non vb page :)


corsacrazy
11-11-2003, 02:23 PM
i hav made my own non vb page powered by a template and im lookin to include a certain memebrs data there so if/wen this user updates his/her profile my page will update aswell i was thinkin of sumthin like this.........


bbuserid=2[field5]


if u understand me ? ^^ thanks for reading

Gary King
11-11-2003, 08:39 PM
$bbuserinfo['field5'] is what you're looking for :)

corsacrazy
11-11-2003, 09:05 PM
no because that will post my data or will show each users there data im looking to put a persons info by selecting there id ;) cheers n e ways

Gary King
11-11-2003, 09:45 PM
$userid = "1";

$getinfo=$DB_site->query_first("SELECT userfield.*, user.* FROM user
LEFT JOIN userfield ON (user.userid = userfield.userid)
WHERE user.userid = '".$userid."'");

Change $userid to the user's userid you'd like to get info from, then use $getinfo['field5'], etc.

corsacrazy
11-11-2003, 10:28 PM
thats code looks very promising man..... ill see wot i can do to it but at the mo im getting this error


Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

corsacrazy
11-11-2003, 10:38 PM
ooo i played with it a bit and added $getinfo[field5] instead of $getinfo['field5'] and the info does show up.... BUT i stil get the abouve error info :(

corsacrazy
11-11-2003, 10:46 PM
actually im not getting any errors now lol... i hav successfully intergrated it bar one small thing

$getrinfo[avatarurl] doesnt show.... not so muach of a big deal tho... thanks alot my friend for that query there :P cheers again

Gary King
11-12-2003, 12:51 AM
The following is what I've got :)
Please give at least a big thanks to me for coding this for you :p

Also, the final line shows how you should display the avatar.

$userid = "1";

$getinfo=$DB_site->query_first("SELECT userfield.*, user.* FROM user
LEFT JOIN userfield ON (user.userid = userfield.userid)
WHERE user.userid = '".$userid."'");

################################

// ############### DISPLAY USER'S AVATAR ###############
if ($getinfo['avatarid'] != 0)
{
// using a predefined avatar

$avatar = $DB_site->query_first("SELECT * FROM avatar WHERE avatarid = $getinfo[avatarid]");
$avatarid = $avatar['avatarid'];
eval('$currentavatar = "' . gettemplate('modifyavatarbit') . '";');
// store avatar info in $bbavatar for later use
$bbavatar = $avatar;
// if no category explicitly requested, set to display the category containing user's avatar
//$categoryid = iif($categoryid==0,$avatar['imagecategoryid'],0);

}
else
{
// not using a predefined avatar, check for custom

if ($avatar = $DB_site->query_first("SELECT dateline FROM customavatar WHERE userid=$getinfo[userid]"))
{
// using a custom avatar
if ($vboptions['usefileavatar'])
{
$getinfo['avatarurl'] = "$vboptions[avatarurl]/avatar$getinfo[userid]_$getinfo[avatarrevision].gif";
}
else
{
$getinfo['avatarurl'] = "avatar.php?userid=$getinfo[userid]&dateline=$avatar[dateline]";
}
eval('$currentavatar = "' . gettemplate('modifyavatarbit_custom') . '";');
}
else
{
// no avatar specified
$nouseavatarchecked = HTML_CHECKED;
$avatarchecked[0] = '';
eval('$currentavatar = "' . gettemplate('modifyavatarbit_noavatar') . '";');
}
}
// get rid of any lingering $avatar variables
unset($avatar);

################################

print '<img src="'.$getinfo['avatarurl'].'" border="0" alt="'.$getinfo['username'].'\'s avatar" />';

corsacrazy
11-12-2003, 08:15 AM
long pause. presses refresh on page... BAM avatar shows.



HOWS THIS FOR A BIG THANKS

Gary King
11-12-2003, 11:07 AM
Glad it worked :D