vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Question about bbuserinfo array (https://vborg.vbsupport.ru/showthread.php?t=42008)

Velocd 08-07-2002 01:12 AM

Question about bbuserinfo array
 
You know how in vB you can place $bbuserinfo[username] anywhere and it will output your username from the table user? Well, how can I apply this same effect for a new table? Say I create a table much like user, that I am going to store much of the same data user has in it. Call it newusertable. And I would like to use a new array called $bbuserinfonew with as many elements equal to the amount of columns I have in newusertable. Then after giving the array values, probably done in a while or for loop, I can use $bbuserinfonew[username], say, and it would output that user viewing data, from the new table.

How could this exactly be created? :rolleyes: I haven't had too much use with this kind of coding in PHP yet. :ermm:

If you understand what I'm asking and could help, it would be great! Even directing me to a place in the vB files that I can find a source to look at would be helpful. ;)

Neo 08-07-2002 02:11 AM

*kicks him* :p

Well I can give you a push along in the right direction I hope.

Now start by opening admin/sessions.php, now somewhere around line 50 or so you should see where $bbuserinfo gets declaired.

PHP Code:

  if ($bbuserinfo=$DB_site->query_first("SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.username='".addslashes(htmlspecialchars($loginusername))."'")) { 

around this is logging and password information.

so from that you should be able to make your own query like $bbuserinfo.


- Neo ;)

Velocd 08-07-2002 03:17 AM

Yes, that is what I've been looking for ;)
Thanks abunch.

*limps away* :P

Neo 08-07-2002 04:15 AM

No problem man :)

Admin 08-07-2002 10:56 AM

Velocd: Please remove the text or image from your signature, you are not allowed to have both.

Velocd 08-07-2002 06:53 PM

Done
Sorry about that, I completely forgot. ;)


All times are GMT. The time now is 03:36 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.01009 seconds
  • Memory Usage 1,717KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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