This repository has been archived by the owner on Dec 6, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ad0726/ady/team
feat: avatar on memberlist_team
- Loading branch information
Showing
11 changed files
with
90 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
services: | ||
mazeltof.memberlistavatar.listener: | ||
class: mazeltof\memberlistavatar\event\listener | ||
tags: | ||
- { name: event.listener } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* | ||
* @package phpBB Extension - Nom Extension | ||
* @copyright (c) 2015 Votre Pseudo | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 | ||
* | ||
*/ | ||
|
||
namespace mazeltof\memberlistavatar\event; | ||
|
||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
|
||
/** | ||
* Event listener | ||
*/ | ||
class listener implements EventSubscriberInterface | ||
{ | ||
/** | ||
* Assign functions defined in this class to event listeners in the core | ||
* | ||
* @return array | ||
* @static | ||
* @access public | ||
*/ | ||
static public function getSubscribedEvents() | ||
{ | ||
return [ | ||
'core.memberlist_team_modify_query' => 'memberlist_team_modify_query', | ||
'core.memberlist_team_modify_template_vars' => 'memberlist_team_modify_template_vars' | ||
]; | ||
} | ||
|
||
public function memberlist_team_modify_query($event) | ||
{ | ||
$sql_ary = $event['sql_ary']; | ||
|
||
$sql_ary['SELECT'] = "u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_type, u.user_rank, u.user_posts, u.user_allow_pm, u.user_avatar, g.group_id"; | ||
|
||
$event['sql_ary'] = $sql_ary; | ||
} | ||
|
||
public function memberlist_team_modify_template_vars($event) | ||
{ | ||
$row = $event['row']; | ||
$template_vars = $event['template_vars']; | ||
|
||
$template_vars['AVATAR_IMG'] = $row['user_avatar']; | ||
$event['template_vars'] = $template_vars; | ||
} | ||
} |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
styles/all/template/event/memberlist_body_username_prepend.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% if memberrow.AVATAR_IMG %} | ||
<span class="memberlistavatar"> | ||
{{ memberrow.AVATAR_IMG }} | ||
</span> | ||
{% else %} | ||
<span class="memberlistavatar"> | ||
<img src="{{ T_THEME_PATH }}/images/no_avatar.gif" alt="{L_NO_AVATARS}"/> | ||
</span> | ||
{% endif %} |
9 changes: 9 additions & 0 deletions
9
styles/all/template/event/memberlist_team_username_prepend.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% if user.AVATAR_IMG %} | ||
<span class="memberlistavatar"> | ||
<img src='./download/file.php?avatar={{ user.AVATAR_IMG }}'> | ||
</span> | ||
{% else %} | ||
<span class="memberlistavatar"> | ||
<img src="{{ T_THEME_PATH }}/images/no_avatar.gif" alt="{{ L_NO_AVATARS }}"/> | ||
</span> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% INCLUDECSS '@mazeltof_memberlistavatar/memberlistavatar.css' %} |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
styles/prosilver/template/event/memberlist_body_username_prepend.html
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
styles/prosilver/template/event/overall_header_head_append.html
This file was deleted.
Oops, something went wrong.