Log in

View Full Version : classes/functions and user fields


KrU$ty
12-15-2008, 09:46 AM
I was wondering what the correct usage is for a class when i want to use a field for a variable. Here is part of the class im trying to get working:

class Code
{
private $key = $bbuserinfo[fieldx];
private $usercode = $bbuserinfo[fieldx];
private $charcode = $bbuserinfo[fieldx];
private $cachedir = './xmlcache';
private $cachetime = 60;
private $timeformat = "Y-n-d H:i:s";
public $debug = false;
private $msg = array();
private $usecache = false;where $bbuerinfo[fieldx] refers to a user defined field. This class is held in /includes/.

What is the correct usage of the field attribute within a class? Also, how might i use this same method with scripts outside of the vbulletin structure?

Thanks in advance.

Dismounted
12-15-2008, 10:05 AM
What are you trying to do there?

KrU$ty
12-15-2008, 10:16 AM
I'm trying to make it so that specific functions of the class will use the 3 inputed user fields specifed at registration, as each users codes in their specific user field will always be different. These will then be used to authenticate each user for third party xml files used within a third party application.

I'm not much of a php coder, so its a little hard to explain with the correct lingo.

KrU$ty
12-17-2008, 09:12 AM
can anyone help me with this one?

Dismounted
12-17-2008, 10:01 AM
$bbuserinfo does not exist outside of templates. It is usually better to leave the variables null, and assign values to them in your constructor, where the $vbulletin object can be passed into it.