hi everyone, I need to insert this query for name locked
call to
how do i get the name locked selected?
Code:
$rename = $SQL->query('SELECT `name` `id` from `players` WHERE `id` IN (SELECT `player_id` FROM `player_namelocks`) ORDER BY `name` DESC');
foreach($rename as $namelock) {
$players++;
$number++;
if(is_int($players / 2))
$bgcolor = $config['site']['lightborder'];
else
$bgcolor = $config['site']['darkborder'];
$main_content .= '
<div class="SmallBox" >
<div class="MessageContainer" >
<div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/global/content/box-frame-horizontal.gif);" /></div>
<div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/global/content/box-frame-edge.gif);" /></div>
<div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/global/content/box-frame-edge.gif);" /></div>
<div class="Message" >
<div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/global/content/box-frame-vertical.gif);" /></div>
<div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/global/content/box-frame-vertical.gif);" /></div>
<table class="HintBox" >
<tr>
<td>
<div class="BoxButtons" >
<form action="?subtopic=accountmanagement&action=rename" method="post" style="padding:0px;margin:0px;" >
<div class="BigButton" style="background-image:url('.$layout_name.'/images/global/buttons/sbutton.gif)" >
<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
<div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/global/buttons/sbutton_over.gif);" ></div>
<input class="ButtonText" type="image" name="Name Locked" alt="Name Locked" src="'.$layout_name.'/images/global/buttons/_sbutton_namelocked.gif" >
</div>
</div>
</form>
<div style="font-size:1px;height:4px;" ></div>
</div>
<p><b><a href="?subtopic=characters&name='.urlencode($namelock['id']).'">'.$namelock['id'].'</a></b></p>
<p>When the name of a character violates rule of the Server, that character will receive a namelock</p>
</td>
<tr>
</table>
</div>
<div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/global/content/box-frame-horizontal.gif);" /></div>
<div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/global/content/box-frame-edge.gif);" /></div>
<div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/global/content/box-frame-edge.gif);" /></div>
</div>
</div><br/>';}
Code:
if($action == "rename")
{
$main_content .= '<form action="?subtopic=accountmanagement" method="post">
New Player Name <input type="text" name="newname"><br>
Old Player Name <input type="text" name=""><br><input type="submit" value="OK" name="ok1"></form>';
}
how do i get the name locked selected?
Code:
if (isset($_POST['ok1'])){
$SQL->query("UPDATE `players` SET `name` = ".$SQL->quote( $_POST['newname'] )." WHERE name = ".$SQL->quote( $_POST['name0'] ).";");
$main_content .= "Player name has been changed.";}