Shop and Plusses

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Shop and Plusses

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

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

    Comment


      #3
      take a look of Gift Shop at http://wap2chat.net than tell if you want exactly .notsure.

      Comment


        #4
        PHP Code:
        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&amp;sid=$sid\">Back to Shop</a><br/>";
          echo 
        "<a href=\"index.php?action=main&amp;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
        Last edited by tkreturns; 11.06.09, 03:50.

        Comment


          #5
          PHP Code:
          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&amp;sid=$sid\">Back to Shop</a><br/>"
            echo 
          "<a href=\"index.php?action=main&amp;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

          Comment


            #6
            Originally posted by tkreturns View Post
            PHP Code:
            echo "Out Of Stock, We Restock every Month"
            LoL, Where u purchase your inventory every month? Mine always full , just purchased one time LoL

            Comment


              #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 ..

              Comment

              Working...
              X