vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   another members data on non vb page :) (https://vborg.vbsupport.ru/showthread.php?t=58532)

corsacrazy 11-11-2003 02:23 PM

another members data on non vb page :)
 
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

PHP Code:

$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

PHP Code:

$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


Code:

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.

PHP Code:

$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


All times are GMT. The time now is 02:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01005 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete