vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   adding field to $vbulletin->userinfo (https://vborg.vbsupport.ru/showthread.php?t=192657)

DragonBlade 10-04-2008 09:47 AM

adding field to $vbulletin->userinfo
 
I am attempting to create my first plugin, a system for "points" with a simple but powerful shop.

So far, I have been coding it just as I would any PHP script, without worrying about hooks (I don't really understand them yet, tbh). However, it seems I've come to a point where I'll either have to edit the source (a "hack" as opposed to a Plugin) or learn something. XD

I would like to have a field from the users table loaded into the $vbulletin->userinfo array, a field called "shoppe_points". This would make it simpler for me so that I don't have to write a specific query to get the value every time I need it.

So, my question is thus--can I use these "hook" thingies to do just that for me? Or should I edit the source code? (I've read that the latter is unpreferred due to files getting over-written upon updating, thus wiping away any hacks made to it.)

Please be gentle, vB newbie here.

-Sarteck

MrEyes 10-04-2008 10:12 AM

I am sure I will be corrected if wrong....

however if you add the field you need to the "user" db table the VB backend will pull this into the userinfo objects as these are populated with "select *"

DragonBlade 10-04-2008 10:55 AM

Well, do I feel like an idiot.

YOu are correct MrEyes. I was missing an 'o' in the fieldname I was trying to access. XD


All times are GMT. The time now is 08:12 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.01008 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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