Mod'ing the Ext to Display User Email
Mod'ing the Ext to Display User Email
I would like to customize the extension a little bit and under each username displayed I would like to show the users email address. What is the best method to go about doing this mod? I was looking at the variables in common.php, and it appears the defines $user is referenced throughout so I can't edit it there. Any help provided would be appreciated. Thanks!
- Mike-on-Tour
- Administrator
- Posts: 417
- Joined: Sat 21. Mar 2020, 19:02
- Location: Wittingen
Re: Mod'ing the Ext to Display User Email
As a first reply (prior to a more detailed look into the scripts) I would do this within the three relevant functions of
I will take a closer look later and come back with a more educated answer.
ur_acp.php
and the respective template files.I will take a closer look later and come back with a more educated answer.
Gruß
Mike
Mike
- Mike-on-Tour
- Administrator
- Posts: 417
- Joined: Sat 21. Mar 2020, 19:02
- Location: Wittingen
Re: Mod'ing the Ext to Display User Email
It is as I initially thought, you have to change
In (line 373 in ver 1.4.2) and replace it with
Find (lines 470 - 472) and and insert the following as new line 473:
Now open (line 38) and replace it with the following lines:
For the other two tables the changes are quite similar; to add the e-mail address to the sleeper table please find in the function (line 591 in
and insert
Then insert as new line 689.
Open (line 34) and replace it with
For the last table (zeroposter) find in the (line 806) and insert
Then insert as new line 911.
Open (line 38) and replace it with
After saving these four files purge your forum's cache and you should see the e-mail address underneath the username in all three tables.
ur_acp.php
, acp_ur_reminder.html
, acp_ur_sleeper.html
and acp_ur_zeropoater.html
:In
ur_acp.php
find the following lines in the function reminder
:
Code: Select all
$query = 'SELECT user_id, group_id, user_regdate, username, user_posts, mot_last_login, user_colour, mot_reminded_one, mot_reminded_two ' .
Code: Select all
$query = 'SELECT user_id, group_id, user_regdate, username, user_email, user_posts, mot_last_login, user_colour, mot_reminded_one, mot_reminded_two ' .
Find
Code: Select all
$this->template->assign_block_vars('reminders', [
'SERVER_CONFIG' => append_sid("{$this->root_path}memberlist.$this->php_ext", ['mode' => 'viewprofile', 'u' => $row['user_id']]),
'USERNAME' => $row['username'],
Code: Select all
'USER_EMAIL' => $row['user_email'],
acp_ur_reminder.html
and find
Code: Select all
<td><a href="{{ reminder.SERVER_CONFIG }}" target="_blank" {% if reminder.USER_COLOUR %}style="color: #{{ reminder.USER_COLOUR }};" class="username-coloured"{% endif %}>{{ reminder.USERNAME }}</a></td>
Code: Select all
<td>
<a href="{{ reminder.SERVER_CONFIG }}" target="_blank" {% if reminder.USER_COLOUR %}style="color: #{{ reminder.USER_COLOUR }};" class="username-coloured"{% endif %}>{{ reminder.USERNAME }}</a><br>
{{ reminder.USER_EMAIL }}
</td>
For the other two tables the changes are quite similar; to add the e-mail address to the sleeper table please find in the function
sleeper
the following line:
Code: Select all
$sql = 'SELECT user_id, group_id, username, user_colour, user_regdate, mot_sleeper_remind
ur_acp.php
)and insert
user_email,
after username,
Then insert
Code: Select all
'USER_EMAIL' => $row['user_email'],
Open
acp_ur_sleeper.html
and find
Code: Select all
<td><a href="{{ registered_only.SERVER_CONFIG }}" target="_blank" {% if registered_only.USER_COLOUR %}style="color: #{{ registered_only.USER_COLOUR }};" class="username-coloured"{% endif %}>{{ registered_only.USERNAME }}</a></td>
Code: Select all
<td>
<a href="{{ registered_only.SERVER_CONFIG }}" target="_blank" {% if registered_only.USER_COLOUR %}style="color: #{{ registered_only.USER_COLOUR }};" class="username-coloured"{% endif %}>{{ registered_only.USERNAME }}</a><br>
{{ registered_only.USER_EMAIL }}
</td>
For the last table (zeroposter) find in the
sleeper
function of ur_acp.php
Code: Select all
$query = 'SELECT user_id, group_id, username, user_colour, user_regdate, mot_last_login, mot_reminded_one, mot_reminded_two
user_email,
after username,
Then insert
Code: Select all
'USER_EMAIL' => $row['user_email'],
Open
acp_ur_zeropoater.html
and find
Code: Select all
<td><a href="{{ zeroposter.SERVER_CONFIG }}" target="_blank" {% if zeroposter.USER_COLOUR %}style="color: #{{ zeroposter.USER_COLOUR }};" class="username-coloured"{% endif %}>{{ zeroposter.USERNAME }}</a></td>
Code: Select all
<td>
<a href="{{ zeroposter.SERVER_CONFIG }}" target="_blank" {% if zeroposter.USER_COLOUR %}style="color: #{{ zeroposter.USER_COLOUR }};" class="username-coloured"{% endif %}>{{ zeroposter.USERNAME }}</a><br>
{{ zeroposter.USER_EMAIL }}
</td>
After saving these four files purge your forum's cache and you should see the e-mail address underneath the username in all three tables.
Gruß
Mike
Mike
Re: Mod'ing the Ext to Display User Email
THANK YOU!!!! It worked perfect! Thank you for taking the time and giving step by step directions! It is very much appreciated!
- Mike-on-Tour
- Administrator
- Posts: 417
- Joined: Sat 21. Mar 2020, 19:02
- Location: Wittingen
Re: Mod'ing the Ext to Display User Email
Hey Mike,
Will the above still work for version 1.7.1?
Thanks!
~Dan
Will the above still work for version 1.7.1?
Thanks!
~Dan
- Mike-on-Tour
- Administrator
- Posts: 417
- Joined: Sat 21. Mar 2020, 19:02
- Location: Wittingen
Re: Mod'ing the Ext to Display User Email
Hi Dan,
I can't see any reason why this shouldn't work in any version of Userreminder although the line numbers may slightly be different - and BTW version 1.8.1 is available for download.
I can't see any reason why this shouldn't work in any version of Userreminder although the line numbers may slightly be different - and BTW version 1.8.1 is available for download.
Gruß
Mike
Mike
Re: Mod'ing the Ext to Display User Email
Thanks for the info! I'll get the update installed before I mod the code.
Re: Mod'ing the Ext to Display User Email
FYI - phpBB is still showing 1.7.1 as the latest.
- Mike-on-Tour
- Administrator
- Posts: 417
- Joined: Sat 21. Mar 2020, 19:02
- Location: Wittingen
Re: Mod'ing the Ext to Display User Email
I know, they take several weeks for validating but you can download it from this Board.
Gruß
Mike
Mike