Shop and Plusses

Started on the old forum in May 2009 · view the original in the archive · old links redirect here

6 replies · 740 views · started 17 years ago · 1 min read

3 participants
winnerke Newbie · 5 posts #1

how I know it: locking ur shop if user have nt enough plusses? can u help me pls?

riderz Lead · 975 posts #2

who have a pimped shop for methos where ppl can see the images instead of text


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

tkreturns Developer · 98 posts #4
  
if($action=="buy")
{
  addonline(getuid_sid($sid),"Your Site Name Shop","");
$pstyle = gettheme($sid);
      echo xhtmlhead("Your Site Name shop",$pstyle);
  echo "<p align=\"center\">";
  
  $nick = getnick_sid($sid);
  $who = getuid_nick($nick);
  $credits = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
  $items = mysql_fetch_array(mysql_query("SELECT itemname, itmeprice, itemshopid, avail FROM ibwf_shop WHERE itemid='".$itemid."'"));
  

  echo "<b><u>$items[0]</u></b><br/>";

  echo "</p>";
  echo "<p>";  
  
  if($items[3]>0){
  
  if($items[1]>$credits[0]){
  echo "You don't have enough credits to buy this itme.<br/>";
  }else{
  
  $reg = mysql_query("INSERT INTO ibwf_shop_Inventory SET uid='".$who."', itemid='".$itemid."', time='".time()."'");  
  
  $ugpl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
  $ugpl = $ugpl[0] - $items[1];
  mysql_query("UPDATE ibwf_users SET plusses='".$ugpl."' WHERE id='".$who."'");
  
  $totitems = mysql_fetch_array(mysql_query("SELECT avail FROM ibwf_shop WHERE itemid='".$itemid."'"));
  $totitems = $totitems[0] - 1;
  mysql_query("UPDATE ibwf_shop SET avail='".$totitems."' WHERE itemid='".$itemid."'");
  
  echo "Congrats, you have just bought the $items[0]<br/>";

  }
  }else{
  echo "Out Of Stock, We Restock every Month";
  }
  
  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();
}

REPLACE THIS WITH YOUR PRESENT CODE IN MSHOP-FUNC in xhtml

ASK FOR HELP

tkreturns Developer · 98 posts #5
if($action=="buy") 
{ 
  addonline(getuid_sid($sid),"Your Site Name Shop",""); 
        echo "<card id=\"main\" title=\"Your Site Name Shop\">";
  echo "<p align=\"center\">"; 
   
  $nick = getnick_sid($sid); 
  $who = getuid_nick($nick); 
  $credits = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'")); 
  $items = mysql_fetch_array(mysql_query("SELECT itemname, itmeprice, itemshopid, avail FROM ibwf_shop WHERE itemid='".$itemid."'")); 
   

  echo "<b><u>$items[0]</u></b><br/>"; 

  echo "</p>"; 
  echo "<p>";   
   
  if($items[3]>0){ 
   
  if($items[1]>$credits[0]){ 
  echo "You don't have enough credits to buy this itme.<br/>"; 
  }else{ 
   
  $reg = mysql_query("INSERT INTO ibwf_shop_Inventory SET uid='".$who."', itemid='".$itemid."', time='".time()."'");   
   
  $ugpl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'")); 
  $ugpl = $ugpl[0] - $items[1]; 
  mysql_query("UPDATE ibwf_users SET plusses='".$ugpl."' WHERE id='".$who."'"); 
   
  $totitems = mysql_fetch_array(mysql_query("SELECT avail FROM ibwf_shop WHERE itemid='".$itemid."'")); 
  $totitems = $totitems[0] - 1; 
  mysql_query("UPDATE ibwf_shop SET avail='".$totitems."' WHERE itemid='".$itemid."'"); 
   
  echo "Congrats, you have just bought the $items[0]<br/>"; 

  } 
  }else{ 
  echo "Out Of Stock, We Restock every Month"; 
  } 
   
  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><card>"; 

} 

REPLACE THIS WITH YOUR PRESENT CODE IN MSHOP-FUNC in WML

ASK FOR HELP

Guest #6

tkreturns wrote:

echo "Out Of Stock, We Restock every Month"; 

LoL, Where u purchase your inventory every month? Mine always full , just purchased one time LoL

tkreturns Developer · 98 posts #7

tariq this code is not coded by me so it does'nt has any relation wid me in this world ....lol i just copy pasted ..

ASK FOR HELP

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close