hey guys please learn me fast in the shop i want to add more files like ive got the nick changer code so i want users to buy it then the code will be unlocked to them and any other like more themes etc what code do i use and sql
Shoping Cart Lava
Collapse
X
-
here are sumthing ive doen but not tested please tell me if its ok
in shops-func
Code:if($action=="nicknamechange") { addonline(getuid_sid($sid),"$stitle Shop",""); $pstyle = gettheme($sid); echo xhtmlhead("$stitle shop",$pstyle); echo "<p align=\"center\">"; $ownid[0]=1; $whoid=$_GET["who"]; $nick = getnick_sid($sid); $who = getuid_nick($nick); $credits = mysql_fetch_array(mysql_query("SELECT nicknamechange FROM ibwf_users WHERE id='".$who."'")); echo "<b><u>Change Ur Nickname</u></b><br/>"; echo "</p>"; echo "<p>"; if(2500>$credits[0]) { echo "You don't have enough credits to buy this itme.<br/>"; }else{ mysql_query("UPDATE ibwf_users SET nicknamechange='1' WHERE id='".$who."'"); $ugpl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'")); $ugpl = $ugpl[0] - 2500; mysql_query("UPDATE ibwf_users SET plusses='".$ugpl."' WHERE id='".$who."'"); echo "Congrats, you have just enable Nick name changer<br/>"; } echo "</p>"; ////// UNTILL HERE >> echo "<p align=\"center\">"; echo "<a href=\"mshop.php?action=main&sid=$sid\">Back to Shop</a><br/>"; echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo "</p>"; echo xhtmlfoot(); }
Code:if($action=="shop4") { addonline(getuid_sid($sid),"$stitle Shop",""); $pstyle = gettheme($sid); echo xhtmlhead("$stitle shop",$pstyle); echo "<p align=\"center\">"; $nick = getnick_sid($sid); $who = getuid_nick($nick); echo "<b><u>Extras</u></b><br/>"; echo "<small>Buy new Feauters for the $stitle Chat/Forum</small><br/>"; echo "</p>"; echo "<p><small>"; echo "Nickname changer<br/>"; echo " <small>Price: <b>2500Credits</b></small><br/>"; echo " <small>Availible: <b>Unlimeted</b></small><br/>"; echo " <small><a href=\"mshops-func.php?action=nicknamechange&sid=$sid\"><b>Buy Item</b></a></small><br/><br/>"; echo "</small></p>"; ////// UNTILL HERE >> echo "<p align=\"center\">"; echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo "</p>"; echo "</p>"; echo xhtmlfoot(); }
Code:echo "<a href=\"mshops.php?action=shop4&sid=$sid\">Extra</a><br/>";
nicknamechange int 100 default 0
this is basicly all codes needed but when i make a purchase it say i dnt have enough credits but i have more than enoughLast edited by riderz; 11.09.09, 13:09.
-
and then here are the nicknamechange.php
Code:<?php /* DENVER WHO VIEWED ME 2007 */ //>> » //<< « header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); echo("<?xml version=\"1.0\"?>"); echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml> <?php include("config.php"); include("core.php"); connectdb(); $action = $_GET["action"]; $sid = $_GET["sid"]; $page = $_GET["page"]; $who = $_GET["who"]; $fid = $_GET["fid"]; $pid = $_GET["pid"]; $id = $_GET["id"]; $uid = getuid_sid($sid); if($action != "") { if(islogged($sid)==false) { echo "<card id=\"main\" title=\"pinoyaztig.net\">"; echo "<p align=\"center\">"; echo "You are not logged in<br/>"; echo "Or<br/>Your session has been expired<br/><br/>"; echo "<a href=\"index.php\">Login</a>"; echo "</p>"; echo "</card>"; echo "</wml>"; exit(); } } if(isbanned($uid)) { echo "<card id=\"main\" title=\"pinoyaztig.net\">"; echo "<p align=\"center\">"; echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"x\"/><br/>"; echo "You are <b>Banned</b><br/>"; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time to finish your penalty: $rmsg<br/><br/>"; //echo "<a href=\"index.php\">Login</a>"; echo "</p>"; echo "</card>"; echo "</wml>"; exit(); } ////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=\"$stilte\">"; 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 ibwf_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>Verify"; echo "<go href=\"nicknamechange.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),"search nick",""); $nick = $_POST["nick"]; $uid = getuid_sid($sid); echo "<card id=\"main\" title=\"$stitle\">"; echo "<p align=\"center\"><small>"; $nickprezent = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'")); $dacaexista = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_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=\"nicknamechange.php?action=schimbanick&sid=$sid\">Back</a><br/>"; }else if($catelit == 4){ echo " You choose a nickname 4 characters, so will cost <b>10000</b> plusses!<br/>"; echo "nick is <b>$nick</b><br/>"; if(getplusses(getuid_sid($sid))<10000) { $cate = 10000 - getplusses(getuid_sid($sid)); echo "You need $cate plusses<br/>"; }else { echo "<anchor>enter"; echo "<go href=\"nicknamechange.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=\"nicknamechange.php?action=schimbanick&sid=$sid\">Back</a><br/>"; }else if($catelit == 5){ echo "Nick should not contain less than 5 characters <b>7000</b> plusses!"; echo "nick is <b>$nick</b><br/>"; if(getplusses(getuid_sid($sid))<7000) { $cate = 7000 - getplusses(getuid_sid($sid)); echo "You need $cate plusses<br/>"; }else { echo "<anchor>enter"; echo "<go href=\"nicknamechange.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=\"nicknamechange.php?action=schimbanick&sid=$sid\">Back</a><br/>"; }else if($catelit == 6){ echo "You chose a nick for 6 characters, so will cost <b>4000</b> plusuri!"; echo "The name chosen is <b>$nick</b><br/>"; if(getplusses(getuid_sid($sid))<4000) { $cate = 4000 - getplusses(getuid_sid($sid)); echo "You need $cate plusuri<br/>"; }else{ echo "<anchor>Apply"; echo "<go href=\"nicknamechange.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=\"nicknamechange.php?action=schimbanick&sid=$sid\">Back</a><br/>"; }else if($catelit > 6){ echo "Ai ales of a nick $catelit character, deci te va costa <b>2000</b> plusses!"; echo "The name chosen is <b>$nick</b><br/>"; if(getplusses(getuid_sid($sid))<2000) { $cate = 2000 - getplusses(getuid_sid($sid)); echo "You need $cate plusses<br/>"; }else{ echo "<anchor>Apply"; echo "<go href=\"nicknamechange.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=\"nicknamechange.php?action=schimbanick&sid=$sid\">Back</a><br/>"; } }}else{ echo "This nickname already use!!<br/>"; } echo "<a href=\"index.php?action=main&sid=$sid\">"; echo "Home</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=\"$stitle\">"; echo "<p align=\"center\"><small>"; $idmeu = getuid_sid($sid); $nickprezent = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'")); $dacaexista = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_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 ibwf_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 ibwf_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 "Error in dBase!<br/>"; } } }}else{ echo "This nickname already use!!<br/>"; } echo "<br/><a href=\"index.php?action=main&sid=$sid\">"; echo "Home</a>"; echo "</small></p></card>"; } ?> </wml>
Code:echo "<a href=\"nicknamechange.php?action=schimbanick&sid=$sid\">»Nick Name Chnage</a><br/>";
Last edited by riderz; 11.09.09, 13:08.
Comment
Comment