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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2009, 11:51 PM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default The function_calendar.php has code populate the dropdown - I need to locate somethin

I need to locate something - to help in modifying the function_calendar.php file so I can have some filtering down before populating the dropdown - that is the second dropdown located with the templete calendarjump.

Here is what i need is the following:

The users and under the Additional Usergroups is the Blue Lodge Member where do I find the script or templete scripts to parse the value contained in the one of the Custom Usergroups which is in this case Blue Lodge Member.

What i want to do is modify the calendar.php and function_calendar.php dropdown so that only certian Custom Usergroups will the dropdown will get populated with values equal to the value in the Custom Usergroups.

I have been able to figure out to the exact script and how the system loads the values and have been able to modify the PHP script to trap the values going in the dropdown but now I want to add some logic so the only users that have Custom Usergroups set and the only we could use for these example here.

// This can be found in the PHP file functions_calendar.php

**Removed vBulletin Code**
__________________________________________________ _______________

THANKS

Frank H. Shaw
Reply With Quote
  #2  
Old 01-19-2009, 12:00 AM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The templete calendar jump

<form action="calendar.php" method="get">

<div class="smallfont" style="text-align:$stylevar[left]; white-space:nowrap">

<input type="hidden" name="s" value="$session[sessionhash]" />

<input type="hidden" name="month" value="$month" />

<input type="hidden" name="year" value="$year" />

<input type="hidden" name="do" value="$docalendar" />

<strong>$vbphrase[calendar_jump]</strong><br />

<select name="c" onchange="this.form.submit();">

<optgroup label="$vbphrase[please_select_one]">

$jumpcalendarbits

</optgroup>

</select>$gobutton

</div>

</form>

To this part changed :

<select name="c" onchange="this.form.submit();">

<optgroup label="$vbphrase[please_select_one]" >

$jumpcalendarbits

</optgroup>

<optgroup label="Blue Lodge Member" >

$jumpcalendarbits_bl

</optgroup>

<optgroup label="Scottish Rite Member" >

$jumpcalendarbits_sr

</optgroup>

<optgroup label="York Rite Member" >

$jumpcalendarbits_yr

</optgroup>

<optgroup label="Shrine Member" >

$jumpcalendarbits_s

</optgroup>

<optgroup label="Administrators" >

$jumpcalendarbits_a

</optgroup>

</select>$gobutton


So you need to understand that I have already fixed the permisions system to support the filtering that way - but i need to add the functulity to filter a lot more then the permisom system will support so I will have and need the information asked in the prevouse posting to this thread to help me figure out that peice.

THANKS

Frank H. Shaw
Reply With Quote
  #3  
Old 01-20-2009, 02:16 PM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So all i hae to do is modify the line below to work with the temple code in the last posting in this thread:

I need to again explain that i need to enhance the filtering well beyond the capabiity of the permision in the system in fact I am allowing the permision system to work as intended but If a certain user name I want to do things different and even that user if a cetain name will see the dropdown list with different items in it. That is way i am again looking for the user name and usergroups varables coming from the database tables and what varables should i best to use to get the information I need to do the filtering I require in my mod.

This can be found in the PHP file functions_calendar.php

From This
eval('$jumpcalendarbits .= "' . fetch_template('optionfhs') . '";');

To this

eval('$jumpcalendarbits_bl .= "' . fetch_template('optionfhs') . '";');

eval('$jumpcalendarbits_sr .= "' . fetch_template('optionfhs') . '";');

eval('$jumpcalendarbits_yr .= "' . fetch_template('optionfhs') . '";');

eval('$jumpcalendarbits_s .= "' . fetch_template('optionfhs') . '";');

eval('$jumpcalendarbits_a .= "' . fetch_template('optionfhs') . '";');

That part is easy above - but now I need to have is where do i find the following:

The user name the person logon with.

and what user groups is he setup as or in. I can only asume that i am looking for a array datastructure for the user groups information.

I tried to explain this in the last posting in this thread.

THANKS

Frank H. Shaw
Reply With Quote
  #4  
Old 01-20-2009, 03:07 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can test the usergroup for the logged in user -
In a template/html:
HTML Code:
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
In a plugin/php:
PHP Code:
if (is_member_of($vbulletin->userinfo567)) 
Reply With Quote
  #5  
Old 01-20-2009, 07:29 PM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The reply to my question needs some more clearity

You can test the usergroup for the logged in user -
In a template/html:

HTML Code:
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">In a plugin/php:

PHP Code:
if (is_member_of($vbulletin->userinfo, 5, 6, 7))

The first is where and what file is these things located in ?

Next it does not answer how to get the actaul user logon in the first place.

What do the arguments to the function is_member_of() and where do i find the documtation to find out what each argument mean.

You say you are passing the values 5, 6, 7 where did you get these values. What i am looking for is not knowing the group the user logon belongs to and in the example above you have to test if the userbelongs to the group or not. I am looking or a array or sometype of data structure that will return to me the list of usergroups the user belongs to. Where to find this in the scripts

And I also need to have a way to get the information in some type of reasonable engish text like fpr example Blue Lodge Member and not some number with out me understanding what the numbers refer to it will not make since to me.

There might or might not be a simple answer but if there is some script I could look at that might help with thoses two questions.

Does thsi make more since to you.

THANKS

Frank H. Shaw
Reply With Quote
  #6  
Old 01-20-2009, 08:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since you are posting a bunch of vB code, I assumed you had a page working within the vB system which means the page knows the userid of the person viewing the page. So, those conditions should be valid in any code you are using on this page.

I passed 5,6,7 as the common supermod, admin, mod usergroups. Change them to whatever you want (I meant to change them to x,y,z).

API is here - http://members.vbulletin.com/api/
Reply With Quote
  #7  
Old 01-21-2009, 01:14 AM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I looked at the funtion is_member_of() in the api and functions_user.php but in my case i need to locate the code needed to actaul fill the usergroup array so that in the end i can can have a array that contains the usergroups that one user belongs to and this has to be not some set of index but i also need to know the functions required and where to find the code to turn the indexes into actual names that one can read. Now you have to understand that the usergroups are custom usergroups and not ones that come with vb.

For Example:

The custom user groups is called by full name on can read are the following: Blue Lodge Member, Scottish Rite Member, York Rite Member, Shrine Member and Administrators - Now what I really need to parse the usergroup for that certain user and dumo the information into a array.

If some place in the code that does something like that please let me know the file name and line numbers and example if one is aviable.

I hope this helps explain what i am looking for.

THANKS

Frank H. Shaw
Reply With Quote
  #8  
Old 01-21-2009, 04:12 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$vbulletin->userinfo['usergroupid']
$vbulletin->userinfo['membergroupids'
Those two variables contain the primary and secondary usergroup ids (respectively).
Reply With Quote
  #9  
Old 01-21-2009, 09:56 AM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The two varables below will as i understand return the actual name the id repersents

$vbulletin->userinfo['usergroupid']
$vbulletin->userinfo['membergroupids']

Those two variables above plaese expain a bit further the usergroup means what and membergroup means what - what is a secondary custom user grooup and if it is one of the above.

I can serach the sources looking for the userinfo array and see where it is used but I can also see that secondary custom user group that is setup when a user acount is setup after registering in the fourms. The secondary User groups in the forums what i am looking for is the element name index into the array userinfo[] for the secodary user group. This can and not be the used in the calendar scripts.

So maybe I should be asking for a description of where I might find all the element names for the array userinfo[] I tried to find the information in the api but could not find that information there at least. Maybe there is one file *.php that will list out that information for me really clearly.

I can see that the array is the heart and sole of the system now and is where my answers to my questions can clearly be found.

if you have a couple ideas where best to look please let me know.

THANKS

Frank H. Shaw
Reply With Quote
  #10  
Old 01-21-2009, 02:21 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The two variables Hanson quoted are straight from the database. Look in your user table and you will see the column "usergroupid" and "membergroupids" You will have a single number in the first one, and the second one can be empty or have several usergroup ids separated by a comma. For instance, this is for one of my admins:
Code:
$vbulletin->userinfo['usergroupid'] = 6
$vbulletin->userinfo['membergroupids'] = 13,27,31,33
The group names are defined in the table usergroup. The id is in column "usergroupid" and the name of the group is in the column "title"
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:46 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.04166 seconds
  • Memory Usage 2,269KB
  • 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_code
  • (1)bbcode_html
  • (2)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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