[Development] Gunz User Panel [Emisand-Panel Based]
Hello,
I was thinking of making a user panel for GunZ, however because I am not that well experienced with PHP I am basing it off of Emisands Admin Panel. So far I have only one function in it, and that would be to change a characters name:
Preview:
Index:
http://i36.tinypic.com/2vabe45.jpg
Manage Characters:
http://i34.tinypic.com/302xwt5.jpg
For now it is not a lot I know, but I am wondering if I can team up with someone on this, seeing as I am not really that good in PHP, I understand the code but just not know the knowledge of it yet. :P:
Credits (so far):
Emisand - Panel
Lambda - Design
Me - Editing the panel
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Koreans made one before a few months ago. It was also based on Emisands V3 administration panel. Wasn't using the panel GUI, though.
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Quote:
Originally Posted by
`Styx
Koreans made one before a few months ago. It was also based on Emisands V3 administration panel. Wasn't using the panel GUI, though.
Oh right, yea I think I might be the first or second one trying to use the GUI, not sure if I am.
Because I am also not well at PHP, I was wondering how do you make the character name only change for that persons account?
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Quote:
Originally Posted by
SHEEN[GB]
Oh right, yea I think I might be the first or second one trying to use the GUI, not sure if I am.
Because I am also not well at PHP, I was wondering how do you make the character name only change for that persons account?
Code:
if ($charname != $ownerofcharname)
die();
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Quote:
Originally Posted by
Linear88
Code:
if ($charname != $ownerofcharname)
die();
Sweet, thanks Linear!
Edit - Where in the code do I put this?
Re: [Development] Gunz User Panel [Emisand-Panel Based]
also can you add a change password for the account and the clan delete and etc..
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Quote:
Originally Posted by
Linear88
Code:
if ($charname != $ownerofcharname)
die();
Do a drop down to select only your characters
PHP Code:
<select size="1" name="cid">
<?
$codigo1 = mssql_query("SELECT Name, CID FROM Character(nolock) WHERE AID = {$_SESSION['AID']} AND CharNum != '-1'");
while( $char = mssql_fetch_array($codigo1) )
{
?>
<option value="<?=$char['CID']?>"><?=$char['Name']?></option>
<?
}
?>
</select>
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Can you guys correct me if I am wrong here, the drop down box is blank, so I am kinda confused why it's not showing my characters:
Code:
<?php
if( !ereg("index.php", $_SERVER['PHP_SELF']) )
{
header("Location: index.php");
die();
}
showmessage();
if( isset($_POST['changename']) )
{
$type = clean_sql($_POST['type']);
$id = clean_sql($_POST['id']);
$nname = clean_sql($_POST['nname']);
if( $type == "" || $id == "" || $nname == "" )
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
$query01 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$nname'");
if( num_rows($query01) != 0 )
{
setmessage("Name Change", sprintf($_STR[Char23], $nname));
redirect("index.php?do=characters");
die();
}
if( $type == 0 )
{
$query02 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$id'");
$part = "Name";
}
elseif( $type == 1 )
{
$query02 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE CID = '$id'");
$part = "CID";
}
else
{
redirect("index.php?do=characters");
die();
}
if( num_rows($query02) != 1 )
{
setmessage("Name Change", $_STR[Char24]);
redirect("index.php?do=characters");
die();
}
else
{
odbc_exec($connection, "UPDATE {$_CONFIG[CharTable]} SET Name = '$nname' WHERE $part = '$id'");
writetolog( sprintf($_STR[Log5], $id, $nname) );
setmessage("Name Change", $_STR[Char25]);
redirect("index.php?do=characters");
die();
}
if ($charname != $ownerofcharname)
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
}
?>
<br />
<table border="1" style="border-collapse: collapse" id="changename">
<tr><td colspan="2"><b><?php echo $_STR[Char0]; ?></b></td></tr>
<tr><td colspan="2"> </td></tr>
<form method="post" action="index.php?do=characters">
<tr>
<td>
<select size="1" name="cid">
<?
$codigo1 = mssql_query("SELECT Name, CID FROM Character(nolock) WHERE AID = {$_SESSION['AID']} AND CharNum != '-1'");
while( $char = mssql_fetch_array($codigo1) )
{
?>
<option value="<?=$char['CID']?>"><?=$char['Name']?></option>
<?
}
?>
</select> <?php echo $_STR[Char2]; ?>: <input type="text" name="nname" />
<input type="submit" name="changename" value="<?php echo $_STR[Char3]; ?>" />
</td>
</tr>
<tr><td colspan="2"> </td></tr>
</form>
</table>
<br /><br />
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Quote:
Originally Posted by
SHEEN[GB]
Can you guys correct me if I am wrong here, the drop down box is blank, so I am kinda confused why it's not showing my characters:
Code:
<?php
if( !ereg("index.php", $_SERVER['PHP_SELF']) )
{
header("Location: index.php");
die();
}
showmessage();
if( isset($_POST['changename']) )
{
$type = clean_sql($_POST['type']);
$id = clean_sql($_POST['id']);
$nname = clean_sql($_POST['nname']);
if( $type == "" || $id == "" || $nname == "" )
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
$query01 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$nname'");
if( num_rows($query01) != 0 )
{
setmessage("Name Change", sprintf($_STR[Char23], $nname));
redirect("index.php?do=characters");
die();
}
if( $type == 0 )
{
$query02 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$id'");
$part = "Name";
}
elseif( $type == 1 )
{
$query02 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE CID = '$id'");
$part = "CID";
}
else
{
redirect("index.php?do=characters");
die();
}
if( num_rows($query02) != 1 )
{
setmessage("Name Change", $_STR[Char24]);
redirect("index.php?do=characters");
die();
}
else
{
odbc_exec($connection, "UPDATE {$_CONFIG[CharTable]} SET Name = '$nname' WHERE $part = '$id'");
writetolog( sprintf($_STR[Log5], $id, $nname) );
setmessage("Name Change", $_STR[Char25]);
redirect("index.php?do=characters");
die();
}
if ($charname != $ownerofcharname)
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
}
?>
<br />
<table border="1" style="border-collapse: collapse" id="changename">
<tr><td colspan="2"><b><?php echo $_STR[Char0]; ?></b></td></tr>
<tr><td colspan="2"> </td></tr>
<form method="post" action="index.php?do=characters">
<tr>
<td>
<select size="1" name="cid">
<?
$codigo1 = mssql_query("SELECT Name, CID FROM Character(nolock) WHERE AID = {$_SESSION['AID']} AND CharNum != '-1'");
while( $char = mssql_fetch_array($codigo1) )
{
?>
<option value="<?=$char['CID']?>"><?=$char['Name']?></option>
<?
}
?>
</select> <?php echo $_STR[Char2]; ?>: <input type="text" name="nname" />
<input type="submit" name="changename" value="<?php echo $_STR[Char3]; ?>" />
</td>
</tr>
<tr><td colspan="2"> </td></tr>
</form>
</table>
<br /><br />
Code:
if ($charname != $ownerofcharname)
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
$charname and $ownerofcharname was not defined.
For the drop down box, did you enable short tags?
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Yes, short tags are enabled.
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Re: [Development] Gunz User Panel [Emisand-Panel Based]
Is no use having a panel of users off the web or separated from the environment ..
It looks very ugly.
Re: [Development] Gunz User Panel [Emisand-Panel Based]
i like it, add a banner :D
Re: [Development] Gunz User Panel [Emisand-Panel Based]