Register for your free account! | Forgot your password?

You last visited: Today at 12:11

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

Advertisement



Neues CMS Ishop fix?

Discussion on Neues CMS Ishop fix? within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
Lorrix's Avatar
 
elite*gold: 0
Join Date: Dec 2015
Posts: 186
Received Thanks: 35
Neues CMS Ishop fix?

Ich benutze das CMS:

Das problem ist wenn man ein item kauft kommt es immer auf slot 3 des IS-Lagers und sagt direkt das Lagerhaus ist voll wie fix ich das?

hilfe waere nice.

<?php $is = new Itemshop(); if(isset($_GET["cat"]) AND $is->categoryExists($_GET["cat"]) == false) { Core::redirect(Links::getUrl("itemshop"), 0); die(); } $cat = isset($_GET["cat"]) ? $_GET["cat"] : $is->getFirstCategory(); ?> <?php if(isset($_GET["buy"]) AND $is->itemExists($_GET["buy"]) AND User::isLogged()) { //echo '<div class="box">'; $itemInfo = $is->getItemInfo($_GET["buy"]); if($is->discountEnabled()) { $discount_price = ($itemInfo["price"] / 100) * (100 - $is->getDiscountPercent()); $price = round($discount_price); } else { $price = $itemInfo["price"]; } if($is->isPremium($itemInfo["id"])) { $type = $itemInfo["socket1"]; // 1 = silver_expire ; 2 = gold_expire ; 3 = money_drop_rate_expire $days = $itemInfo["socket0"]; // how long premium ? (in days) if (User::getCoins($_SESSION["username"]) < $price) { echo Core::result(Language::getTranslation("isNotEnough Coins"), 2); } elseif($type == 1 AND User::getSilverPremium($_SESSION["username"], true) > date('Y-m-d H:i:s')) { echo Core::result(Language::getTranslation("isSilverAct ive").Core::makeNiceDate(User::getSilverPremium($_ SESSION["username"], true)), 2); } elseif($type == 2 AND User::getGoldPremium($_SESSION["username"], true) > date('Y-m-d H:i:s')) { echo Core::result(Language::getTranslation("isGoldActiv e").Core::makeNiceDate(User::getGoldPremium($_SESS ION["username"], true)), 2); } elseif($type == 3 AND User::getYangPremium($_SESSION["username"], true) > date('Y-m-d H:i:s')) { echo Core::result(Language::getTranslation("isYangActiv e").Core::makeNiceDate(User::getYangPremium($_SESS ION["username"], true)), 2); } elseif($type == 123 AND ( User::getYangPremium($_SESSION["username"], true) > date('Y-m-d H:i:s') OR User::getSilverPremium($_SESSION["username"], true) > date('Y-m-d H:i:s') OR User::getGoldPremium($_SESSION["username"], true) > date('Y-m-d H:i:s') )) { echo Core::result(Language::getTranslation("isActive"), 2); } else { if($type == 1) { $is->log($_SESSION["username"], $itemInfo["name"], $type, $days, $price); User::updateSilverPremium($_SESSION["username"], $days); User::removeCoins($_SESSION["username"], $price); echo Core::result(Language::getTranslation("isSilverSuc cess"), 1); } elseif($type == 2) { $is->log($_SESSION["username"], $itemInfo["name"], $type, $days, $price); User::updateGoldPremium($_SESSION["username"], $days); User::removeCoins($_SESSION["username"], $price); echo Core::result(Language::getTranslation("isGoldSucce ss"), 1); } elseif($type == 3) { $is->log($_SESSION["username"], $itemInfo["name"], $type, $days, $price); User::updateYangPremium($_SESSION["username"], $days); User::removeCoins($_SESSION["username"], $price); echo Core::result(Language::getTranslation("isYangSucce ss"), 1); } elseif($type == 123) { $is->log($_SESSION["username"], $itemInfo["name"], $type, $days, $price); User::updateSilverPremium($_SESSION["username"], $days); User::updateGoldPremium($_SESSION["username"], $days); User::updateYangPremium($_SESSION["username"], $days); User::removeCoins($_SESSION["username"], $price); echo Core::result(Language::getTranslation("isPremiumSu ccess"), 1); } } } else { if (User::getCoins($_SESSION["username"]) < $price) { echo Core::result(Language::getTranslation("isNotEnough Coins"), 2); } elseif (User::hasEmptyItemShopMall($_SESSION["username"]) == false) { echo Core::result(Language::getTranslation("isNotEmptyI temshopMall"), 2); } else { if ($itemInfo["can_change_amount"] == 1 AND $itemInfo["max_amount"] > 0) { if (isset($_POST["buy"])) { $quantity = $_POST["quantity"]; if (!ctype_digit($quantity)) { $result = Core::result(Language::getTranslation("isNotValidQ uantity"), 2); } elseif (!$is->validQuantity($_GET["buy"], $quantity)) { $result = Core::result(Language::getTranslation("isNotValidR ange") . $itemInfo["max_amount"], 2); } elseif (User::getCoins($_SESSION["username"]) < $price * $quantity) { $result = Core::result(Language::getTranslation("isNotEnough Coins"), 2); } else { if ($itemInfo['addon_type'] == 0) { $attrtype0 = 0; $attrtype1 = 0; $attrvalue0 = 0; $attrvalue1 = 0; } else { $attrtype0 = 72; $attrtype1 = 71; $skoda = mt_rand(8, 30); $poskozeni = mt_rand(-18, -1); $attrvalue0 = $skoda; $attrvalue1 = $poskozeni; } if ($itemInfo["time_limit"] > 0) { $socket0 = strtotime("+ " . $itemInfo['time_limit'] . " seconds"); } else { $socket0 = $itemInfo["socket0"]; } $socket1 = $itemInfo["socket1"]; $socket2 = $itemInfo["socket2"]; User::removeCoins($_SESSION["username"], $price * $quantity); $is->generateItem($_SESSION["username"], $quantity, $itemInfo["item_id"], $attrtype0, $attrvalue0, $attrtype1, $attrvalue1, $socket0, $socket1, $socket2); if (Core::itemshopLogEnabled()) { $is->log($_SESSION["username"], $itemInfo["name"], $itemInfo["item_id"], $quantity, $price * $quantity); } $result = Core::result(Language::getTranslation("isBuySucces s"), 1); Core::redirect(Links::getUrl("itemshop"), 2); } } if (isset($result)) { echo $result; } ?> <div class="box"> <h2><?= Language::getTranslation("isVerifyAmount") ?></h2> <form method="post" action="<?= Links::getUrl("itemshop") . "/cat/".$cat."/buy/" . $_GET['buy'] ?>"> <div class="form-group"> <input type="number" name="quantity" class="form-control" id="quantity" required> </div> <button type="submit" name="buy" class="btn btn-primary login-btn"><?= Language::getTranslation("isSubmit"); ?></button> </form> </div> <?php } else { if ($itemInfo['addon_type'] == 0) { $attrtype0 = 0; $attrtype1 = 0; $attrvalue0 = 0; $attrvalue1 = 0; } else { $attrtype0 = 72; $attrtype1 = 71; $skoda = mt_rand(8, 30); $poskozeni = mt_rand(-18, -1); $attrvalue0 = $skoda; $attrvalue1 = $poskozeni; } if ($itemInfo["time_limit"] > 0) { $socket0 = strtotime("+ " . $itemInfo['time_limit'] . " seconds"); } else { $socket0 = $itemInfo["socket0"]; } $socket1 = $itemInfo["socket1"]; $socket2 = $itemInfo["socket2"]; User::removeCoins($_SESSION["username"], $price); $is->generateItem($_SESSION["username"], $itemInfo["count"], $itemInfo["item_id"], $attrtype0, $attrvalue0, $attrtype1, $attrvalue1, $socket0, $socket1, $socket2); if (Core::itemshopLogEnabled()) { $is->log($_SESSION["username"], $itemInfo["name"], $itemInfo["item_id"], $itemInfo["count"], $price); } echo Core::result(Language::getTranslation("isBuySucces s"), 1); Core::redirect(Links::getUrl("itemshop"), 2); } } } } ?> <div class="box tournament-detail"> <div class="row"> <div class="col-xs-9"> <h2><?= Language::getTranslation("isTitle");?></h2> <div style="margin-top:50px;"> <?php if($is->numberOfCategories() > 0) { foreach ($is->categories() as $row) { if(isset($cat) AND $cat == $row["id"]) { echo ' <a href="' . Links::getUrl("itemshop") . '/cat/' . $row["id"] . '" class="btn btn-primary btn-lg" style="margin-bottom:5px;">' . $row["name"] . '</a>'; } else { echo ' <a href="' . Links::getUrl("itemshop") . '/cat/' . $row["id"] . '" class="btn btn-inverse btn-lg" style="margin-bottom:5px;">' . $row["name"] . '</a>'; } } } else { echo Core::result(Language::getTranslation("isZeroCateg ories"),4); } ?> <br /><br /> <?php if(User::isLogged()) { echo '<li class="list-group-item">' . Language::getTranslation("isYourCoins") . ' <span class="text-primary">' . User::getCoins($_SESSION["username"]) . '</span> ' . Language::getTranslation("isBuyCoins") . '</li>'; } ?> </div> </div> <div class="col-xs-3"> <img src="assets/images/shop.png" class="img-responsive center-block" alt=""> </div> </div> <?php if($is->discountEnabled()) { ?> <p class="countdown-info"><i class="fa fa-bell-o"></i> Discount <span class="label label-danger"><?= $is->getDiscountPercent() ?> %</span> on all items: <i class="fa fa-bell-o"></i> </p> <div id="discountdate" class="hidden"><?= $is->getDiscountUntil() ?></div> <div class="countdown"></div> <?php } ?> </div> <div class="box"> <?php if($is->numberOfItems($cat) > 0) { // Paginator $page = isset($_GET["pagination"]) ? (int)$_GET["pagination"] : 1; $totalCount = $is->numberOfItems($cat); $perPage = $is->itemsPerPage(); $paginator = new Paginator($page, $totalCount, $perPage); // Paginator // Validate page if (isset($_GET["pagination"]) AND (!ctype_digit($_GET["pagination"]) OR $_GET["pagination"] > ceil($totalCount / $perPage) OR $_GET["pagination"] < 1)) { Core::redirect(Links::getUrl("itemshop"), 0); die(); } // Validate page // Print all news and pagination links global $dbname; $is->printItems("SELECT * FROM " . $dbname . ".itemshop_items WHERE category_id = ? LIMIT ? OFFSET ?", array($cat, $perPage, $paginator->offset())); $paginator->printLinks("itemshop/cat/".$cat."/page/", "pagination"); // Print all news and pagination links } else { echo Core::result(Language::getTranslation("isZeroItems "), 4); } ?> </div>




public function generateItem($username, $count, $vnum, $attrtype0, $attrvalue0, $attrtype1, $attrvalue1, $socket0, $socket1, $socket2)
{
$dbplayer = Core::getPlayerDatabase();
//22
$query = Database::queryAlone("INSERT INTO ".$dbplayer.".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
(?, 'MALL', 2, ?, ?, ?, ?, ?, ?, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ?, ?, ?)",
array(User::getAccountID($username), $count, $vnum, $attrtype0, $attrvalue0, $attrtype1, $attrvalue1, $socket0, $socket1, $socket2));
Lorrix is offline  
Old 11/14/2016, 20:10   #2
 
iPeri /..'s Avatar
 
elite*gold: 2
Join Date: Jun 2015
Posts: 352
Received Thanks: 422
Direkt alles auf einen Blick!
Wer braucht schon eine anständige Formatierung, ich meine wir setzen bei PHP ja eher auf Funktionalität...
iPeri /.. is offline  
Thanks
2 Users
Old 11/14/2016, 20:59   #3
 
Lorrix's Avatar
 
elite*gold: 0
Join Date: Dec 2015
Posts: 186
Received Thanks: 35
Hier sind die 2 files:
Attached Files
File Type: rar Desktop.rar (5.3 KB, 4 views)
Lorrix is offline  
Reply


Similar Threads Similar Threads
Problem bei ishop
09/18/2016 - Metin2 Private Server - 3 Replies
hab das ganze soweit Installiert, nur hab ich folgendes Problem, es werden bis auf Neue Items und Account Bonus keine Kategorien Angezeigt, und wenn ich auf Neue Item Klicke passiert das hier: Not Found The requested URL /ishop/categorie/new/ was not found on this server. wo ist das Problem? Und wie rufe ich die Admin.php auf?
[iShop]
04/04/2015 - Metin2 Private Server - 5 Replies
Hallo liebe epvpler ich habe da so nen kleines problem würde gerne den is einbauen http://www.elitepvpers.com/forum/metin2-pserver-gu ides-strategies/3257842-release-ishop-like-officia l-free-version.html und da ist mein problem das es nciht geht und ich irgedwasn installieren soll schaut selber auf http://volume3.org/test2/ Danke und MfG, Wayne
IShop Problem
06/27/2014 - Metin2 Private Server - 0 Replies
Hey leute, wir haben einen IShop eingefügt jedoch funktioniert dieser nicht so wirklich weil immer Die Sitzung abgelaufen ist. Kann mir jemand dabei weiterhelfen ?
Metin2 Ishop fehler
04/23/2014 - Metin2 Private Server - 4 Replies
Hallo , Wollte gerade den ishop insalieren aber kommt immer der fehler. http://forum.metin2sekai.com/index.php?attachment s/unbenannt-png.682/ Weiß je,amd wie ich den weg bekomme sprich den is zum laufen bringe ?
IShop in Game 100%
12/16/2012 - Metin2 Trading - 29 Replies
Hi, I want to introduce my Item Shop The same as the original, in order to understand what it is please watch the video, because my English is very bad The item shop has a system of DR and DB Dynamic categories Item dynamic Promotions and paypal purchases dynamic



All times are GMT +1. The time now is 12:11.


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.