[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.
User avatar
Eelke
QA Team
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 » Sat Feb 09, 2008 10:31 am

Why did you have to change all those functions? Is the default group's rank "physically" associated with the user (e.g. it actually replaces the user's rank in the database)? I would have thought all logic would be where the user's rank is actually displayed, where the code makes a choice between displaying the user's default rank, or the default group's rank.

User avatar
nerdee
Registered User
Posts: 23
Joined: Sat Feb 09, 2008 10:08 am
Contact:

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

Post by nerdee » Sat Feb 09, 2008 10:55 am

This one could come handy :)

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 » Sat Feb 09, 2008 10:57 am

Eelke wrote:Why did you have to change all those functions? Is the default group's rank "physically" associated with the user (e.g. it actually replaces the user's rank in the database)?
yes. unfortunately. In the USER_TABLE one of the field is 'user_rank' which is directly changed according to 2 situations:
  1. if you set a special rank for a user
  2. if you manage the default user's group
once it has been set you have no way to understand if the rank has been set by the group or it is a special personal rank (or, at least, I did not find any way).

What I did has been to avoid that groups management can change the user's rank (in non-inherit mode). For this reason I had to change the function group_set_user_default. I also had to avoid that other group management functions could erase the personal user rank prior to call the group_set_user_default. This is done by calling the function remove_default_rank. So, I changed the pieces of code where this function is called in order to call it only if the MOD is set in "inherit" mode.
Eelke wrote:I would have thought all logic would be where the user's rank is actually displayed, where the code makes a choice between displaying the user's default rank, or the default group's rank.
yes, me too. But as I said there is no difference between user's default rank and the default group's rank.
BTW I have just found this was actually explained in phpBB3 documentation at Section 3.6.3, “Default groups”
Important

If you make a group the default one that has a rank and avatar set, the user's old avatar and rank will be overwritten by the group.

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 » Sat Feb 09, 2008 2:53 pm

Nyquist wrote:Version 0.3.0 is ready.
Nice ;) :D
Nyquist wrote: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
Can you make it a little more clear (I'm not English)
>>which file?<<
RdJ1 wrote:Ok thanks, will work at it tomorrow or Thursday. I have no time before then.
Saturday :D

It's still in version 0.2.0 (will work also when you don't have to change viewtopic.php and viewtopic_body.html from 0.2.0 to 0.3.0), because I started yesterday, when version 0.3.0 wasn't out yet.

When I do the following (with subsilver based style), I get the rank images very, very little. (in 1000% it's as big as the letter m here)

open memberlist.php

find

Code: Select all

include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
add after

Code: Select all

//added by Nyquist Show Groups Info
include($phpbb_root_path . 'includes/functions_nyqshowgroupsinfo.' . $phpEx);
//end added by Nyquist Show Groups Info
find

Code: Select all

get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
add after

Code: Select all

			//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

find

Code: Select all

}

?>
add before

Code: Select all

	//added by Nyquist Show Groups Info
	//check the system var:
	if (isset($config['nyq_showgroupsinfo']))
        {
          if(isset($user_cache['nyq_showgroupsinfo']))
          {
              foreach($user_cache['nyq_showgroupsinfo'] as $single_rank)
              {
               $nyq_listofranks= array(
                            'TITLE' => $single_rank['TITLE'],
                            'IMAGE' => $single_rank['IMAGE'],
                            );
               $template->assign_block_vars('nyq_listofranks', $nyq_listofranks);
              }
          }
        }
	//end added by Nyquist Show Groups Info

Now you have to open styles/style_name/template/memberlist_view.html and find a place for the group-ranks.

add there:

Code: Select all

	<!-- BEGIN nyq_listofranks -->
	<dd>{nyq_listofranks.IMAGE}</dd>
<!-- END nyq_listofranks -->
(prosilver based)

Code: Select all

<!-- BEGIN nyq_listofranks -->
	<tr>
		<td>{nyq_listofranks.IMAGE}</td>
	</tr>
<!-- END nyq_listofranks -->
(subsilver based)

Now go to the profile and zoom to the place you have placed the group-ranks. You can see it there. Perhaps somebody can tell me how to get it big, so I can make it bigger.

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 » Sat Feb 09, 2008 3:31 pm

RdJ1 wrote:
Nyquist wrote:instructions for who has previous version yet installed
  • >>upload the file included in the MOD overwriting the old ones<<
Can you make it a little more clear (I'm not English)
>>which file?<<
:) right. Well you have to reupload the system module files which are:
  1. includes/acp/acp_nyq_showgroupsinfo.php
  2. includes/acp/info/acp_nyq_showgroupsinfo.php
  3. adm/style/acp_nyq_showgroupsinfo.html
  4. language/yourlanguage/mods/info_acp_nyq_showgroupsinfo.php

RdJ1 wrote:When I do the following (with subsilver based style), I get the rank images very, very little. (in 1000% it's as big as the letter m here)
Unfortunately I cannot check at the moment. I will as soon as I have two seconds. BTW good work.

User avatar
Eelke
QA Team
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 » Sat Feb 09, 2008 4:19 pm

Nyquist wrote:there is no difference between user's default rank and the default group's rank.
Wow... OK, that complicated that request a little. Thanks for taking the effort and taking the time to explain.

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 » Sat Feb 09, 2008 5:20 pm

oh, well, it's been a pleasure. Any idea/suggestion/remark is appreciated.

BTW RdJ1 any luck with your improvement. If you did it and you please, I could add it in a future release. Still can't go back home because of work. ASAP I will try it myself.

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 » Mon Feb 11, 2008 10:19 am

@RdJ1:
I have finally found the time to give a look at memberlist.php and to your code. There is actually a problem in the way you manage the functions and insert the changes.

Basically the point is that in memberlist.php you only want to change the bahaviour of the code under the branch case 'viewprofile' of the mode switching (the part starting with switch ($mode)). All the other branches are used for other modes in which you watch the user list or the leaders list etc.

Hence what you want to do is to find the command switch ($mode). After that you want to find the branch case 'viewprofile':. And after that you want to find the command $template->assign_vars(show_profile($member));. After this command the template var should have the default user's rank image in the field $template[''RANK_IMG''] which you can pass as the third parameter of my function nyq_getgroupsarray_new.

Finally the updating of the template variable must, again, be done in the case 'viewprofile' branch of the mode switching.

I will work at this changes ASAP and will post here the result. Nonetheless if you want to work on your code you are more than welcome.

Ops, i forgot: also, the user's cache is not used in this file hence you better don't use it.

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 » Mon Feb 11, 2008 2:08 pm

Nyquist wrote:
RdJ1 wrote:
Nyquist wrote:instructions for who has previous version yet installed
  • >>upload the file included in the MOD overwriting the old ones<<
Can you make it a little more clear (I'm not English)
>>which file?<<
:) right. Well you have to reupload the system module files which are:
  1. includes/acp/acp_nyq_showgroupsinfo.php
  2. includes/acp/info/acp_nyq_showgroupsinfo.php
  3. adm/style/acp_nyq_showgroupsinfo.html
  4. language/yourlanguage/mods/info_acp_nyq_showgroupsinfo.php
Thanks ;) ;)

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 » Mon Feb 11, 2008 2:42 pm

ok, 0.4.0 is out. The difference by 0.3.0 is that now the groups' ranks are also shown in the user's profile page (thanks RdJ1).

Update 0.3 to 0.4:
Make only the changes to the files:
  • memberlist.php
  • styles/prosilver/template/memberlist_view.html
  • styles/subsilver2/template/memberlist_view.html

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 » Thu Feb 14, 2008 6:42 pm

Nyquist wrote:ok, 0.4.0 is out. The difference by 0.3.0 is that now the groups' ranks are also shown in the user's profile page (thanks RdJ1).

Update 0.3 to 0.4:
Make only the changes to the files:
  • memberlist.php
  • styles/prosilver/template/memberlist_view.html
  • styles/subsilver2/template/memberlist_view.html
:D

Can you please tell me what I have to do when I update 0.2.0 to 0.4.0. Didn't have time to update to 0.3.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 » Fri Feb 15, 2008 2:43 pm

RdJ1 wrote:Can you please tell me what I have to do when I update 0.2.0 to 0.4.0. Didn't have time to update to 0.3.0.
of course, here we go:
  • upload the file included in the MOD overwriting the old ones
  • make the required changes to the file includes/functions_user.php
  • make the required changes to the file memberlist.php
  • make the required changes to the file styles/prosilver/template/memberlist_view.html
  • make the required changes to the file styles/subsilver2/template/memberlist_view.html
  • now, go to the ACP where you have the MOD's system module installed and choose if you want users to inherit their default group's rank
on a different side, I think that these are alla the features that can be interesting for this MOD. Hence, if no problem arises (and I am confident none will :D ) I am planning to make this version the RC. If someone has specific features requests, please let me know. Otherwise expect this MOD to be released as final soon :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 » Fri Feb 15, 2008 6:31 pm

Nyquist wrote:
  • >>upload the file included in the MOD overwriting the old ones<<
  • make the required changes to the file includes/functions_user.php
  • make the required changes to the file memberlist.php
  • make the required changes to the file styles/prosilver/template/memberlist_view.html
  • make the required changes to the file styles/subsilver2/template/memberlist_view.html
  • now, go to the ACP where you have the MOD's system module installed and choose if you want users to inherit their default group's rank
>>Again: which files :?: :oops: <<
Nyquist wrote:on a different side, I think that these are alla the features that can be interesting for this MOD. Hence, if no problem arises (and I am confident none will :D ) I am planning to make this version the RC. If someone has specific features requests, please let me know. Otherwise expect this MOD to be released as final soon :D
Maybe you can add a contrib folder with the update instructions. ;) :D

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 » Sat Feb 16, 2008 7:19 am

RdJ1 wrote:Maybe you can add a contrib folder with the update instructions. ;) :D
:D
in this case you need to re-upload all the files.

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 » Wed Feb 20, 2008 3:24 pm

RdJ1 wrote:
Nyquist wrote:
  • >>upload the file included in the MOD overwriting the old ones<<
  • make the required changes to the file includes/functions_user.php
  • make the required changes to the file memberlist.php
  • make the required changes to the file styles/prosilver/template/memberlist_view.html
  • make the required changes to the file styles/subsilver2/template/memberlist_view.html
  • now, go to the ACP where you have the MOD's system module installed and choose if you want users to inherit their default group's rank
>>Again: which files :?: :oops: <<

...

Locked

Return to “[3.0.x] Abandoned MODs”