vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   The function_calendar.php has code populate the dropdown - I need to locate somethin (https://vborg.vbsupport.ru/showthread.php?t=202188)

Dismounted 01-22-2009 03:32 AM

Use the print_r() function to see what is inside arrays, objects, etc.
PHP Code:

print_r($vbulletin->userinfo); 


Frank H. Shaw 01-22-2009 03:06 PM

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

Dismounted 01-23-2009 03:50 AM

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.

Frank H. Shaw 01-23-2009 12:18 PM

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


All times are GMT. The time now is 06:11 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.01237 seconds
  • Memory Usage 1,740KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete