[ABD] Nyquist Show Groups Info (multiple ranks)

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
RdJ1
Registered User
Posts: 119
Joined: Thu Oct 25, 2007 8:18 am
Location: The Netherlands

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by RdJ1 »

FlexyClown wrote:How many additional SQL queries does this perform?
0,0
User avatar
Nyquist
Registered User
Posts: 70
Joined: Sat Dec 16, 2006 2:09 pm
Location: Italy

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Nyquist »

FlexyClown wrote:How many additional SQL queries does this perform?
It is 1 SQL query for every "poster" but the result is stored in the user cache. Hence for a known user no query is performed.

I have made the improved pointed out by RdJ1. Just a few minutes and I upload the new files.
FlexyClown
Registered User
Posts: 88
Joined: Thu May 13, 2004 7:20 pm

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by FlexyClown »

Edited previous post to include this... but see you have already replied so next question ;)

If user is a member of the default group, registered users, which has the default rank structure e.g.

0-10 posts = *
11 - 20 posts = **
21 - 30 posts = ***

etc and then a user is made a member of say, gold group, it is more than likely that you will have the gold group shown on the legend of logged on members with a separate legend colour to highlight this. Surely the member is going to want to reflect this by having a different coloured username in the legend, so they change their default group to gold group. The problem is now when you view posts from that user the default rank structure is no longer displayed as it is overwritten by the users default group rank. Surely the default rank group should still be displayed?

Obviously the way round this is to go to the user and set their rank to no special rank assigned. Now when viewing topics we have the default rank shown, the gold group rank shown and in the online user legend the user is shown as a member of gold group.

Make sense?!?
Last edited by FlexyClown on Mon Feb 04, 2008 11:20 am, edited 2 times in total. FlexyClown
Registered User
User avatar
Nyquist
Registered User
Posts: 70
Joined: Sat Dec 16, 2006 2:09 pm
Location: Italy

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Nyquist »

FlexyClown I am not sure to get your point. I will be to that in a moment. Let me just first say that I solved the problem pointed out by RdJ1. Now there are no replications and the file linked in the first post has the new version of the MOD.

Also if you have yet installed the MOD than you can update quite easily. Just:
  • Upload the new root/includes/functions_nyqshowgroupsinfo.php file to your board
  • move the code that you previously added to viewtopic before the line

    Code: Select all

    get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
    
    after the same line. The result should look similar to:

    Code: Select all

    			get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
    
    			//added by Nyquist Show Groups Info
    			//check the system var:
    			if (isset($config['nyq_showgroupsinfo']))
                            {
                              //extract the groups
                              $nyq_groups_ranks_array = nyq_getgroupsarray($poster_id, $config['nyq_showgroupsinfo']);
                              $user_cache[$poster_id]['nyq_showgroupsinfo'] = $nyq_groups_ranks_array;
                            }
    			//end added by Nyquist Show Groups Info
    
  • final step change the call to nyq_getgroupsarray to get the following:

    Code: Select all

    			get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
    			//added by Nyquist Show Groups Info
    			//check the system var:
    			if (isset($config['nyq_showgroupsinfo']))
                            {
                              //extract the groups
                              $nyq_groups_ranks_array = nyq_getgroupsarray_new($poster_id, $config['nyq_showgroupsinfo'],$user_cache[$poster_id]['rank_image_src']);
                              $user_cache[$poster_id]['nyq_showgroupsinfo'] = $nyq_groups_ranks_array;
                            }
    			//end added by Nyquist Show Groups Info
    
Now to the question of FlexyClown. As I said I am not sure I got the point.

What I want to do with this MOD is to somehow show the characteristics of the user's groups near the user's rank. If a user changes his/her primary group to have, say, a different colour, than I do not want to change this behaviour. But if the user is member of other Groups which are not his/her default group, I want this info to show up somewhere.

It can be the way to have multiple ranks as well as having legacy or similar. All using the standard Groups management offered by phpBB3. In my mind the less changes I make on the tables and the code the better this MOD appears to me. That is the reason for the ACP module which can disable the MOD and for the external files with the functions that let me reduce the modifications to the phpbb3 source code.

Hence, the first primary rank of a user is left unchanged. If it is a special rank it will remain as it is. If it is a variable rank, no matter which group the user is in, it, again, will stay unchanged.

All the other ranks of the groups the user participate in will be shown. If one of these groups does not have a rank image (wether it has a rank or not) then nothing about that group will be shown.

Sorry if your question was about something else, but you need to speak to me as a 5 years old child since my english is pretty much like that of such a child :D
RdJ1
Registered User
Posts: 119
Joined: Thu Oct 25, 2007 8:18 am
Location: The Netherlands

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by RdJ1 »

FlexyClown wrote:Edited previous post to include this... but see you have already replied so next question ;)

If user is a member of the default group, registered users, which has the default rank structure e.g.

0-10 posts = *
11 - 20 posts = **
21 - 30 posts = ***

etc and then a user is made a member of say, gold group, it is more than likely that you will have the gold group shown on the legend of logged on members with a separate legend colour to highlight this. Surely the member is going to want to reflect this by having a different coloured username in the legend, so they change their default group to gold group. The problem is now when you view posts from that user the default rank structure is no longer displayed as it is overwritten by the users default group rank. Surely the default rank group should still be displayed?

Obviously the way round this is to go to the user and set their rank to no special rank assigned. Now when viewing topics we have the default rank shown, the gold group rank shown and in the online user legend the user is shown as a member of gold group.

Make sense?!?
Last edited by FlexyClown on Mon Feb 04, 2008 11:20 am, edited 2 times in total. FlexyClown
Registered User
Will look at it when I've updated the mod (5-10 mins) :D
RdJ1
Registered User
Posts: 119
Joined: Thu Oct 25, 2007 8:18 am
Location: The Netherlands

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by RdJ1 »

Nyquist wrote:FlexyClown I am not sure to get your point. I will be to that in a moment. Let me just first say that I solved the problem pointed out by RdJ1. Now there are no replications and the file linked in the first post has the new version of the MOD.

Also if you have yet installed the MOD than you can update quite easily.

...
Very nice done!

For the other users:

See my post on previous page:
RdJ1 wrote:And something for the mod-writer:

When a user joins a group with a rank and he doesn't have his own special rank, his special rank will be set to the group-rank and than it will be displayed twice (one for the user, one for the group).
Now that problem is fixed, when a user has a rank a his default rank, it isn't displayed in the groups-part of this mod! ;) ;) :D :D :D :)

And if Nyquist likes, I can post a tutorial here for displaying the group-ranks in profiles also.
User avatar
Eelke
Registered User
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Eelke »

I guess what FlexyClown is saying is that with this mod installed, the group rank for the default group should no longer replace the user's rank (that is what default phpBB 3 does, right? Haven't checked...), be that based on their post count or on a custom rank assignment. All the default group should do when this mod is installed is determine the color the user's name is displayed in.

That makes sense, since this mod now displays all rank-images for all groups a user is a member of anyway.
RdJ1
Registered User
Posts: 119
Joined: Thu Oct 25, 2007 8:18 am
Location: The Netherlands

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by RdJ1 »

RdJ1 wrote:
FlexyClown wrote: ...
Will look at it when I've updated the mod (5-10 mins) :D
Eelke wrote:I guess what FlexyClown is saying is that with this mod installed, the group rank for the default group should no longer replace the user's rank (that is what default phpBB 3 does, right? Haven't checked...), be that based on their post count or on a custom rank assignment. All the default group should do when this mod is installed is determine the color the user's name is displayed in.

That makes sense, since this mod now displays all rank-images for all groups a user is a member of anyway.
Will fix that, but because of a network-outage I lost my post (was allmost ready and then it was gone :x :evil: :( :cry: :!: )

Now I'm first going to post a bug in another mod that can be used to get the thing FlexyClown wants.

I will post the solution after that.
FlexyClown
Registered User
Posts: 88
Joined: Thu May 13, 2004 7:20 pm

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by FlexyClown »

Exactly what I mean ;)
RdJ1
Registered User
Posts: 119
Joined: Thu Oct 25, 2007 8:18 am
Location: The Netherlands

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by RdJ1 »

There it is:...


What you have to do to get a post-rank for every user, whatever his standard group is, is this:

>Update your mod first (see some posts back)

>Download the Auto Group mod

>Install it

>Make special ranks with good images for every post-count

>Make a group named 1-10 posts (or what you want), set the rank to the good one, set 'Minimum post count' to 1 and 'Maximum post count' to 10. Set 'Make default automatically' unchecked.
-->>That's a problem: it will be checked automatically when you confirm the group. That's a bug! I have reported it to the mod-writer and when there's news about it, I will post it here. Till when it's fixed, a user will automatically join a group when he has the minimum posts and the group will be set to his standard group.

> Enjoy it :!: and if you want to display in profile:
RdJ1 wrote:And if Nyquist likes, I can post a tutorial here for displaying the group-ranks in profiles also.
Nyquist, can I post this when i've done it :?:
User avatar
Eelke
Registered User
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Eelke »

Why should it need another mod? Why can't this mod change the behaviour of the default group replacing the user's rank?
User avatar
Nyquist
Registered User
Posts: 70
Joined: Sat Dec 16, 2006 2:09 pm
Location: Italy

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Nyquist »

RdJ1 wrote:Nyquist, can I post this when i've done it :?:
Sure RdJ1, you're more than welcome
User avatar
Nyquist
Registered User
Posts: 70
Joined: Sat Dec 16, 2006 2:09 pm
Location: Italy

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Nyquist »

Eelke wrote:I guess what FlexyClown is saying is that with this mod installed, the group rank for the default group should no longer replace the user's rank (that is what default phpBB 3 does, right? Haven't checked...), be that based on their post count or on a custom rank assignment. All the default group should do when this mod is installed is determine the color the user's name is displayed in.

That makes sense, since this mod now displays all rank-images for all groups a user is a member of anyway.
aaaaaall right, now i get it. Seems interesting. I will look into this. Just, i need some day to look for the proper piece of code to change. Of course any suggestion is welcome.
RdJ1
Registered User
Posts: 119
Joined: Thu Oct 25, 2007 8:18 am
Location: The Netherlands

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by RdJ1 »

Nyquist wrote:
RdJ1 wrote:Nyquist, can I post this when i've done it :?:
Sure RdJ1, you're more than welcome
Ok thanks, will work at it tomorrow or Thursday. I have no time before then.
User avatar
Nyquist
Registered User
Posts: 70
Joined: Sat Dec 16, 2006 2:09 pm
Location: Italy

Re: [BETA] Nyquist Show Groups Info (multiple ranks)

Post by Nyquist »

Version 0.3.0 is ready.
As pointed out by FlexyClown and Eelke it is useful to keep user's rank separated by default group's rank. This is the improvement of this new version. Basically in this new version the user does not inherit his/her default group's rank.

instructions for who has previous version yet installed
  • upload the file included in the MOD overwriting the old ones
  • make the required changes only to the file includes/functions_user.php
  • go in the ACP where you have the MOD's system module installed and choose if you want users to inherit their default group's rank
  • have fun
things you should know:
In order to keep user's rank independant by the group's rank I had to change the bahaviour of 4 functions in includes/functions_user.php. The four functions are:
  1. group_create: used to create groups or change their properties
  2. group_user_del: used to exclude a user by a group
  3. group_user_attributes: used to change some attributes of groups
  4. group_set_user_default: used to make a group the default user's group
In order to test the MOD I made several tries playing with these routines. Hence I created new groups, moved users in and out by groups, erased groups and so on. As you can imagine, the number of possible actions is quite large. If you want to test the MOD and make your own tries in all the possible scenarios I would appreciate very much. Note that the new pieces of code do not require any additional database call, hence you should be safe in using the MOD: your tables should stay untouched.

I thank you all very much for your help.
Locked

Return to “[3.0.x] Abandoned MODs”