[REQ] Real Name MOD adapted for phpBB 3

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
nouveau
Registered User
Posts: 256
Joined: Tue Mar 27, 2007 1:51 pm

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by nouveau » Thu Aug 28, 2008 11:13 am

The mod in it's current form doesn't allow for duplicate names, although the checking could probably be disabled to a degree.
Formerly known as xceler8shun

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Thu Aug 28, 2008 11:36 am

xceler8shun wrote:The mod in it's current form doesn't allow for duplicate names, although the checking could probably be disabled to a degree.
Oh, no! I am really out of luck... :(

I should probably not ask you how we can do that, since it will take at least 1 hour to install your MOD... perhaps a lot more to figure out what I need. :cry: Maybe if you could add this option into a new version? :)

I have taken this discussion into the other thread:
http://www.phpbb.com/community/viewtopi ... &p=6810705
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Fri Sep 05, 2008 6:04 pm

1) I have installed this MOD:
http://www.phpbb.com/community/viewtopi ... &t=1116805

But as the author says, it's only adding a new field for you to insert the displayed name. If you try to use the same username (or loginname) already taken, the system won't let you, and by removing that checking, it will return the same duplicate key error.

2) I have checked the Real Name MOD (which is working exactly the way I want), to see how the author managed to force phpBB 2 to use the same displayed name for different users, and I saw those changes. Pay very attention to the last one.

Code: Select all

# 
#-----[ OPEN ]----------------------------------------------------------------- 
#  
includes/functions.php

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
			$sql = "SELECT user_id, username

#
#-----[ IN-LINE FIND ]---------------------------------------------------------
#
username

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
# 
, realname, user_viewrealname

#
#-----[ FIND ]-----------------------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]----------------------------------------------------------
#
function getrealname ($username, $realname, $override, $user_viewrealname)
{
if ( $override || $user_viewrealname)
{
	$result = $realname;
}
else
{
	$result = $username;
}
return $result;
}
Then I tried something like that on the functions_user.php file from phpBB 3:

Code: Select all

/**
* Adds an user
*
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
* @return: the new user's ID.
*/
function user_add($user_row, $cp_data = false)
{
	global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;

	if (empty($user_row['username']) || empty($user_row['loginname']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
	{
		return false;
	}

	$username_clean = utf8_clean_string($user_row['username']);
	$loginname_clean = utf8_clean_string($user_row['loginname']);

	if (empty($username_clean))
	{
		return false;
	}
	if (empty($loginname_clean))
	{
		return false;
	}
	if ( $override || $username_clean)
	{
	$result = $loginname;
	}
	else
	{
	$result = $username;
	}
	return $result;
	}
And here comes the new parse error:

Parse error: syntax error, unexpected '}' in /home/follwer/public_html/includes/functions_user.php on line 313

Lines 302 to 313:

Code: Select all

		$sql = 'SELECT group_colour
			FROM ' . GROUPS_TABLE . '
			WHERE group_id = ' . (int) $user_row['group_id'];
		$result = $db->sql_query_limit($sql, 1);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		set_config('newest_user_colour', $row['group_colour'], true);
	}

	return $user_id;
}
What is the fracking connection here??????????

The answer is yelling at my face and I can't see! :cry:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Sat Sep 13, 2008 1:55 pm

The "override" command was related to the ability to override real name (the admin removing that option from the user), not one feature that is ignoring checkings on the Real Name hack. I was wrong again... :(
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Sun Sep 21, 2008 10:23 pm

*bump* :ugeek:

Still looking for a cloning solution... :cry:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

Sadr
Registered User
Posts: 2
Joined: Mon Aug 06, 2007 3:12 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Sadr » Mon Sep 29, 2008 9:24 am

Isn't this thread about accomplishing the same thing that's already being worked on here?

I just don't see any reason for this thread to go on as long as there's a mod in development already which deserves the most attention regarding this topic.

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Tue Sep 30, 2008 10:17 am

That MOD (Separate Login and User Name 0.0.3) is not allowing users to duplicate displayed or login names. And the "Real Name MOD" from phpBB 2 is doing that on displayed names.
Example:

Login: Linda Carter
Displayed name (on viewtopic, viewforum, viewprofile, etc.): Acyd Burn

Login: Sadr
Displayed name (on viewtopic, viewforum, viewprofile, etc.): Acyd Burn
Which means, even if the MODs are virtually the same, they are completely different on that regard.

When I posted my request in that thread you quoted, my post was moved here:
http://www.phpbb.com/community/viewtopi ... &t=1169235

Which is now another thread with a second and different request.

I tried to contact the "Real Name" phpBB 2 MOD author, but he didn't replied. Not sure if he received my message. It seems many phpBB 2 MODs are not being updated by the authors, perhaps because they don't have enough time to work with them, considering the phpBB 3 system is entirely different, it shouldn't be easy.

Both "Real Name" and "Separate Login" MODs will require at least 45-60 minutes to be installed. But the cloning trick from Real Name MOD should not be that hard to be discovered and implemented.

As you can see, changing just a little bit the original code will not allow me to use the same displayed name for all users (look at my attempts before). Only experienced phpBB users should be able to solve this issue and present a solution to allow us to have different users sharing the same "displayed name" (clones).

For the record: I don't need the entire "Real Name MOD" converted to the phpBB 3 system. If the "Separate Login and User Name 0.0.3" * MOD can have that cloning feature, that should be enough for me. :)

* http://www.phpbb.com/community/viewtopi ... &t=1116805
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Fri Oct 31, 2008 8:00 pm

*bump* :geek:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Real Name MOD adapted for phpBB 3

Post by Linda Carter » Wed Dec 24, 2008 10:44 pm

I was thinking about something today that can simply solve this issue once and for all! I haven't tested yet, but listen!

1) The Real Name MOD is working exactly like the Separate Login and User Name hack from phpBB 3.

2) The difference between both of them is that the Real Name hack is displaying the second username (please, do not confuse "Displayed username" with "Real login-name") from each user, while the phpBB 3 hack is doing the opposite, following the pattern used by phpBB's default package.

So, after reading the Real Name readme, I was able to find these instructions, related to the subSilver style. The attention must be focused in the style, because if the style can display what we want to, the problem is already solved! 8-)

Take a look (instructions taken from the Real Name hack):

Code: Select all

#
#-----[ OPEN ]-----------------------------------------------------------------
#
templates/subSilver/groupcp_info_body.tpl

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
	  <th class="thTop">{L_USERNAME}</th>

# 
#-----[ REPLACE WITH ]---------------------------------------------------------
# 
	  <th class="thTop">{L_NAME}</th>

#
#-----[ OPEN ]-----------------------------------------------------------------
#
templates/subSilver/memberlist_body.tpl

#
#-----[ FIND ]-----------------------------------------------------------------
#
	  <th class="thTop" nowrap="nowrap">{L_USERNAME}</th>

# 
#-----[ REPLACE WITH ]---------------------------------------------------------
# 
	  <th class="thTop" nowrap="nowrap">{L_NAME}</th>
#
#-----[ FIND ]-----------------------------------------------------------------
#
	  <td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span></td>

# 
#-----[ REPLACE WITH ]---------------------------------------------------------
# 
	  <td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.NAME}</a></span></td>
# 
#-----[ OPEN ]-----------------------------------------------------------------
#  
templates/subSilver/profile_add_body.tpl

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
	<!-- BEGIN switch_namechange_allowed -->
	<tr> 
		<td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
		<td class="row2"><input type="text" class="post" style="width:200px" name="username" size="25" maxlength="25" value="{USERNAME}" /></td>
	</tr>
	<!-- END switch_namechange_allowed -->

# 
#-----[ AFTER, ADD ]-----------------------------------------------------------
# 
	<tr> 
	<!-- BEGIN switch_requirerealname -->
		<td class="row1" width="38%"><span class="gen">{L_REALNAME}: *</span></td>
	<!-- END switch_requirerealname -->		
	<!-- BEGIN switch_notrequirerealname -->
		<td class="row1" width="38%"><span class="gen">{L_REALNAME}: </span></td>
	<!-- END switch_notrequirerealname -->		
	<!-- BEGIN switch_realnamechange_disallowed -->
		<td class="row2"><input type="hidden" name="realname" value="{REALNAME}" /><span class="gen"><b>{REALNAME}</b></span></td>
	<!-- END switch_realnamechange_disallowed -->		
	<!-- BEGIN switch_realnamechange_allowed -->
		<td class="row2"><input type="text" class="post" style="width:200px" name="realname" size="25" maxlength="25" value="{REALNAME}" /></td>
	<!-- END switch_realnamechange_allowed -->
	</tr> 

#
#-----[ FIND ]-----------------------------------------------------------------
#
	<tr> 
	  <th class="thSides" colspan="2" height="25" valign="middle">{L_PREFERENCES}</th>
	</tr>

#
#-----[ AFTER, ADD ]-----------------------------------------------------------
#
	<tr>
	  <td class="row1"><span class="gen">{L_PUBLIC_VIEW_REALNAME}:</span></td>
	  <td class="row2">
		<input type="radio" name="viewrealname" value="1" {VIEW_REALNAME_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp;
		<input type="radio" name="viewrealname" value="0" {VIEW_REALNAME_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

# 
#-----[ OPEN ]-----------------------------------------------------------------
#  
templates/subSilver/profile_view_body.tpl 

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
  <tr> 
	<td class="row1" height="6" valign="top" align="center">{AVATAR_IMG}<br /><span class="postdetails">{POSTER_RANK}</span></td>
	<td class="row1" rowspan="3" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="3">

# 
#-----[ AFTER, ADD ]-----------------------------------------------------------
# 
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_NAME}:&nbsp;</span></td>
		  <td width="100%"><b><span class="gen">{REALNAME}</span></b></td>
		</tr>

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
  <tr> 
	<td class="catLeft" align="center" height="28"><b><span class="gen">{L_CONTACT} {USERNAME} </span></b></td>
  </tr>

# 
#-----[ IN-LINE FIND ]---------------------------------------------------------
# 

{L_CONTACT} {USERNAME}

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------------------------
# 
{L_CONTACT} {REALNAME}

# 
#-----[ OPEN ]-----------------------------------------------------------------
#  
templates/subSilver/admin/board_config_body.tpl

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
	<tr>
	  <th class="thHead" colspan="2">{L_AVATAR_SETTINGS}</th>
	</tr>

# 
#-----[ BEFORE, ADD ]----------------------------------------------------------
# 
	<tr>
	  <th class="thHead" colspan="2">{L_REALNAME_SETTINGS}</th>
	</tr>
	<tr>
		<td class="row1">{L_REQUIRE_REALNAME}</td>
		<td class="row2"><input type="radio" name="require_realname" value="1" {REQUIREREALNAME_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="require_realname" value="0" {REQUIREREALNAME_NO} /> {L_NO}</td>
	</tr>
	<tr>
		<td class="row1">{L_ALLOW_REALNAME_CHANGE}</td>
		<td class="row2"><input type="radio" name="allow_realnamechange" value="1" {REALNAMECHANGE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_realnamechange" value="0" {REALNAMECHANGE_NO} /> {L_NO}</td>
	</tr>
	<tr>
		<td class="row1">{L_OVERRIDE_REALNAME}<br /><span class="gensmall">{L_OVERRIDE_REALNAME_EXPLAIN}</span></td>
		<td class="row2"><input type="radio" name="override_user_realname" value="1" {OVERRIDE_REALNAME_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="override_user_realname" value="0" {OVERRIDE_REALNAME_NO} /> {L_NO}</td>
	</tr>
	
# 
#-----[ OPEN ]-----------------------------------------------------------------
#  
templates/subSilver/admin/user_edit_body.tpl

# 
#-----[ FIND ]-----------------------------------------------------------------
# 
	<tr> 
	  <td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="username" size="35" maxlength="40" value="{USERNAME}" />
	  </td>
	</tr>

# 
#-----[ AFTER, ADD ]-----------------------------------------------------------
# 
	<tr> 
	  <td class="row1" width="38%"><span class="gen">{L_REALNAME}: *</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="realname" size="35" maxlength="40" value="{REALNAME}" />
	  </td>
	</tr>
#
#-----[ FIND ]-----------------------------------------------------------------
#
	  <th class="thSides" colspan="2">{L_PREFERENCES}</th>
	</tr>

#
#-----[ AFTER, ADD ]-----------------------------------------------------------
#
	<tr>
	  <td class="row1"><span class="gen">{L_PUBLIC_VIEW_REALNAME}</span></td>
	  <td class="row2"> 
		<input type="radio" name="viewrealname" value="1" {VIEW_REALNAME_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="viewrealname" value="0" {VIEW_REALNAME_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

# 
Instructions taken from the phpBB 3 hack:

Open: styles/prosilver/template/index_body.html

FIND:

Code: Select all

			<label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> 
REPLACE WITH:

Code: Select all

			<label for="loginname">{L_LOGINNAME}:</label>&nbsp;<input type="text" name="loginname" id="loginname" size="10" class="inputbox" title="{L_LOGINNAME}" /> 
Open: styles/prosilver/template/login_body.html

FIND:

Code: Select all

		<dl>
			<dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}:</label></dt>
			<dd><input type="text" tabindex="1" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
		</dl>
REPLACE WITH:

Code: Select all

		<dl>
			<dt><label for="{LOGINNAME_CREDENTIAL}">{L_LOGINNAME}:</label></dt>
			<dd><input type="text" tabindex="1" name="{LOGINNAME_CREDENTIAL}" id="{LOGINNAME_CREDENTIAL}" size="25" value="{LOGINNAME}" class="inputbox autowidth" /></dd>
		</dl>
AND THE LIST GOES ON...

THE PHPBB3 HACK CAN BE FOUND HERE
:

http://www.phpbb.com/community/viewtopic.php?t=1116805

******************************************************

I think now, it's veeeeeeeery much easy to think about a solution, it's just a case to force the proSilver/subSilver styles to recognize the "Username" instead of the "Login Name". :)

EDIT: OK, not so fast.... I believe the phpBB 3 hack is not allowing duplicates on the User-name field... :cry:

Image

***************************************************

Perhaps the style needs to be altered to display any other info saved on the profile that can be duplicated/used by all members at the same time. I mean, if we insert on the "Location" field something like "Somewhere along the infinite corridors of time", then you will all see this instead of Linda Carter, on all my threads/the board itself. :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

Locked

Return to “[3.0.x] MOD Requests”