PDA

View Full Version : Need advise


deem0n
07-02-2007, 03:07 PM
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

Eikinskjaldi
07-03-2007, 01:49 AM
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.

deem0n
07-03-2007, 06:48 AM
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 ?

Eikinskjaldi
07-03-2007, 07:41 AM
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.


second: there do not use new user property level.

Sorry, the English here is too poor for me to understand what you are saying.

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.

deem0n
07-03-2007, 10:50 AM
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?



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:

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?

Antivirus
07-03-2007, 07:33 PM
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)

Eikinskjaldi
07-04-2007, 12:36 AM
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.


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"


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.