Second rank thoughts...

Got a MOD request? Have an idea for a new MOD or adjustment to phpBB3? Post it here.
Discussion forum for MOD Writers regarding MOD Development should be discussed in the MODs in Development Forum.
Forum rules
Got a MOD request? Have an idea for a new MOD? Post it here.
Feature suggestions for requested MODs should be posted in the Request Topic.

Actual MOD Development discussions and topics should be posted in the MODs in Development Forum.

NO Support Requests!

Second rank thoughts...

Postby ..::Frans::.. » 31 Mar 2007, 03:02

After reading this forum for a few days now, i just have to say: Good work guys (and girls maybe... Grin )

A little background info. I'm admin of a large law enforcement forum and website, i.ve been modding our own forum for quite a few years now, can dream coding in phpbb2 and yes, we are also trying (as most of the world now, i guess) the new Beta5 version (only TEST). I started with styling, and although it was a bit confusing in the beginning (i took me the best part of an evening just to find where i had to change buttonsizes.... Grin and it puts the "i know how phpbb exactly works" back in perspective ) it's really well thought of.

Now, our forum uses ranks as any other forum. Moderators are moderators, admins are admins, and new members are...well just new members. In our current 2.0.22 version there is a second "rank" we use extensively. This second rank is used in almost the same way as the original but with one BIG exception. This rank can only be set by an admin. We use this rank to show users and guests what the real verified occupation of that particular member is. So, if a guest starts asking question about, lets say, taxes at the airport, and he is getting 15 answers with one of the answers coming from a verified customs officer, the guest can put a certain value to that answer, more than the answers from, let's say, a security officer at store XYZ.

So, i'm in the process of starting to create this second rank, but got lost in the new phpbb3 version. Mainly, there are (imho) two ways to make this work.

  1. Create a hidden group that shows the second rank, but that wouldn't be obvious because groups work with group-avatars, not ranks and would take a great deal of coding
  2. Create a second rank (i even tried custom profile fields but any user could change that OR it wouldnt be visible if set to admin)

I'm still thinking about the second option, make a new rank2 field in the users table, make it available so it can be filled in the ACP->user_profile screen and will only show (uneditable) in every other place in my forum.

So, anyone has any thoughts or comments on this ?




PS: Please bare in mind, my native language isn't english...any stupid grammatical mistakes are mine to begin with... Blush
ping...
User avatar
..::Frans::..
STG Development
STG Development
 
Posts: 1606
Joined: 28 Mar 2007, 15:37
Location: Netherlands
Favorite Team: RKC
Gender: Male
phpBB Knowledge: 9


Re: Second rank thoughts...

Postby Handyman » 31 Mar 2007, 12:44

Hey fjtbeers,

Welcome to StarTrekGuide.
  1. post was in the wrong place? it's moved to mods in development now. Mods/Add-ons is only for mod releases
  2. Great to have another modder here Smile we were running short handed.
  3. if you need help trying to decipher how phpBB3 works, since you have a knowledge of how phpBB2 works, just let us know and we can point you in the right direction.
  4. I think you should use option 2 Smile
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7417
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: Second rank thoughts...

Postby Highway of Life » 31 Mar 2007, 13:14

Hi fjtbeers Hello

First off, welcome. Smile

I have a few ideas on the ranks, but I have a question first:
When you have real officer ranks, how many could/would there be?
If it?s specific to the user, you?ll need to set it for each of those users.
If it?s a group, such as you might have patrol officer, and a large group of people are patrol officers, then you should create a new group with an officers rank, and then put all the officers in that group.

Still might need more info about how you are setting it up to give you the best suggestion.
Also, are you looking to MOD something in, or use the default features?
(i.e. is this a MOD request? Wink )
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10432
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: Second rank thoughts...

Postby ..::Frans::.. » 31 Mar 2007, 14:32

Both, thanx for you replies and for the warm welcome. My apologies for posting in the wrong forum. Blush

I will try to answer both of your questions one by one.
Handyman wrote:post was in the wrong place? it's moved to mods in development now. Mods/Add-ons is only for mod releases

Again, my sincere apologies... Blush
Handyman wrote:Great to have another modder here Smile we were running short handed.

Well, i WILL try to help wehere-ever i can, but that will be phpbb2 in the first place.....;-)

Handyman wrote:if you need help trying to decipher how phpBB3 works, since you have a knowledge of how phpBB2 works, just let us know and we can point you in the right direction.

I think (read my answers to Highway's questions) that is exactly what i'm looking for...
Handyman wrote:I think you should use option 2 Smile

That was my thought too, but it never hurts to ask the opinion of someone who has better understanding of any subject he/she knows more of... Good
Highway of life wrote:When you have real officer ranks, how many could/would there be?

It aren't "officer ranks" as in sargeant or korporal or captain. Every police office has the "rank" of police officer, no matter what his real live rank is. But then we have judge, police student, police school teacher, district attorney etc.etc. In our current setting we have 8 "normal" ranks (ranging from "newbee" to "experienced member") and 31 special ranks (which are used as the rank2 button) Every user can have the standard rank (newbee, but also moderator or admin) en can have a special second rank (police officer, customs officer etc.)

Highway of life wrote:If it?s specific to the user, you?ll need to set it for each of those users.


At first i did set it on a per-user base (i still do) but because real police officers are automatically getting extra closed police-forums i added a radiobutton too so after changing the second rank into police officer (or any other rank coming from the standard ranks table), i can automatically add the member to this uniform members group (giving them entry to the forums) and give them the police button as rank 2. I added a screendump to this posting (hoping it goes right this time;-))

Highway of life wrote:If it?s a group, such as you might have patrol officer, and a large group of people are patrol officers, then you should create a new group with an officers rank, and then put all the officers in that group.


I saw the possibility to add a group_rank but this wil change the standard rank... I guess the rank2-per-user possibility is good enough (as students will regularly become real police officers....for instance)

Highway of life wrote:Still might need more info about how you are setting it up to give you the best suggestion.


Well, my thoughts...

Let's assume we use the standard ranks table (phpbb_ranks) and add a mediumint(8) unsigned standard 0 field to the phpbb_users_table named user_rank2 right after the user_rank field (i like it nice and clean Grin ) After that i create a second entry field in the ACP->Users and Groups->Manage User->Select user->Manage Form->Ranks which can be an exact copy of the first fieldset with the exception of names. In includes->acp->acp_users.php (?????) i add the variable, and change the update query to include this variable.

Now that the second rank field is set to a rank from the standard ranktable i only have to change the get_user_rank function to include this second rank (or maybe a second function ?????) and work from there on in showing this second rank everywhere i want (e.g. viewtopic, memberlist, user_profile...)
Highway of life wrote:Also, are you looking to MOD something in, or use the default features?

I was looking to use only "standard features" and was hoping it could be accomplished that way, but i think the "standard" way isn't possible....
Highway of life wrote:(i.e. is this a MOD request? Wink )

As a matter of fact, one could see it as a mod request (i'm not al lazy person and really really want to do my part, but there is just so much one can do...) but i started this thread as a "learning curve" for a better understanding of the new phpbb3 way of doing things, having just plain and simple fun in the process of learning it and let's be very clear about this, sometimes police officers are just plain and simple....errrmmm.....stupid as in the "programming way" Laughing
You do not have the required permissions to view the files attached to this post.
User avatar
..::Frans::..
STG Development
STG Development
 
Posts: 1606
Joined: 28 Mar 2007, 15:37
Location: Netherlands
Favorite Team: RKC
Gender: Male
phpBB Knowledge: 9

Re: Second rank thoughts...

Postby Highway of Life » 31 Mar 2007, 15:06

fjtbeers wrote:Both, thanx for you replies and for the warm welcome. My apologies for posting in the wrong forum. Blush
Hey, no problem...
I?m still not sure where it should be posted. Unsure Wink
-- MOD Request? MOD in Development? Support Request? General Discussion?
All the above? Laughing

fjtbeers wrote:Well, i WILL try to help wehere-ever i can, but that will be phpbb2 in the first place.....;-)
That?s quite alright, I think you?ll pick up the new system fairly easily -- that?s subjective, but the truth is if you are experienced in PHP, you?ll pick it up no problem. Smile --

fjtbeers wrote:It aren't "officer ranks" as in sargeant or korporal or captain. Every police office has the "rank" of police officer, no matter what his real live rank is. But then we have judge, police student, police school teacher, district attorney etc.etc. In our current setting we have 8 "normal" ranks (ranging from "newbee" to "experienced member") and 31 special ranks (which are used as the rank2 button) Every user can have the standard rank (newbee, but also moderator or admin) en can have a special second rank (police officer, customs officer etc.)
Okay, that?s exactly the question I was getting at. Wink
In the city we are working with, they have the ranks: Patrol Officer, Officer in Charge, Police Lieutenant, Police Sergeant, Police Captain, and Police Chief.
For the police department, so I was wondering if you would split it up that way.

BTW, You speak really good English, grammar is very good as well, just want to point out a few things.
In English, you would say ?It isn?t ?officer ranks?...?
?korporal? is ?Corporal?.

fjtbeers wrote:At first i did set it on a per-user base (i still do) but because real police officers are automatically getting extra closed police-forums i added a radiobutton too so after changing the second rank into police officer (or any other rank coming from the standard ranks table), i can automatically add the member to this uniform members group (giving them entry to the forums) and give them the police button as rank 2. I added a screendump to this posting (hoping it goes right this time;-))
Okay, if it were me, this is how I would do it with the current system (i.e. no MODs).
Create 31 groups, give each of those groups their own special rank. -- No need to give any of these groups special permissions.
Then create a separate group for ?police officer? as you have done to give that group special forums/permissions. -- This group would NOT have a special rank.
Then you would add, for example, a Captain would be in the Registered Users group, Captain group, and Police officers group.
They would be default set to the Captain group, so they would maintain the rank of the Captain (you only get one rank option right now in phpBB3) but they would carry the permissions of the Police officers group since it overrides the default values.

fjtbeers wrote:I saw the possibility to add a group_rank but this wil change the standard rank... I guess the rank2-per-user possibility is good enough (as students will regularly become real police officers....for instance)
When a student becomes an actual officer, you would move them to an officer?s group, and delete them from the students group -- of course setting the default group to that of the officer group to give the user that rank.
Sure, this will override the experience users, newbie ranks etc, but as I mentioned before, phpBB3 only has one rank option per user.

fjtbeers wrote:Well, my thoughts...

Let's assume we use the standard ranks table (phpbb_ranks) and add a mediumint(8) unsigned standard 0 field to the phpbb_users_table named user_rank2 right after the user_rank field (i like it nice and clean Grin ) After that i create a second entry field in the ACP->Users and Groups->Manage User->Select user->Manage Form->Ranks which can be an exact copy of the first fieldset with the exception of names. In includes->acp->acp_users.php (?????) i add the variable, and change the update query to include this variable.

Now that the second rank field is set to a rank from the standard ranktable i only have to change the get_user_rank function to include this second rank (or maybe a second function ?????) and work from there on in showing this second rank everywhere i want (e.g. viewtopic, memberlist, user_profile...)
hmm... I had not thought of doing it that way, but that could certainly work, it would be dependent of all other elements (viewtopic, profile, memberlist etc) using that function.
But that does sound like the easiest thing to do.
Just remember, create your code in a separate file (if you can) and include it as a function instead of modifying core files.
The reasoning is because the more core you modify, the more difficult it becomes to upgrade your board, so just keep that in mind.

fjtbeers wrote:As a matter of fact, one could see it as a mod request (i'm not al lazy person and really really want to do my part, but there is just so much one can do...) but i started this thread as a "learning curve" for a better understanding of the new phpbb3 way of doing things, having just plain and simple fun in the process of learning it and let's be very clear about this, sometimes police officers are just plain and simple....errrmmm.....stupid as in the "programming way" Laughing
Alright, MOD Request it is. Grin
We only move it to MOD?s in development if you someone is actively working on the MOD.

Please feel free to browse around, ask questions, and post if you need any kind of help.
That is STG?s primary purpose: To help users get acquainted with phpBB3, and to help MOD Authors code better, and learn proper coding techniques for Olympus.

Cool
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10432
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: Second rank thoughts...

Postby ..::Frans::.. » 31 Mar 2007, 15:45

Thanx Highway of life for trying to understand my problem and for taking the time to give feedback... (Corporal with a K is a word from my language so...;-))

Tomorrow evening (Themepark season is starting tomorrow and living in an area with 3 theme parks very nearby having children is taking the best part of a lot of sundays this year ;-)) i will start by checking my theory and maybe create the first parts of this mod. Maybe you can give me a clue as to where the $user->data is filled (as for that i couldn't find) ???

Good
ping...
User avatar
..::Frans::..
STG Development
STG Development
 
Posts: 1606
Joined: 28 Mar 2007, 15:37
Location: Netherlands
Favorite Team: RKC
Gender: Male
phpBB Knowledge: 9

Re: Second rank thoughts...

Postby Highway of Life » 31 Mar 2007, 15:49

Sounds good! Good

That?s in sessions.php
But what would you need it for?

I might be able to send you on a shortcut. Wink

BTW, are you German? (forgive me if I?m wrong -- could be due to the Gonculator takeover)
Just guessing from the K, i.e. Kommandant
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10432
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: Second rank thoughts...

Postby ..::Frans::.. » 31 Mar 2007, 16:00

Nope, dutch (although i guess the language is very similar) and the name is Korporaal (used not by the police but by the military (police)

I guess i need it because, well, if the array is filled with hardcoded fieldnames i.e.
Code: Select all
SELECT username, user_id, user_email 
FROM phpbb_users_table 
WHERE user_id 
= $userid

i have to add my rank2 to the standard select (i have added the rank2 field to the users table and filled it by hand with a legal value from the ranks table) in order to make it available in the $user array. If they did it with looping through all the fields by $key then it wouldn't be a problem because my added rank2 field would get eddad too. So, this is my starting point i guess.....
ping...
User avatar
..::Frans::..
STG Development
STG Development
 
Posts: 1606
Joined: 28 Mar 2007, 15:37
Location: Netherlands
Favorite Team: RKC
Gender: Male
phpBB Knowledge: 9

Re: Second rank thoughts...

Postby Gonculator » 31 Mar 2007, 16:04

If you?re dealing with ranks, then user->data is not really where you want to look.

user->data is for if you are using user specific items, such as what YOU can see when YOU browse your forum.
They control switches, hold information etc, but not ranks.

For the ranks, I would look for the ranks function in functions.php
I am Gonculator, the STG Forum Robot -- Please do not PM me, I will not answer, but I will eat users who PM me. :twisted:
User avatar
Gonculator
Forum Robot
Forum Robot
 
Posts: 640
Joined: 16 Nov 2006, 21:52
Location: Forum Robot
Gender: Male

Re: Second rank thoughts...

Postby ..::Frans::.. » 31 Mar 2007, 16:11

I've looked in both sessions.php and functions.php.

In functions.php, the only time the ranks_path is called is when needed in the page_header (still trying to figure out what that is for). In Sessions.php the $user->data is filled, indeed with alle fieldfs from the user_table so my second rank is available when speaking of MY $user->data['rank2'].

When needed in (e.g.) viewtopic i indeed need to create a new function (or alter the existing function) to get the second rank and to add it to the $poster->data...

So, i guess (but i'm open for suggestions Grin ) sessions it is for now......
ping...
User avatar
..::Frans::..
STG Development
STG Development
 
Posts: 1606
Joined: 28 Mar 2007, 15:37
Location: Netherlands
Favorite Team: RKC
Gender: Male
phpBB Knowledge: 9

Next

Return to MOD Requests and Discussion

Who is online

Users browsing this forum: ccBot [Bot] and 6 guests