Thread: Need advise
View Single Post
  #7  
Old 07-04-2007, 12:36 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by deem0n View Post
yes, it can be a way.

Question is how link the level of user and userGroup?
You will need to assign users to the usergroup, either manually through the admin control panel or through some custom script that gets info from...well, somewhere. I guess it depends on how the levels are decided. I understand (though have never used myself) that the vb payment API allows group assignment based on payment.

Quote:
PHP Code:
if (!($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview'])) 
My though is:
add new permision to forum (for example levelpermision) and checking in hook if current user can access to forum.
If no set one of prev variable for make 'no_permission' effect.

so, can I add permission to forum?
All the forum permission stuff in VB is usergroup based, so adding a new permission means you still have to use the usergroup stuff. In addition, the forumpermissions are things like

"can create thread"
"can vew posts"
"can edit other peoples posts"

In other words the forumpermissions are generic things which are then set on individual forums via the usergroups. They are NOT specific things like

"can be viewed by silver"

Code:
mysql> select * from forumpermission limit 5;
+-------------------+---------+-------------+------------------+
| forumpermissionid | forumid | usergroupid | forumpermissions |
+-------------------+---------+-------------+------------------+
|               174 |    2695 |           2 |           528391 | 
|                76 |     668 |          10 |                0 | 
|                75 |     135 |          10 |                0 | 
|                74 |       2 |          10 |           716815 | 
|               171 |     353 |           8 |                0 | 
+-------------------+---------+-------------+------------------+
5 rows in set (0.01 sec)
As you can see from my forupermission table, each form has a set of permissions based on usergroup.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01226 seconds
  • Memory Usage 1,779KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete