PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2005-01-14 17:05:23

noof
New member
Registered: 2005-01-12
Posts: 2

Multigroup 0.11b

Code:

Just a small fix, changelog:

0.1b to 0.11b
------------------
* fixed SQL alter so it works on Postgres as well (thanks to XuMiX)

Download here

Offline

 

#2 2005-02-05 21:59:48

Gh()sT
Member
Registered: 2005-01-20
Posts: 13

Re: Multigroup 0.11b

Will this work with 1.2.1?

Offline

 

#3 2005-05-20 19:40:02

bekoeppel
Guest

Re: Multigroup 0.11b

How can I install multigroup? I could not find a readme.txt or something like this.

 

#4 2005-06-13 15:47:35

Syd
Guest

Re: Multigroup 0.11b

bekoeppel wrote:

How can I install multigroup? I could not find a readme.txt or something like this.

Just open multigroup.pun in a text editor, such as Notepad or Wordpad.

 

#5 2005-09-03 06:17:21

nclement
New member
Registered: 2005-09-03
Posts: 2

Re: Multigroup 0.11b

the pun file says what the mod does but not how to apply the mod.

Any ideas on how to apply this mod?  I'm not good enough of a programmer to make all the changes/additions to the various files.

Offline

 

#6 2005-11-30 04:29:15

everfree
Guest

Re: Multigroup 0.11b

I would love to use this mod if it works. How do you install it? Is anyone using it or another one that allows members to be in more than one group?

 

#7 2005-11-30 08:16:45

Razmooze
Member
From: Sweden, Göteborg
Registered: 2005-11-21
Posts: 52
Website

Re: Multigroup 0.11b

If memory serves the queries in viewtopic.php (punbb 1.2.10) doesn't seem to match those shown in the readme. Otherwise, it seemed to work ok for the short period I tested it. But man, was it many queries to replace tongue.

Offline

 

#8 2005-11-30 10:35:00

shamman
Member
Registered: 2005-11-21
Posts: 42

Re: Multigroup 0.11b

Yah good mod, I need something close to this, but for each one user hmm

Offline

 

#9 2005-12-12 13:23:28

Vovochka
Guest

Re: Multigroup 0.11b

It's great mod!
But it seems to me I have a problem with it.

I put user in two groups.
first group gives all permissions to forum, and second denies everything for the same forum.
After that such user can only view forum.

How can be modified code if i wat to make permissions:
Deny: user can't access forum, because one or more checks fail ( AND )
Allow: user can access forum, because one check succeds ( OR )

Thak you.

 

#10 2005-12-23 20:22:09

llanis
Member
Registered: 2005-11-05
Posts: 13

Re: Multigroup 0.11b

I've got the same problem, it's very embarrassing sad
Only read a forum and can post into the first...


Sorry for my bad english, I'm french wink

Offline

 

#11 2006-01-25 21:32:59

jdruiter
Guest

Re: Multigroup 0.11b

has someone tested this well with 1.2.10 ??

 

#12 2006-01-26 17:54:59

llanis
Member
Registered: 2005-11-05
Posts: 13

Re: Multigroup 0.11b

jdruiter wrote:

has someone tested this well with 1.2.10 ??

Yes me, read my message before yours... wink


Sorry for my bad english, I'm french wink

Offline

 

#13 2006-03-07 09:43:43

Vildsint
Guest

Re: Multigroup 0.11b

Is this mod working? I am using PunBB 1.2.9 and I got about 17500 posts so I dont wanna screw up the forum.

But this is what I need. I think.

What I need to be done is to have people in at least 2 groups.

What I do is run a guild for world of warcraft and now we have created a sister guild. So there is sister guild forums and standard guild forums
and I want some people to see both and some to see the regular one and some to see only site guild.

I also want to hide 2 officers forums in each guild.


Would it be possible to use this mod?

 

#14 2006-03-22 10:57:51

marian
New member
Registered: 2006-03-22
Posts: 2

Re: Multigroup 0.11b

I tried to install this mod on PunBB 1.2.11 and I occured some problems - some lines of code in orginal files of script are different than described as orginal code in readme file of this mode.

Anybody has made succesfull install on 1.2.11?

Would be gratefull for any sugestions..

regards

Offline

 

#15 2006-04-09 21:33:08

Speedy
Guest

Re: Multigroup 0.11b

Great Mod! Nice work. That's exaclty what I needed. It works on punbb 1.2.11 correctly. I've installed this mod on that version without any problems ;-).
Thanks!

----

edit: eh... This mod doesn't work as well as it could. As it was said, one user who is in a few groups can only read other forums and has permissions to post in forums which are allowed for primary group of this user. To allow post in other forums, i had to modify  `if` instructions and change perms checking...

Last edited by Speedy (2006-04-13 22:21:33)

 

#16 2006-04-14 23:44:57

marian
New member
Registered: 2006-03-22
Posts: 2

Re: Multigroup 0.11b

Speedy - can you describe how to make this mod run correctly? I managed to install the mod now, but I have the same problem as you described in edit...

Offline

 

#17 2006-04-20 23:29:58

llanis
Member
Registered: 2005-11-05
Posts: 13

Re: Multigroup 0.11b

llanis wrote:

I've got the same problem, it's very embarrassing sad
Only read a forum and can post into the first...

A very poor mod...
Too bad !


Sorry for my bad english, I'm french wink

Offline

 

#18 2006-06-22 12:27:26

Cybmat
Guest

Re: Multigroup 0.11b

Hi!

I have the same problem, but I have make some modifications of the code and now the mod work!

to begin: you have to add 2 functions on the file: include/functions.php :

Code:

// create sql-query for other part of the multigroup mod
function multigrp_getSql_post_topics($db)
{
    $ret = 'SIGN(fp.post_topics';
    
    $mgrps = split(',', $pun_user["membergroupids"]);
    $count = 1;
    foreach($mgrps as $mgrp) {
        if((int)$mgrp != 0) {
            $ret.=" + fp".$count.".post_topics";
            $count++;
        }
    }  
    return $ret.")";
}

// create sql-query for other part of the multigroup mod
function multigrp_getSql_post_replies($db)
{
    $ret = 'SIGN(fp.post_replies';
    
    $mgrps = split(',', $pun_user["membergroupids"]);
    $count = 1;
    foreach($mgrps as $mgrp) {
        if((int)$mgrp != 0) {
            $ret.=" + fp".$count.".post_replies";
            $count++;
        }
    }  
    return $ret.")";
}

After you have to modifie the file viewforum.php:
at the line 44 you have to modifie the mod line by this sentence:

Code:

// Fetch some info about the forum
$result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, '.multigrp_getSql_post_topics($db).' FROM '.$db->prefix.'forums AS f '.$mgrp_extra.' AND f.id='.$id) or error(Unable to fetch forum info', __FILE__, __LINE__, $db->error());

After into the file viewtopic.php:
from line 99 to 103:

Code:

// Fetch some info about the topic
if (!$pun_user['is_guest'])
    $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, '.multigrp_getSql_post_replies($db).', s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') '.$mgrp_extra.' AND t.id='.$id.' AND t.moved_to IS NULL') or error('Impossible de retrouver les informations de la discussion', __FILE__, __LINE__, $db->error());
else
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, '.multigrp_getSql_post_replies($db).', 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id '.$mgrp_extra.' AND t.id='.$id.' AND t.moved_to IS NULL') or error('Impossible de retrouver les informations de la discussion', __FILE__, __LINE__, $db->error());

finally in post.php :
line 40 to 44:

Code:

// Fetch some info about the topic and/or the forum
if ($tid)
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, '.multigrp_getSql_post_replies($db).', '.multigrp_getSql_post_topics($db).', t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id '.$mgrp_extra.' AND t.id='.$tid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());
else
$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, '.multigrp_getSql_post_replies($db).', '.multigrp_getSql_post_topics($db).' FROM '.$db->prefix.'forums AS f '.$mgrp_extra.' AND f.id='.$fid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());

in fact the original code user fp.post_topics or fp.post_replies in the sql requet, but that just indicate if the first group have this flag.
For check all groups I replace it by somethink like this: sign(fp.post_topics+fp1.post_topics+fp2.post_topics).
that command return 1 if the user have more than one group who can post topics. or 0 if the user can't post.

if you have any questions about this fix you can ask me by e-mail.
I'm sorry for my bad english :-)

++
Matthieu

Last edited by Cybmat (2006-06-22 12:35:05)

 

#19 2006-07-15 00:23:55

Inquisitus
Guest

Re: Multigroup 0.11b

In the next version, could we have some integration with the user list search, so that it displays users whose additional groups include the group searched for?

 

#20 2006-09-25 23:22:54

twohawks
Member
From: Nevada, USA
Registered: 2006-09-21
Posts: 237

Re: Multigroup 0.11b

Did anyone implement Cybmat's changes, and have this working properly with punbb v1.2.12?
Would like to hear from people who are using this... your experience with it.
Also, did anyone update a readme with all the necessary installation changes?
Cheers,


TwoHawks
Love is the Function
No Form is the Tool

Offline

 

#21 2007-04-23 01:44:58

TMS
New member
Registered: 2007-04-23
Posts: 1

Re: Multigroup 0.11b

Cybmat's changes work fine ! Thanks to him !

Offline

 

#22 2007-09-04 03:35:25

Ichabod
New member
Registered: 2007-09-04
Posts: 3

Re: Multigroup 0.11b

TMS wrote:

Cybmat's changes work fine ! Thanks to him !

Maybe it's just me (probably), but when I tried to apply these changes it didn't work.

What happened was (I walked it through at least three times too make sure I didn't do it wrong) that some groups could not write at all, i think the basic settings managed to override forum-specific settings or something.

I'm still looking for a good way to change more than just visiblity in a forum.

What I'm trying to achieve:
All people belonging to one specific group (in addition to any others) are the only ones that can write in a specific forum. (Although everyone can read in it)

Example:
Guy 1: Belongs to group 1
Guy 2: Belongs to group 1 and 2

Guy 1 can see the specific forum, but cannot write in it. Guy 2 can see and write in it because he belongs to group 2.

Am I making any sense? smile

PS: I've been trying this mod on 1.2.14, that might have something to do with my problems.

Offline

 

#23 2008-12-05 04:10:26

twohawks
Member
From: Nevada, USA
Registered: 2006-09-21
Posts: 237

Re: Multigroup 0.11b

Anyone know where "$pun_user['membergroupids']" is defined?  Seems to be missing from Cybmat's code.

Okay, strike that question.  The problem seems to be code placement, the $pun_user variable results are not being carried into the functions.

GOT IT: Cyb did not set global $pun_user in two of the functions.

I've almost got this working with Subforum mod ;^)
Stand by for more...

Last edited by twohawks (2008-12-05 04:26:52)


TwoHawks
Love is the Function
No Form is the Tool

Offline

 

#24 2008-12-05 07:24:01

twohawks
Member
From: Nevada, USA
Registered: 2006-09-21
Posts: 237

Re: Multigroup 0.11b

Hi All,
I am working on getting this mod up to proper speed and I have been seeing some good success.  THank Thank you Noof for breaking ground on this (so long ago) and cybmat for insightful and really needed and useful additions.

So I am trying to sort out some dangling problems... if your a coder will you please go over to http://fluxbb.org/forums/topic/2312/sql … t-related/  and please take a gander. 

Of course, I intend to post the final 'thingy' here somehow.  If noof is still in existance maybe we can get it up as an update so its all in one place.

All righty then, well I want to sahre with everyone what I am up to here.  I apologize ahead of time for... as inspired as I am to take on requests, and may be able to do some small ones, I am so busy I hardly have time for extra-ciricular devotions. 
That said, lets see what you think....

--------------------------------------------------------------------------------------
The tweaks I have made (very few, but worth noting, I think):
So far
1 - I fixed a couple of errors that got in the way of the mod working as seemingly intended - some functions didn't actually work, and a few variables were actually left out for some reason (may have been overlooked just as in the functions).

2 - I have it  now so that group permissions work in the following manner (really simple - but unleashed from the way it was said to be before, I believe):
(Excluding Admins and Moderators)... If you are a member of any group that has a read, post reply, or post topic permission set to on, you may 'proceed' -> simple as that (cybm worked most but not all of that out).

EXAMPLES:so if your membership looks something like:
-------------------------------------------------------------------
Larry is an 8th Grade Student. Here are his permission setup:
              Groups                       Read    PostReplies   PostTopics
mainGroup: AlgebraStudents      X          X             X      This is the inteactive forum for Algebra Students, they all have full rights
2ndGroup : 7thGradeTutors        X          X             X      Larry Tutors 7th Graders in his spare time
3rdGroup : 9thGradeTeachers     X                               9th Grade Teacher only posts assignments here -
                                                                                        Larry has readonly access for pre-nextgrade observation
-------------------------------------------------------------------
Mo is an Algebra Student in 9th Grade. Here are her permission setup:
              Groups                       Read    PostReplies   PostTopics
mainGroup: AlgebraStudents      X          X             X      This is the inteactive forum for Algebra Students, they all have full rights
2ndGroup : 7thGradeTutors                                          Mo Doesn't Tutor 7th Graders, but the prof may want her 9th graders
                                                                                       to look in there at times, so she sets the group for future
3rdGroup : 9thGradeTeachers     X                               9th Grade Teacher only posts assignments here - Mo has only read access

-------------------------------------------------------------------
Curly is an English and History Student in 9th Grade, and aspiring to tutor and teach.
In the two Prior setups, those people had Algebra as their main group.  Curly's is different.  Here are his permission setup:
              Groups                   Read    PostReplies   PostTopics
mainGroup: CurlyGroup             X           X           X       This is a special group for one on one for Curly and his professor -                                                                                                              only they have access
2ndGroup : 7thGradeTutors       X                               Curly Doesn't Tutor 7th Graders, but is an observer                                                                                                                             with guidance from his professor
3rdGroup : 9thGradeTeachers    X           X                   9th Grade Teachers assignments - Curly can read and post replies,                                                                                                                       but cannot create topics
4thGroup : AlgebraStudents                                      Curly Doesn't Need Access here,
                                                                                   but we set it up for the occasional need to have him observe something here
-------------------------------------------------------------------
One of our fluxbb admins actually uses this in even a more complex manner, and dealing with the permissions without this sort of mod is an utter nightmare now (I would tell you, but I'd have to kill myself after!). She and the teachers and students really need this mod badly now.
I hope the examples above inspire people here to think about how this can open many doors, and remove some of the heavy work without it (I know, I have seen the butt end of the ugly stick on this one).


3 - I have integrated these features to work with the subforum mod

4 - Permissions appear to cascade down so that, if you are using the sub_forum_mod and you set permissions off on a parentForum (per read/post/reply as one would expect), then the user will not have 'that kind of access' permission to any subforum of that parent.  All this means, imho, is permissions cascade and it kinda can protect your butt if you miss out on setting perms somewhere 'higher-up'.

Alrighty then there you have it.  I hope I can get some help with this, we sorely need it (for too long now).
Let me knwo what you think!
------------------------------------------
For those of you not steeped deeply into a modded fluxbb1.2.XX  you may wish to wait for version 1.3, but even when it comes out there's going to be a period of time where things have to shake out and rev up.  It is said to have a multigroup extension already, but I have not had time to look at it (just good to know though).
I expect to be using Flubb 1.2.xx for well more than another year.  Its solid, so why not? 
I think when 1.3 hits I will walk into gradually - I expect many will.

Cheers, HTH

Last edited by twohawks (2008-12-05 14:09:08)


TwoHawks
Love is the Function
No Form is the Tool

Offline

 

#25 2008-12-06 11:17:17

twohawks
Member
From: Nevada, USA
Registered: 2006-09-21
Posts: 237

Re: Multigroup 0.11b

I worked out the problem mentioned above for listing member_group_titles for the userslist. You can see it at fluxbb for now, until I post a final update here, pending more testing.  I hope to have it done by end of next week (gotta work to eat).

I hope to hear from some of you.
Cheers,


TwoHawks
Love is the Function
No Form is the Tool

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.