vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   $userinfo[x] pulls the same info for all users...not the owner of the page. (https://vborg.vbsupport.ru/showthread.php?t=168698)

ArchangelX 01-25-2008 04:17 AM

$userinfo[x] pulls the same info for all users...not the owner of the page.
 
I'm trying to pull information from the Member Profile for use in a different custom template. I have included globals.php in the php file.

The problem I'm having is that when I place the following code, and view the template, no matter whose custom page I'm looking at, it shows MY userinfo, and not theres. I'm trying to pull specifically each users OWN information to display on their custom page.

Code:

<td rowspan="2" nowrap class="alt2">$userinfo[field19][/td]
I've done an exhaustive search and I can't find anyone relating this problem. I'm a newbie to coding...so I'd appreciate some help on why it's not showing the person who owns the page's info.

I thought that $userinfo pulls the owner, and $bbuserinfo pulls the viewer's info right? Thanks for the help.

cheesegrits 01-25-2008 04:27 AM

You'll need to specifically load the userinfo for the target userid:

Code:

$profile_userinfo = verify_id('user', $userid, 1, 1);
.... where $userid is the userid which owns the profile you are looking at. Don't know how you are deriving that, but you should have it somewhere in your code.

Also, note the $profile_userinfo instead of $userinfo. It's generally a good idea not to mess with $userinfo, as this can have unforeseen consequences!

-- hugh

ArchangelX 01-25-2008 04:35 AM

Thanks Hugh...I understand what you're getting at, but I think I'm a little overwhelmed. Maybe I'll just create another table entry, as I know how to do that. Gaaaar.

I'm going to start a custom mod soon...and that will hopefully help me understand more about PHP. Right now, I'm just modifying an existing custom template. :(

cheesegrits 01-25-2008 05:13 AM

Which template are you modifying?

-- hugh

Opserty 01-25-2008 12:04 PM

PHP Code:

// Browsing User's info (in templates): $bbuserinfo 
// Browsing User's info (in PHP Code): $vbulletin->userinfo;

// To get someone elses:
$userid X// Change X to which ever user you want
$userinfo fetch_userinfo($userid);
// X's User Info: $userinfo 

Not sure as to what you are asking exactly, maybe that helps you though.

cheesegrits 01-25-2008 02:24 PM

I'm asking because I'm trying to help you.

But that isn't a template, that's PHP code.

-- hugh

Opserty 01-25-2008 02:52 PM

Quote:

Originally Posted by cheesegrits (Post 1428708)
I'm asking because I'm trying to help you.

But that isn't a template, that's PHP code.

-- hugh

Make sure you read who posted the message next time :p

My post was aimed at the original poster :D

cheesegrits 01-25-2008 04:02 PM

Ooops. Sorry!

I should know better than to post on vborg before I finish my first cup of coffee.

-- hugh


All times are GMT. The time now is 03:46 AM.

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.02736 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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