• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Adding show / hide accountmanagement.php

bok

Member
Joined
Apr 28, 2009
Messages
332
Reaction score
6
Location
127.0.0.1/Brasil/Goias
how to put this:vPPRGt1.jpg
PHP:
<tr style="background-color:'.$config['site']['darkborder'].';" >
<td class="LabelV" >Account Name:</td>
<td style="width:90%;" >
<div style="position:relative;width:100%;" >
<span id="DisplayAccountID" >********</span>
<span id="MaskedAccountID" style="visibility:hidden;display:none" >********</span>
<span id="ReadableAccountID" style="visibility:hidden;display:none" >'.$account_logged->getCustomField("name").'</span>
<img id="ButtonAccountID" onMouseDown="ToggleMaskedText('AccountID');" style="position:absolute;right:0px;top:2px;cursorointer;" src="/images/show.gif" />
</div>
</td>
</tr>
<tr style="background-color:'.$config['site']['lightborder'].';" >
<td class="LabelV" >Email Address:</td><td style="width:90%;" >
<div style="position:relative;width:100%;" >
<span id="DisplayEMail" >****************</span>
<span id="MaskedEMail" style="visibility:hidden;display:none" >**************</span>
<span id="ReadableEMail" style="visibility:hidden;display:none" >'.$account_email.'</span>
<img id="ButtonEMail" onMouseDown="ToggleMaskedText('EMail');" style="position:absolute;right:0px;top:2px;cursorointer;" src="/images/show.gif" />
</div>
</td>
</tr>
 
Last edited:
Code:
<tr style="background-color:#D4C0A1;">
	<td class="LabelV">Account Name:</td>
	<td style="width:90%;">
		<div style="position:relative;width:100%;">
			<span id="DisplayAccountID">'.createStars($account_logged->getCustomField('name')).'</span>
			<span id="MaskedAccountID" style="visibility:hidden;display:none">'.createStars($account_logged->getCustomField('name')).'</span>
			<span id="ReadableAccountID" style="visibility:hidden;display:none">'.$account_logged->getCustomField('name').'</span>
			<img id="ButtonAccountID" onMouseDown="ToggleMaskedText(\'AccountID\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="images/global/general/show.gif">
		</div>
	</td>
</tr>
<tr style="background-color:#F1E0C6;">
	<td class="LabelV">Email Address:</td>
	<td style="width:90%;">
		<div style="position:relative;width:100%;">
			<span id="DisplayEMail">'.createStars($account_email).'</span>
			<span id="MaskedEMail" style="visibility:hidden;display:none">'.createStars($account_email).'</span>
			<span id="ReadableEMail" style="visibility:hidden;display:none">'.$account_email.'</span>
			<img id="ButtonEMail" onMouseDown="ToggleMaskedText(\'EMail\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="images/global/general/show.gif">
		</div>
	</td>
</tr>

Add to config-and-functions.php
PHP:
function createStars($string)
{
	for ($i = 1; $i <= strlen($string); $i++)
		$s .= '*';
	
	return $s;
}

And to mainmenu.js this (if you don't have it arleady)
Code:
// toggle masked texts with readable texts
function ToggleMaskedText(a_TextFieldID)
{
  m_DisplayedText = document.getElementById('Display' + a_TextFieldID).innerHTML;
  m_MaskedText = document.getElementById('Masked' + a_TextFieldID).innerHTML;
  m_ReadableText = document.getElementById('Readable' + a_TextFieldID).innerHTML;
  if (m_DisplayedText == m_MaskedText) {
    document.getElementById('Display' + a_TextFieldID).innerHTML = document.getElementById('Readable' + a_TextFieldID).innerHTML;
    document.getElementById('Button' + a_TextFieldID).src =  JS_DIR_IMAGES + '/global/general/hide.gif';
  } else {
    document.getElementById('Display' + a_TextFieldID).innerHTML = document.getElementById('Masked' + a_TextFieldID).innerHTML;
    document.getElementById('Button' + a_TextFieldID).src =  JS_DIR_IMAGES + '/global/general/show.gif';
  }
}
 
Isn't it supposed to change picture while clicking on the picture?

******* = show.gif

571515 = hide.gif
 
Thank you so very expensive, and if I want rather then change the email for password I use sha1?
i try
PHP:
<tr style="background-color:#F1E0C6;">    
<td class="LabelV">Password:</td>    
<td style="width:90%;">        
<div style="position:relative;width:100%;">            
<span id="DisplayEMail">'.createStars($account_logged->getPassword()).'</span>            
<span id="MaskedEMail" style="visibility:hidden;display:none">'.createStars($account_logged->getPassword()).'</span>            
<span id="ReadableEMail" style="visibility:hidden;display:none">'.$account_logged->getPassword().'</span>            
<img id="ButtonEMail" onMouseDown="ToggleMaskedText(\'EMail\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="http://otland.net/images/global/general/show.giff">        
</div>    
</td></tr>
 
Last edited:
Code:
<tr style="background-color:#F1E0C6;">
	<td class="LabelV">Password:</td>
	<td style="width:90%;">
		<div style="position:relative;width:100%;">
			<span id="DisplayPassword>'.createStars($account_logged->getPassword()).'</span>
			<span id="MaskedPassword" style="visibility:hidden;display:none">'.createStars($account_logged->getPassword()).'</span>
			<span id="ReadablePassword" style="visibility:hidden;display:none">'.$account_logged->getPassword().'</span>
			<img id="ButtonPassword" onMouseDown="ToggleMaskedText(\'Password\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="images/global/general/show.gif">
		</div>
	</td>
</tr>
 
How should the code look like if it's supposed to change picture?

Currently it is the show.gif whenever the account name/email is hidden or not.
 
Back
Top