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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2007, 03:07 PM
deem0n deem0n is offline
 
Join Date: Feb 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need advise

Hi!

I'm newbee in vb programming.

I need make this task:

we have system where vb is subsystem.
vb_users synchronised with systems users.

system users have level which limit access to read content.
levels look like:
Bronze
Silver
Gold
they's rights are hiearchial ( means: Gold have access to content of silver and bronze level)

I need implement this into forum.

So each forum will has level and each user.

if user try open forum with level bigger then he have , he will get notify page and no accsess to this forum.

Please, give advise how make it simpliest and/or best way.

I think about custom permision but it need showtreads.php change.
Just suppose the way,please
Reply With Quote
  #2  
Old 07-03-2007, 01:49 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would do it with usergroups. Set up bronze, silver and gold usergroups, then modify the forum permissions so that only the aprropriate usergroups can access the appropriate forums.

Doing this it is possible to hide non-access forums altogether.
Reply With Quote
  #3  
Old 07-03-2007, 06:48 AM
deem0n deem0n is offline
 
Join Date: Feb 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eikinskjaldi View Post
I would do it with usergroups. Set up bronze, silver and gold usergroups, then modify the forum permissions so that only the aprropriate usergroups can access the appropriate forums.

Doing this it is possible to hide non-access forums altogether.
Thank you!
but this method have two lack in my opinion:

first : There need set all groups(level) permision's to forum instead on.
( for example bronze forum will have bronze, silver and gold usergroup permission)
second: there do not use new user property level.

pls, fix me if i wrong.

better, as I think is add : levels field to forum permission... but how ?
Reply With Quote
  #4  
Old 07-03-2007, 07:41 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
Thank you!
but this method have two lack in my opinion:

first : There need set all groups(level) permision's to forum instead on.
( for example bronze forum will have bronze, silver and gold usergroup permission)
Well its a bit fiddly, but you only have to do it once. Also for free, you get a usergroup icon, so your bronze users can get a little bronze star beneath their names.


Quote:
second: there do not use new user property level.
Sorry, the English here is too poor for me to understand what you are saying.

Quote:
better, as I think is add : levels field to forum permission... but how ?
Again, not sure what you are saying, but any mucking around with an addon to forum permission will require a similar amount of mucking around with the code to make it work.
Reply With Quote
  #5  
Old 07-03-2007, 10:50 AM
deem0n deem0n is offline
 
Join Date: Feb 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eikinskjaldi View Post
Well its a bit fiddly, but you only have to do it once. Also for free, you get a usergroup icon, so your bronze users can get a little bronze star beneath their names.
yes, it can be a way.

Question is how link the level of user and userGroup?


Quote:
Originally Posted by Eikinskjaldi View Post
Sorry, the English here is too poor for me to understand what you are saying.

Again, not sure what you are saying, but any mucking around with an addon to forum permission will require a similar amount of mucking around with the code to make it work.
Sorry, for my poor-poor english.

I'll trying explain it again:

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?

btw. we bought this forum where is I get documentation?
Reply With Quote
  #6  
Old 07-03-2007, 07:33 PM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For the documentation on vbulletin, you can download it from within members area at vbulletin.com, or you can view online at vbulletin.com main page (see link to documentation in header)
Reply With Quote
  #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
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 07:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05091 seconds
  • Memory Usage 2,237KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete