PDA

View Full Version : adding field to $vbulletin->userinfo


DragonBlade
10-04-2008, 09:47 AM
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