Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 18:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Itemshop Problem hen! CMS

Discussion on Itemshop Problem hen! CMS within the Metin2 Private Server forum part of the Metin2 category.

Closed Thread
 
Old   #1
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Itemshop Problem hen! CMS

Hallo,

ich habe ein Problem mit dem Itemshop beim o.g. CMS.
Egal welches Item gekauft wird, es kommt nicht im Lager/Itemshop Lager an.
Hier mal die is_buy.php und die itemshop.php
is_buy :
PHP Code:
<?PHP

  
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
  
    if(isset(
$_GET['id']) && checkInt($_GET['id'])) {
    
      
$sqlCmd="SELECT vnum, preis, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2 FROM ".SQL_HP_DB.".is_items WHERE id='".$_GET['id']."' LIMIT 1";
      
$sqlQry=mysql_query($sqlCmd,$sqlHp);
      if(
mysql_num_rows($sqlQry)==1) {
      
        
$getItem=mysql_fetch_object($sqlQry);
        if(
$_SESSION['user_coins']>=$getItem->preis) {
      
          
$getGroesse compareItems($getItem->vnum);
          
$belPos checkPos($_SESSION['user_id']);
          
$possiblePos findPos($belPos['islager'],$getGroesse['groesse']);
          if(!empty(
$possiblePos)) {
          
            
$sqlCmd="UPDATE account.account SET coins=coins-".$getItem->preis." WHERE id='".$_SESSION['user_id']."' LIMIT 1";
            
$sqlQry=mysql_query($sqlCmd,$sqlServ);
            
$sqlLog="INSERT INTO ".SQL_HP_DB.".is_log (account_id,vnum,preis,zeitpunkt) VALUES ('".$_SESSION['user_id']."','".$getItem->vnum."','".$getItem->preis."','".$sqlZeit."')";
            
$qryLog=mysql_query($sqlLog,$sqlHp);
            
$sqlItem="INSERT INTO player.item_award 
            (pid, vnum, count, given_time, why, socket0, socket1, socket2, mall) VALUES ('"
.$_SESSION['user_id']."','".$getItem->vnum."','1','".$sqlZeit."', 'Itemshopeinkauf', '".$getItem->socket0."', '".$getItem->socket1."', '".$getItem->socket2."','1');
            "
;
            
$qryItem=mysql_query($sqlItem,$sqlServ) or die(mysql_error());
            echo
'<p class="meldung">Das item wurde erfolgreich gekauft. Sollte das Item nicht im Lager erscheinen, bitte umgehend bei einem Admin melden.</p>';
            
          }
          else {
            echo
'<p>Sie haben nicht genügend Platz in ihrem Itemshop-Lager. Ihr Guthaben wurde nicht verändert.</p>';
          }
          
        }
        else {
          echo
'<p class="meldung">Sie haben nicht genug Coins.</p>';
        }
      }
      else {
        echo
'<p class="meldung">Das angegebe Item existiert nicht.</p>';
      }
    }
    else {
      echo
'<p class="meldung">Es wurde keine gültige ID eingegeben.</p>';
    }
    echo
'<p><a href="javascript:history.back()">zurück</a></p>';
  }
  else {
    echo
'<p class="meldung">Sie müssen für diesen Bereich angemeldet sein.</p>';
  }
?>
itemshop:
PHP Code:
      <div class="con-ui con-top"><h2>Itemshop</h2></div>
            <div class="con-ui con-post"><div class="con-wrapper">
<?PHP

  
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
    if(isset(
$_GET['k']) && checkInt($_GET['k'])) {
      
$sqlCmdS="SELECT * FROM ".SQL_HP_DB.".is_items WHERE kategorie_id='".$_GET['k']."' ORDER BY id DESC";
    }
    else {
      
$sqlCmdS="SELECT * FROM ".SQL_HP_DB.".is_items ORDER BY id DESC";
    }
  
?>

    <?PHP
      $sqlQry
=mysql_query($sqlCmdS,$sqlHp);
      while(
$getItems=mysql_fetch_object($sqlQry)) {
        
$aktItem compareItems($getItems->vnum);
        
$itemStufe = (checkInt($aktItem['stufe'])) ? "+".$aktItem['stufe'] : '';
        
?>
        <div class="con-hell">
        <table width="100%">
        <tr>
          <th colspan="2" class="topLine"><?PHP echo $aktItem['item'].$itemStufe?> (<b><?PHP echo $getItems->preis?> Coins</b>)</th>
        </tr>
        </table>
        <hr  style="width:100%"/>
        <table width="100%">
        <tr>
          <td class="isImg">
            <?PHP 
              
if(!empty($getItems->bild)) echo'<img src="./is_img/'.$getItems->bild.'" title="'.$aktItem['item'].'" alt="'.$aktItem['item'].'"/>';
            
?>
          </td>
          <td class="tdunkel"><?PHP echo $getItems->beschreibung?></td>
        </tr>
        <tr>
          <td colspan="2" class="isBuy"><hr  style="width:100%"/><a href="index.php?s=is_buy&id=<?PHP echo $getItems->id?>"><input type="submit"  value="Kaufen" class="green"/></a></td>
        </tr>
        </table>
        </div>
        <?PHP
      
}
    
?>

  <?PHP
  
}
  else {
    echo
'<p class="meldung">Sie müssen für diesen Bereich angemeldet sein.</p>';
  }
?>
            </div></div>
            <div class="con-ui con-bt"></div>
Sogma is offline  
Old 04/28/2015, 13:03   #2
 
Quattro™'s Avatar
 
elite*gold: 67
Join Date: Mar 2015
Posts: 194
Received Thanks: 24
teste mal diese is_buy.php. Musst du eventuell noch leicht die div's anpassen.

PHP Code:
<?PHP

    
function canBuy()
    {
        if(!isset(
$_SESSION['nextBuy']))
        {
            
$_SESSION['nextBuy']=time();
        }
        
        if(
$_SESSION['nextBuy']<=time())
        {
            
$_SESSION['nextBuy']=time()+5;
            return 
true;
        }
        else
            return 
false;
    }

  if(isset(
$_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
  
    echo
'<h2>Itemshop - Einkauf</h2>';
    if(isset(
$_GET['id']) && checkInt($_GET['id'])) {
    
      
$sqlCmd="SELECT vnum, preis, count, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2 FROM ".SQL_HP_DB.".is_items WHERE id='".$_GET['id']."' AND anzeigen='J' LIMIT 1";
      
$sqlQry=mysql_query($sqlCmd,$sqlHp);
      if(
mysql_num_rows($sqlQry)==1) {
      
        
$getItem=mysql_fetch_object($sqlQry);
        
        
$sqlCoins "SELECT coins FROM account.account WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."' LIMIT 1";
        
$qryCoins mysql_query($sqlCoins,$sqlServ);
        
$getCoins mysql_fetch_object($qryCoins);
        
        if(
canBuy())
        {
            if((
$getCoins->coins)>=$getItem->preis) {
          
              
$getGroesse compareItems($getItem->vnum);
              
$belPos checkPos($_SESSION['user_id']);
              
$possiblePos findPos($belPos['islager'],$getGroesse['groesse']);
              if(!empty(
$possiblePos)) {
                
                
$nCoins $getCoins->coins-$getItem->preis;
                
                
$sqlCmd="UPDATE account.account SET coins='".mysql_real_escape_string($nCoins)."' WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."' LIMIT 1";
                
$sqlQry=mysql_query($sqlCmd,$sqlServ);
                
                
$sqlLog="INSERT INTO ".SQL_HP_DB.".is_log (account_id,vnum,preis,zeitpunkt) VALUES ('".mysql_real_escape_string($_SESSION['user_id'])."','".$getItem->vnum."','".$getItem->preis."','".$sqlZeit."')";
                
$qryLog=mysql_query($sqlLog,$sqlHp);
                
                
$sqlItem="INSERT INTO player.item 
                (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)
                VALUES 
                ('"
.mysql_real_escape_string($_SESSION['user_id'])."','MALL','".$possiblePos[0]."','".$getItem->count."','".$getItem->vnum."','".$getItem->attrtype0."', '".$getItem->attrvalue0."', '".$getItem->attrtype1."', '".$getItem->attrvalue1."', '".$getItem->attrtype2."', '".$getItem->attrvalue2."', '".$getItem->attrtype3."', '".$getItem->attrvalue3."', '".$getItem->attrtype4."', '".$getItem->attrvalue4."', '".$getItem->attrtype5."', '".$getItem->attrvalue5."', '".$getItem->attrtype6."', '".$getItem->attrvalue6."', '".$getItem->socket0."', '".$getItem->socket1."', '".$getItem->socket2."')";
                
$qryItem=mysql_query($sqlItem,$sqlServ) or die(mysql_error());
                
                echo
'<p class="meldung"><font color="green">Das item wurde erfolgreich gekauft.</font></p>';
                
              }
              else {
                echo
'<p>Sie haben nicht genügend Platz in ihrem Itemshop-Lager. Ihr Guthaben wurde nicht verändert.</p>';
              }
              
            }
            else {
              echo
'<p class="meldung"><font color="red">Sie haben nicht genug Coins.</font></p>';
            }
        }
        else
        {
            echo
'<p class="meldung"><font color="red">Es kann nur alle 5 Sekunden ein Item gekauft werden.</font></p>';
        }
      }
      else {
        echo
'<p class="meldung">Das angegebe Item existiert nicht.</p>';
      }
    }
    else {
      echo
'<p class="meldung">Es wurde keine gültige ID eingegeben.</p>';
    }
    echo
'<p><a href="javascript:history.back()">Zurück zum Itemshop</a></p>';
  }
  else {
    echo
'<p class="meldung">Sie müssen für diesen Bereich angemeldet sein.</p>';
  }
?>
</div>
<div id="con-bot"></div>
Quattro™ is offline  
Thanks
1 User
Old 04/28/2015, 18:37   #3
 
Azμre's Avatar
 
elite*gold: 25
Join Date: Apr 2015
Posts: 23
Received Thanks: 21
Wird beim Start die item_award korrekt geladen?
Sende uns am besten mal die syserr deines Database Cores.
Außerdem kannst du error_reporting in PHP aktivieren und schauen ob du beim Kaufen eines Items einen Fehler ausgegeben bekommst.
Azμre is offline  
Old 04/28/2015, 18:39   #4
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Danke, hat geklappt
Sogma is offline  
Closed Thread


Similar Threads Similar Threads
Problem mit Itemshop.
07/12/2014 - Metin2 Private Server - 0 Replies
Habe den von Kroya.. Die shop.php sieht so aus: Sobald man aber im Link die ID verändert, kann man kaufen was man möchte. Also die Item-ID, werden auch keine Coins abgezogen..
Problem mit Itemshop
07/29/2013 - Metin2 Private Server - 0 Replies
Hallo ich habe seit kurzem einen Server . Ich habe Probeweise 2 Items eingefügt einen Schwert+9 und wen ich es kaufe steht da nur "Das angegebe Item existiert nicht." Könnte mir jemand helfen? Skype addy ist: Pawlik518
Itemshop problem.
05/29/2013 - Metin2 Private Server - 3 Replies
Hi liebe Comunity, Ich habe ein problem und zwar möchte ich auf meiner homepage den itemshop beaarbeiten jedoch möchte ich neue Waffen verkaufen. Und die sind bei hen! 's script nicht zur auswahl Item / Vnum Hier kann man nur ein item aus einer Liste wählen. Möchte aber eine Vnum eingeben Kategorie Beschreibung: Bild:
Itemshop Problem
05/17/2012 - Metin2 Private Server - 2 Replies
Hey COM, habe Folgendes Problem: Wenn ich im Itemshop eine Waffe (z.B. Gifti) kaufe, hat es ingame kein DSS & FKS. Wie kann ich einstellen, dass die Items beim Kauf im Itemshop Standardbonis haben? :) Wäre top wenn jemand helfen könnte :handsdown:
Itemshop problem
10/10/2011 - Metin2 Private Server - 0 Replies
Hy everyone,I have an itemshop script,and it worked untill now, but I reinstalled the server because of some problemsand now it doesn't works anymore.Here are itemshop.php and is_buy.php .The problem is that I can buy multiple items,but only one appears in the itemshop inside the storekeeper,and sometimes,none.The space is occupied in the "MALL" but nothing appears in game.Can you tell me what is the problem please? I use profizocker94' SF .Thank you anticipated :handsdown: IS_BUY.PHP...



All times are GMT +1. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.