event memberlist_team_username_prepend

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
ad0726
Registered User
Posts: 8
Joined: Thu May 16, 2019 10:47 pm

event memberlist_team_username_prepend

Post by ad0726 » Thu Aug 15, 2019 7:53 pm

Hello !

I use core.memberlist_team_modify_query and core.memberlist_team_modify_template_vars to add avatar of each user of memberlist_team. And it works.
When I put {group.user.AVATAR_IMG} on line 22 from memberlis_team.html, for the debug, I have the right data.

Code: Select all

<td><!-- IF group.user.RANK_IMG --><span class="rank-img">{group.user.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{group.user.RANK_TITLE}</span><!-- ENDIF --><!-- EVENT memberlist_team_username_prepend -->{group.user.AVATAR_IMG}{group.user.USERNAME_FULL}<!-- IF group.user.S_INACTIVE --> ({L_INACTIVE})<!-- ENDIF --><!-- EVENT memberlist_team_username_append --></td>
But when I put the same thing into memberlist_team_username_prepend.html, it doesn't work.
In this file, group.user contains group data. So, in this file, {group.user[0].AVATAR_IMG}, {group.user[1].AVATAR_IMG}... that works...

User avatar
3Di
Former Team Member
Posts: 14060
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: event memberlist_team_username_prepend

Post by 3Di » Thu Aug 15, 2019 9:38 pm

Please show the whole extension, preferred as its GitHub repo, we will see what's wrong.

Hopefully. :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
ad0726
Registered User
Posts: 8
Joined: Thu May 16, 2019 10:47 pm

Re: event memberlist_team_username_prepend

Post by ad0726 » Fri Aug 16, 2019 8:24 am

Finaly, I succeeded but I don't understand it's like this ^^

This is the GitHub https://github.com/ad0726/memberlistavatar

The solution is to use user.AVATAR_IMG (here). However, in memberlist_team.html where there is memberlist_team_username_prepend, it's group.user.USERNAME_FULL (for exemple) (here).

I push "AVATAR_IMG" into template_vars and this is pushed into group.user (here).

So, why does user.AVATAR_IMG work with memberlist_team_username_prepend instead of group.user.AVATAR_IMG?

User avatar
canonknipser
Registered User
Posts: 2063
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: event memberlist_team_username_prepend

Post by canonknipser » Fri Aug 16, 2019 6:24 pm

Because in the teampage you have two hierarchy levels: first the groups like admin, global moderators and any other group which has the attribute "Show on team page". The second is the member in the group. As a member can be in several groups, you need both levels two identify a member in its correct place - eg. on memberlist.php?mode=team "JimA" is in at least two teams
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
ad0726
Registered User
Posts: 8
Joined: Thu May 16, 2019 10:47 pm

Re: event memberlist_team_username_prepend

Post by ad0726 » Fri Aug 16, 2019 7:00 pm

This explains group.user.value in memberlist_team.html, but no why it doesn't work with memberlist_team_username_prepend. However, this event is just before group.user.USERNAME_FULL.

Post Reply

Return to “Extension Writers Discussion”

cron