The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Use the print_r() function to see what is inside arrays, objects, etc.
PHP Code:
|
#12
|
|||
|
|||
I Have been searching through the php sources and have to ask what and how is the array $vbulletin->usergroupcache structured and is this array documented any where.
I found this in the API mixed $usergroupcache = null (line 2469) Results for specific entries in the datastore. var: Mixed, though mostly arrays. I have to ask the line 2469 what source file is it in? But that is not a lot of information above so I would like to know the structrue of this array and how ido you uses this array can I asume that it has global scope for my purpose i need to at least have this aviable in the calendar.php at least. I also need to ask the question the "$vbulletin->" where is this defined in the source. I also need to ask the question the "TABLE_PREFIX" where is this defined in the source. and finially the $vbphrase['additional_usergroups'] how is this used in the system does this mean that all the secondary user groups which would be the custom user groups I create are stored here some how - please explain THANKS? Use the print_r() function to see what is inside the $vbulletin->usergroupcache but how does. THANKS Frank H. Shaw |
#13
|
||||
|
||||
The "usergroupcache" is a item in the datastore. To fetch this item and make it accessible, you need to add it to the "$specialtemplates" array. It will then be available via $vbulletin->usergroupcache, where you can use print_r() on it.
|
#14
|
|||
|
|||
Good we are getting to the information I am looking for -
You say the "usergroupcache" is a item in the datastore and to fetch this item you tell me that i have to do the following: So please explian how do i add it to the "$specialtemplates" array where do i find this array where is it defined and how is it used. You say the once that is done i can do the following: $vbulletin->usergroupcache, where you can use print_r() on it. How and where do i find the documataion on the "$specialtemplates" array? I found in the calendar.php the following: // get special data templates from the datastore $specialtemplates = array( 'smiliecache', 'bbcodecache', 'noavatarperms', ); Now how do i modify the above to allow me to : $vbulletin->usergroupcache, where you can use print_r() on it. and if i do this what is happening in the background to allow me to do this is it just give me global scope or other thngs happening? And what about this the following: $vbphrase['additional_usergroups'] How is this used? and in the system does this mean that all the secondary user groups which would be the custom user groups I create are stored here some how - please explain THANKS? THANKS Frank H. Shaw --------------- Added [DATE]1232730944[/DATE] at [TIME]1232730944[/TIME] --------------- I put the following script in the calendar.php and when i tried to dump the print_r($vbulletin->usergroupcache); WOW to much informtion and with out have a blue print of the data strore it's self - I had to re think things? So I did the following create my own array and fill it with the following: global $myusergroup; $myusergroup = array(); $usergroups = $vbulletin->db->query_read("SELECT usergroupid,title FROM " . TABLE_PREFIX . "usergroup ORDER BY title"); while ($usergroup = $vbulletin->db->fetch_array($usergroups)) { $myusergroup["$usergroup[usergroupid]"] = $usergroup['title']; } unset($usergroup); $vbulletin->db->free_result($usergroups); Then i echoed the results: echo '<pre>'; print_r($myusergroup); echo '</pre>'; This produced the following: Array ( [4] => (COPPA) Users Awaiting Moderation [6] => Administrators [8] => Banned Users [9] => Blue Lodge Member [13] => John T. Heard Lodge - Blue Lodge - Ipswich Mass [7] => Moderators [14] => Non Mason [2] => Registered Users [11] => Scottish Rite Member [10] => Shrine Member [5] => Super Moderators [1] => Unregistered / Not Logged In [3] => Users Awaiting Email Confirmation [12] => York Rite Member [15] => You are a mason ) OK ABOVE LOOKING AT MY OUTPUT HOW DO I TELL SOMETHING IS SET OR NOT SET? Is it just a boolean test like true or false? EXAMPLE [9] => Blue Lodge Member AND ABOVE WHAT DOES THE [9] MEAN I UNDERSTAND THAT IT IS usergroupid SO WHAT I AM ASKING IS THE usergroupid STATIC AND WILL NEVER CHANGE BECAUSE IT IS ASSIGNED WHEN THE RECORD IS CREATED? OR DOES IT CHANGE AND WHAT WILL CAUSE IT TO CHANGE - IE WHAT ACTION IF ANY? THANKS Frank H. Shaw --------------- Added [DATE]1232751695[/DATE] at [TIME]1232751695[/TIME] --------------- The script below has one thing I need to be able to understand that is the 'title' is being pulled out of the table usergroupid,title but where is the value which would indcate that this user group has been set for the logon user and unset. Please explian : __________________________________________________ __________________ Here is my script so far global $myusergroup; $myusergroup = array(); $usergroups = $vbulletin->db->query_read("SELECT usergroupid,title FROM " . TABLE_PREFIX . "usergroup ORDER BY title"); while ($usergroup = $vbulletin->db->fetch_array($usergroups)) { $myusergroup["$usergroup[usergroupid]"] = $usergroup['title']; } ob_start(); foreach ($myusergroup AS $myvaluegroup) { echo(print_r($myvaluegroup) . "<br />"); } unset($usergroup); $vbulletin->db->free_result($usergroups); ob_end_flush(); ob_end_clean(); __________________________________________________ ________ THANKS Frank H. Shaw |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|