Register for your free account! | Forgot your password?

You last visited: Today at 11:41

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

Advertisement



Hennink Itemshop fix [Multi Items]

Discussion on Hennink Itemshop fix [Multi Items] within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 77
Join Date: Aug 2009
Posts: 107
Received Thanks: 90
Smile Hennink Itemshop fix [Multi Items]

I dont know if its been posted yet but here it is

Ive fixed it so you can make more then 1 item in itemshop
Like say pearls x200 or like water gems x200

Here it is
This is for is_buy.php
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, count, price, 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->price) {
      
          
$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->price." WHERE id='".$_SESSION['user_id']."' LIMIT 1";
            
$sqlQry=mysql_query($sqlCmd,$sqlServ);
            
$sqlLog="INSERT INTO ".SQL_HP_DB.".is_log (account_id,vnum,price,zeitpunkt) VALUES ('".$_SESSION['user_id']."','".$getItem->vnum."','".$getItem->price."','".$sqlZeit."')";
            
$qryLog=mysql_query($sqlLog,$sqlHp);
            
$sqlItem="INSERT INTO player.item 
            (owner_id,window,pos,vnum,count,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)
            VALUES 
            ('"
.$_SESSION['user_id']."','MALL','".$possiblePos[0]."', '".$getItem->vnum."', '".$getItem->count."','".$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."-1', '".$getItem->socket1."-1', '".$getItem->socket2."-1')";
            
$qryItem=mysql_query($sqlItem,$sqlServ) or die(mysql_error());
            echo
'<p class="meldung">This item has been successfully purchased. If the item does not appear in the camp, please immediately report to an admin.</p>';
            
          }
          else {
            echo
'<p>You have no place in your Itemshop bank. Your balance has not changed.</p>';
          }
          
        }
        else {
          echo
'<p class="meldung">You do not have enough Coins.</p>';
        }
      }
      else {
        echo
'<p class="meldung">This item does not exist in giving.</p>';
      }
    }
    else {
      echo
'<p class="meldung">It has not entered a valid ID.</p>';
    }
    echo
'<p><a href="javascript:history.back()">Back</a></p>';
  }
  else {
    echo
'<p class="meldung">You must be logged in for this area.</p>';
  }
?>

Itemshop.php
PHP Code:
<?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 categories_id='".$_GET['k']."' ORDER BY id DESC";
    }
    else {
      
$sqlCmdS="SELECT * FROM ".SQL_HP_DB.".is_items ORDER BY id DESC";
    }
  
?>

         
      <br> 
        Coins: <b><?PHP echo $_SESSION['user_coins']; ?> Coins</b></div>
             <h2>Categories</h2><br>
    <ul>
      <?PHP
        $sqlCmd 
"SELECT * FROM ".SQL_HP_DB.".is_categories ORDER BY titel ASC;";
        
$sqlQry mysql_query($sqlCmd,$sqlHp);
        while(
$getKats mysql_fetch_object($sqlQry)) {
          echo
'<li><a href="?p=itemshop&k='.$getKats->id.'">'.$getKats->titel.'</a></li>';
        }
      
?>
                

                
      <table>
    <center><?PHP
      $sqlQry
=mysql_query($sqlCmdS,$sqlHp);
      while(
$getItems=mysql_fetch_object($sqlQry)) {
        
$aktItem compareItems($getItems->vnum);
        
$itemStufe = (checkInt($aktItem['stufe'])) ? "+".$aktItem['stufe'] : '';
        
?>
        <tr>
          <th colspan="2" class="topLine">
                <div class="postui post-end"></div><br>
                <div class="postui post-title"> 
                    <h2><span><?PHP echo $aktItem['item'].$itemStufe?></th></span></h2></div>
<div class="postui post-con"> 
                <div class="con-wrap">
        </tr>
        <tr>
          <td class="isImg">
            <?PHP 
              
if(!empty($getItems->Image)) echo'<img src="./is_img/'.$getItems->Image.'" title="'.$aktItem['item'].'" alt="'.$aktItem['item'].'"/>';
            
?>
          </td>
          <td class="tdunkel"><?PHP echo $getItems->Discription?><br />
          Costs:<b> <?PHP echo $getItems->price?> Coins</b></td>
        </tr>
        <tr>
          <td colspan="2" class="isBuy"><a href="index.php?p=is_buy&id=<?PHP echo $getItems->id?> ">
          <input type="submit" value="Buy"  class="button1">
          </a>
           
          </td>
        </tr>
        <?PHP
      
}
    
?>
      </table>
  </div>
                  <div class="postui post-con"> 
                <div class="con-wrap">
 <?PHP
  
}
  else {
    echo
'<p class="meldung">You must be registered in this area.</p>';
  }
?>

P.S - I made a new table the itemshop goes to Itemshop.is_items
NOT player.is_items
Attached Files
File Type: rar is_items.rar (2.5 KB, 542 views)
[SA]Darkness is offline  
Thanks
1 User
Old 06/30/2011, 06:40   #2


 
Zander#'s Avatar
 
elite*gold: 14
Join Date: Feb 2011
Posts: 1,450
Received Thanks: 1,044
Hennink hats in der neusten Version schon gefixt

(hennink has fixed it in the newest Version i think)
Zander# is offline  
Thanks
1 User
Old 06/30/2011, 08:12   #3
 
.Rebel's Avatar
 
elite*gold: 60
Join Date: May 2010
Posts: 766
Received Thanks: 1,025
you have some errors on that itemshop.php script for ex:



<h2><span>Itemshop</span></h2> </div>

<p><center><div class="postui post-con">
<div class="con-wrap">
<?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";
}
?>
<br>
Coins: <b><?PHP echo $_SESSION['user_coins']; ?> Coins</b></div>


</center>
<table>
<center><?PHP
$sqlQry=mysql_query($sqlCmdS,$sqlHp);
while($getItems=mysql_fetch_object($sqlQry)) {
$aktItem = compareItems($getItems->vnum);
$itemStufe = (checkInt($aktItem['stufe'])) ? "+".$aktItem['stufe'] : '';
?>
<tr>
<th colspan="2" class="topLine"></div>
<div class="postui post-end"></div><div class="postui post-title">
<h2><span><?PHP echo $aktItem['item'].$itemStufe; ?></th></span></h2></div>
<div class="postui post-con">
<div class="con-wrap">
</tr>
<tr>
<td class="isImg">
<?PHP
if(!empty($getItems->Image)) echo'<img src="./is_img/'.$getItems->Image.'" title="'.$aktItem['item'].'" alt="'.$aktItem['item'].'"/>';
?>
</td>
<td class="tdunkel"><?PHP echo $getItems->Discription; ?><br />
Costs:<b> <?PHP echo $getItems->price; ?> Coins</b></td>
</tr>
<tr>
<td colspan="2" class="isBuy"><a href="index.php?p=is_buy&id=<?PHP echo $getItems->id; ?> ">
<input type="submit" value="Buy" class="fui btn log" class="button1">
</a>

</td>
</tr>
<?PHP
}
?>
</table>
</div>

in red is the errors
.Rebel is offline  
Reply


Similar Threads Similar Threads
Metin2 Script by hennink itemshop problem
05/20/2011 - Metin2 Private Server - 3 Replies
hi hab ein problem mit dem itemshop von hennink... also es wird ja gegliedert..Kategorien und itemliste bei beiden kommt seine fehlermeldung Kategorien:
Script by Hennink Itemshop???
05/03/2011 - Metin2 - 0 Replies
Hi. Ich habe erfolgreich das Script von Hennink instaliiert! Aber wie mache ich den Itemshop? Wo geht das Geld hhin? Thx für jede antwort!
MT2GS CMS by hennink / Itemshop VerbuggT?
01/26/2011 - Metin2 Private Server - 1 Replies
Huhu , Ich wollte auf meinem HP Skript von Hen jetzt mal den IS einstellen doch wenn ich auf Admin->Itemshop->Kategorien und dann den Name meiner Kategorie eingeben kommen da diese Fehler ; Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /data/multiserv/users/511497/projects/1256927/www/ pages/admin/is_kat.php on line 71 KatID Titel Funktionen Keine AHnung wie ich das Behebn kann :\ UNd noch ein Problem auf der ganzen Hp steht überall unter...
[Frage] Itemshop von Hennink
01/12/2011 - Metin2 Private Server - 18 Replies
ok noch ne frage, wir haben da ein item das wir selbst erstellt haben, wenn wir es aber in den IS machen wollen steht da, Stein gegen Krieger + 45342 Dabei handelt es sich weder um einen stein noch um irgend ein + gegenstand. Was muss man da umstellen?
[Frage] Itemshop von Hennink
01/11/2011 - Metin2 Private Server - 6 Replies
Hey Guys, Und zwar wollen wir den Itemshop zusammenstellen, finden aber nicht alles drin. Sprich kein 6.7 Boni usw. Wisst ihr vlt ob und wenn wo man das umstellen kann? mfg



All times are GMT +2. The time now is 11:41.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.