in includes/function_content
DO NOT make the following edit as it will break the ability to pull users form a search in the admin panel because it will try to use the Real NAme rather than the username. Thus returning a "user Not Found" error.
Code: Select all
if ($guest_username === false)
{
$sql = "SELECT * FROM `phpbb_users` WHERE `user_id` = '" . $user_id . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$username = ($row['user_from']) ? $row['user_from'] : $username;
$db->sql_freeresult($result);
}
$username = ($username) ? $username : $user->lang['GUEST'];
.
This way the internal workings can still retrieve the physical username when needed, and we can adjust all the outward facing displaying to use Real Name instead without disrupting other features.
To do this you'll need to start hacking away at
index.php, viewforum.php, and viewtopic.php, includes/functions_posting.php
Basically just do a global search on get_username_string(. Look where it is(the context of its use) and change to get_realname_string( as needed.
Example, we'll change the 'newest member' section of index.php that is shown at the foot on the index page
Starting ~ line 115 The NEWEST_USER is the line we care about.
Code: Select all
// Assign index specific vars
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_realname_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
In all I probably had to replace this method call in about 20 places. But to ensure the integrity of the service i think it is worth it.