Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 01-22-2009, 03:32 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use the print_r() function to see what is inside arrays, objects, etc.
PHP Code:
print_r($vbulletin->userinfo); 
Reply With Quote
  #12  
Old 01-22-2009, 03:06 PM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #13  
Old 01-23-2009, 03:50 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 01-23-2009, 12:18 PM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:29 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.03778 seconds
  • Memory Usage 2,200KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete