PHP Code:
////put this in index
/////////////////////////////////////////////change nick alone
else if($action=="schimbanick")
{
$uid = getuid_sid($sid);
addonline(getuid_sid($sid),"Cumpara nick","");
echo "<card id=\"main\" title=\"n3sklub.com\">";
echo "<p align=\"center\"><small>";
echo "Welcome! Oprtiune This lets you buy a nick! As will be shorter the more expensive! Maximum: 4-14 characters!<br/><br/>";
echo "<onevent type=\"onenterforward\">";
$nume = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_users WHERE id='".$uid."'"));
echo "<refresh>
<setvar name=\"nick\" value=\"$nume[0]\"/>
";
echo "</refresh></onevent>";
echo "Nick<br/><input name=\"nick\" maxlength=\"14\" size=\"14\"/><br/>";
echo "<anchor>Verifica";
echo "<go href=\"index.php?action=verificanick&sid=$sid\" method=\"post\">";
echo "<postfield name=\"nick\" value=\"$(nick)\"/>";
echo "</go></anchor>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\">";
echo "home</a>";
echo "</small></p></card>";
}
//////////////////////////////////////////verifica
else if($action=="verificanick")
{
addonline(getuid_sid($sid),"serch nick","");
$nick = $_POST["nick"];
$uid = getuid_sid($sid);
echo "<card id=\"main\" title=\"n3sklub.com\">";
echo "<p align=\"center\"><small>";
$nickprezent = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_users WHERE id='".$uid."'"));
$dacaexista = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_users WHERE name='".$nick."'"));
if($nickprezent[0]!=$nick)
{
if($dacaexista[0]>0)
{
echo "Else already has the nick in use!<br/>";
}else{
$catelit = strlen($nick);
if($catelit < 4){
echo "Nick should not contain less than 4 characters!<br/>";
echo "<br/><br/><a href=\"index.php?action=schimbanick&sid=$sid\">Inapoi</a><br/>";
}else if($catelit == 4){
echo " You choose a nickname 4 characters, so will cost <b>10000</b> plusuri!<br/>";
#
echo nick is <b>$nick</b><br/>";
if(getplusses(getuid_sid($sid))<10000)
{
$cate = 10000 - getplusses(getuid_sid($sid));
echo "You need $cate plusuri<br/>";
}else{
echo "<anchor>enter";
echo "<go href=\"index.php?action=setezanick&sid=$sid\" method=\"post\">";
echo "<postfield name=\"nick\" value=\"$nick\"/>";
echo "<postfield name=\"bani\" value=\"10000\"/>";
echo "</go></anchor>";
}
#
echo "<br/><br/><a href=\"index.php?action=schimbanick&sid=$sid\">Inapoi</a><br/>";
}else if($catelit == 5){
echo "Nick should not contain less than 5 characters <b>7000</b> plusuri!";
#
echo "nick is <b>$nick</b><br/>";
if(getplusses(getuid_sid($sid))<7000)
{
$cate = 7000 - getplusses(getuid_sid($sid));
echo "Iti mai trebuie $cate plusuri<br/>";
}else{
echo "<anchor>enter";
echo "<go href=\"index.php?action=setezanick&sid=$sid\" method=\"post\">";
echo "<postfield name=\"nick\" value=\"$nick\"/>";
echo "<postfield name=\"bani\" value=\"7000\"/>";
echo "</go></anchor>";
}
#
echo "<br/><br/><a href=\"index.php?action=schimbanick&sid=$sid\">Inapoi</a><br/>";
}else if($catelit == 6){
echo "Ai ales un nick de 6 caractere, deci te va costa <b>4000</b> plusuri!";
#
echo "Numele ales este <b>$nick</b><br/>";
if(getplusses(getuid_sid($sid))<4000)
{
$cate = 4000 - getplusses(getuid_sid($sid));
echo "Iti mai trebuie $cate plusuri<br/>";
}else{
echo "<anchor>Aplica";
echo "<go href=\"index.php?action=setezanick&sid=$sid\" method=\"post\">";
echo "<postfield name=\"nick\" value=\"$nick\"/>";
echo "<postfield name=\"bani\" value=\"4000\"/>";
echo "</go></anchor>";
}
#
echo "<br/><br/><a href=\"index.php?action=schimbanick&sid=$sid\">Inapoi</a><br/>";
}else if($catelit > 6){
echo "Ai ales un nick de $catelit caractere, deci te va costa <b>2000</b> plusuri!";
#
echo "Numele ales este <b>$nick</b><br/>";
if(getplusses(getuid_sid($sid))<2000)
{
$cate = 2000 - getplusses(getuid_sid($sid));
echo "Iti mai trebuie $cate plusuri<br/>";
}else{
echo "<anchor>Aplica";
echo "<go href=\"index.php?action=setezanick&sid=$sid\" method=\"post\">";
echo "<postfield name=\"nick\" value=\"$nick\"/>";
echo "<postfield name=\"bani\" value=\"2000\"/>";
echo "</go></anchor>";
}
#
echo "<br/><br/><a href=\"index.php?action=schimbanick&sid=$sid\">Inapoi</a><br/>";
}
}}else{
echo "This nickname already use!!<br/>";
}
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Acasa</a>";
echo "</small></p></card>";
}
///////////////////////////////////////////////seteaza
else if($action=="setezanick")
{
addonline(getuid_sid($sid),"Set nick bought!","");
$nick = $_POST["nick"];
$bani = $_POST["bani"];
echo "<card id=\"main\" title=\"N3sklub.Com\">";
echo "<p align=\"center\"><small>";
$idmeu = getuid_sid($sid);
$nickprezent = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_users WHERE id='".$uid."'"));
$dacaexista = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_users WHERE name='".$nick."'"));
if($nickprezent[0]!=$nick)
{
if($dacaexista[0]>0)
{
echo " Else already has the nick in use!<br/>";
}else{
$plsmele = mysql_fetch_array(mysql_query("SELECT plusses FROM lib3rtymrc_users WHERE id='".$uid."'"));
$ramas = $plsmele[0]-$bani;
if($plsmele[0] <$bani){
echo "You have enough plusess to buy this nick!<br/>";
}else{
$res = mysql_query("UPDATE lib3rtymrc_users SET name='".$nick."', plusses='".$ramas."', lastplreas='A cumparat nick: $nick' WHERE id='".$idmeu."'");
if($res)
{
echo "<b>$nick</b> succes!<br/>";
echo "<b>$bani</b> extracted from your account!<br/>";
}else{
echo "Eroare in dBase!<br/>";
}
}
}}else{
echo "This nickname already use!!<br/>";
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\">";
echo "Acasa</a>";
echo "</small></p></card>";
}
PHP Code:
//////////////////code
echo"<a href=\"index.php?action=schimbanick&sid=$sid\">Buy your nick</a><br/>";
Comment