• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Images(Shop) Znoteaac

Kurre Kurrson

New Member
Joined
Aug 11, 2010
Messages
125
Reaction score
3
Hey guys.

Ive got a little annyoing problem.

When I am setting up my shop the images are broken.

Code:
$config['shop'] = array(
        'enabled' => true,
        'useDB' => false, // Fetch offers from database, or the below config array
        'showImage' => true,
        'imageServer' => 'items.znote.eu',
this is the code and the website should get the images from "items.znote.eu" but it dosent, I guess the website is down. So how could I solve this in a simpel way?

Thanks in advance!

Simon
 
Any Updates on this?
I'm also having same issues..
Does it matter where you create the shop_items folder? Its currently in UniServZ->docs->manual
Hope you can help. If you don't feel like explaining, I also have team viewer.
Here's the shop.php
Code:
if ($config['shop']['showImage']) echo '<td><img src="shop_items/'. $offers['itemid'] .'.'. $config['shop']['imageType'] .'" alt="img"></td>';
 
Sorry i had take a break, but now that i'm back i had a chance to move shop_items into the www folder and still nothing.
Files are saved correctly. 2160.gif but still nothing. ->shop_items/2157 does not exist.
I'm sure its something simple that I missed.
 
Code:
<?php require_once 'engine/init.php';
protect_page();
include 'layout/overall/header.php';

// Import from config:
$shop = $config['shop'];
$shop_list = $config['shop_offers'];

if (!empty($_POST['buy'])) {
    $time = time();
    $player_points = (int)$user_znote_data['points'];
    $cid = (int)$user_data['id'];
    // Sanitizing post, setting default buy value
    $buy = false;
    $post = (int)$_POST['buy'];
   
    foreach ($shop_list as $key => $value) {
        if ($key === $post) {
            $buy = $value;
        }
    }
    if ($buy === false) die("Error: Shop offer ID mismatch.");
   
    // Verify that user can afford this offer.
    if ($player_points >= $buy['points']) {
        $old_points = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$cid';"), 0, 'points');
        if ((int)$old_points != (int)$player_points) die("1: Failed to equalize your points.");
        // Remove points if they can afford
        // Give points to user
        $expense_points = $buy['points'];
        $new_points = $old_points - $expense_points;
        $update_account = mysql_query("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='$cid'");
       
        $verify = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$cid';"), 0, 'points');
        if ((int)$old_points == (int)$verify) die("2: Failed to equalize your points.". var_dump((int)$old_points, (int)$verify, $new_points, $expense_points));
       
        // Do the magic (insert into db, or change sex etc)
        // If type is 2 or 3
        if ($buy['type'] == 2) {
            // Add premium days to account
            user_account_add_premdays($cid, $buy['count']);
            echo '<font color="green" size="4">You now have '.$buy['count'].' additional days of premium membership.</font>';
        } else if ($buy['type'] == 3) {
            // Character sex
            mysql_query("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')") or die(mysql_error());
            echo '<font color="green" size="4">You now have access to change character gender on your characters. Visit <a href="myaccount.php">My Account</a> to select character and change the gender.</font>';
        } else {
            mysql_query("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')") or die(mysql_error());
            echo '<font color="green" size="4">Your order is ready to be delivered. Write this command in-game to get it: [!shop].<br>Make sure you are in depot and can carry it before executing the command!</font>';
        }
       
        // No matter which type, we will always log it.
        mysql_query("INSERT INTO `znote_shop_logs` (`account_id`, `player_id`, `type`, `itemid`, `count`, `points`, `time`) VALUES ('$cid', '0', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '". $buy['points'] ."', '$time')") or die(mysql_error());
       
    } else echo '<font color="red" size="4">You need more points, this offer cost '.$buy['points'].' points.</font>';
    //var_dump($buy);
    //echo '<font color="red" size="4">'. $_POST['buy'] .'</font>';
}

if ($shop['enabled']) {
?>

<h1>Donation Offers</h1>
<?php
if (!empty($_POST['buy'])) {
    if ($user_znote_data['points'] >= $buy['points']) {
        ?><td>You have <?php echo (int)($user_znote_data['points'] - $buy['points']); ?> points. (<a href="buypoints.php">Donation points</a>).</td><?php
    } else {
        ?><td>You have <?php echo $user_znote_data['points']; ?> points. (<a href="buypoints.php">Donation points</a>).</td><?php
    }
} else {
    ?><td>You have <?php echo $user_znote_data['points']; ?> points. (<a href="buypoints.php">Donation points</a>).</td><?php
}
?>
<table id="shopTable">
    <tr class="yellow">
        <td>Description:</td>
        <?php if ($config['shop']['showImage']) { ?><td>Image:</td><?php } ?>
        <td>Count/duration:</td>
        <td>Points:</td>
        <td>Action:</td>
    </tr>
        <?php
        foreach ($shop_list as $key => $offers) {
        echo '<tr class="special">';
        echo '<td>'. $offers['description'] .'</td>';
        if ($config['shop']['showImage']) echo '<td><img src="shop_items/'. $offers['itemid'] .'.'. $config['shop']['imageType'] .'" alt="img"></td>';
        if ($offers['type'] == 2) echo '<td>'. $offers['count'] .' Days</td>';
        else if ($offers['type'] == 3 && $offers['count'] == 0) echo '<td>Unlimited</td>';
        else echo '<td>'. $offers['count'] .'x</td>';
        echo '<td>'. $offers['points'] .'</td>';
        echo '<td>';
        ?>
        <form action="" method="POST">
            <input type="hidden" name="buy" value="<?php echo (int)$key; ?>">
            <input type="submit" value="  PURCHASE  ">
        </form>
        <?php
        echo '</td>';
        echo '</tr>';
        }
        ?>
</table>
<?php
} else echo '<h1>Donation Points system disabled.</h1><p>Sorry, this functionality is disabled.</p>';
include 'layout/overall/footer.php'; ?>
 
Change
Code:
'. $config['shop']['imageType'] .'
to
Code:
gif

Do you save the images as itemid.gif (would be saved as itemid.gif.gif which is incorrect) or just itemid?
 
Ahh.. Your onto something. Its probably saved as gif.gif. i'll try to correct that first.

Didn't work, got my hopes up, haha.
Code:
'. $config['shop']['gif'] .'
Like this? Didn't work either.
Probably implemented it wrong.
I'm burnt out, need to get some sleep.
I'll try back in the a.m though. I should have an idea by then..
 
Last edited by a moderator:
I said change the whole thing to gif and not just imageType :p

Alright, included the change
PHP:
<?php require_once 'engine/init.php';
protect_page();
include 'layout/overall/header.php';

// Import from config:
$shop = $config['shop'];
$shop_list = $config['shop_offers'];

if (!empty($_POST['buy'])) {
    $time = time();
    $player_points = (int)$user_znote_data['points'];
    $cid = (int)$user_data['id'];
    // Sanitizing post, setting default buy value
    $buy = false;
    $post = (int)$_POST['buy'];
 
    foreach ($shop_list as $key => $value) {
        if ($key === $post) {
            $buy = $value;
        }
    }
    if ($buy === false) die("Error: Shop offer ID mismatch.");
 
    // Verify that user can afford this offer.
    if ($player_points >= $buy['points']) {
        $old_points = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$cid';"), 0, 'points');
        if ((int)$old_points != (int)$player_points) die("1: Failed to equalize your points.");
        // Remove points if they can afford
        // Give points to user
        $expense_points = $buy['points'];
        $new_points = $old_points - $expense_points;
        $update_account = mysql_query("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='$cid'");
     
        $verify = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$cid';"), 0, 'points');
        if ((int)$old_points == (int)$verify) die("2: Failed to equalize your points.". var_dump((int)$old_points, (int)$verify, $new_points, $expense_points));
     
        // Do the magic (insert into db, or change sex etc)
        // If type is 2 or 3
        if ($buy['type'] == 2) {
            // Add premium days to account
            user_account_add_premdays($cid, $buy['count']);
            echo '<font color="green" size="4">You now have '.$buy['count'].' additional days of premium membership.</font>';
        } else if ($buy['type'] == 3) {
            // Character sex
            mysql_query("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')") or die(mysql_error());
            echo '<font color="green" size="4">You now have access to change character gender on your characters. Visit <a href="myaccount.php">My Account</a> to select character and change the gender.</font>';
        } else {
            mysql_query("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')") or die(mysql_error());
            echo '<font color="green" size="4">Your order is ready to be delivered. Write this command in-game to get it: [!shop].<br>Make sure you are in depot and can carry it before executing the command!</font>';
        }
     
        // No matter which type, we will always log it.
        mysql_query("INSERT INTO `znote_shop_logs` (`account_id`, `player_id`, `type`, `itemid`, `count`, `points`, `time`) VALUES ('$cid', '0', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '". $buy['points'] ."', '$time')") or die(mysql_error());
     
    } else echo '<font color="red" size="4">You need more points, this offer cost '.$buy['points'].' points.</font>';
    //var_dump($buy);
    //echo '<font color="red" size="4">'. $_POST['buy'] .'</font>';
}

if ($shop['enabled']) {
?>

<h1>Donation Offers</h1>
<?php
if (!empty($_POST['buy'])) {
    if ($user_znote_data['points'] >= $buy['points']) {
        ?><td>You have <?php echo (int)($user_znote_data['points'] - $buy['points']); ?> points. (<a href="buypoints.php">Donation points</a>).</td><?php
    } else {
        ?><td>You have <?php echo $user_znote_data['points']; ?> points. (<a href="buypoints.php">Donation points</a>).</td><?php
    }
} else {
    ?><td>You have <?php echo $user_znote_data['points']; ?> points. (<a href="buypoints.php">Donation points</a>).</td><?php
}
?>
<table id="shopTable">
    <tr class="yellow">
        <td>Description:</td>
        <?php if ($config['shop']['showImage']) { ?><td>Image:</td><?php } ?>
        <td>Count/duration:</td>
        <td>Points:</td>
        <td>Action:</td>
    </tr>
        <?php
        foreach ($shop_list as $key => $offers) {
        echo '<tr class="special">';
        echo '<td>'. $offers['description'] .'</td>';
        if ($config['shop']['showImage']) echo '<td><img src="shop_items/'. $offers['itemid'] .'.gif" alt="img"></td>';
        if ($offers['type'] == 2) echo '<td>'. $offers['count'] .' Days</td>';
        else if ($offers['type'] == 3 && $offers['count'] == 0) echo '<td>Unlimited</td>';
        else echo '<td>'. $offers['count'] .'x</td>';
        echo '<td>'. $offers['points'] .'</td>';
        echo '<td>';
        ?>
        <form action="" method="POST">
            <input type="hidden" name="buy" value="<?php echo (int)$key; ?>">
            <input type="submit" value="  PURCHASE  ">
        </form>
        <?php
        echo '</td>';
        echo '</tr>';
        }
        ?>
</table>
<?php
} else echo '<h1>Donation Points system disabled.</h1><p>Sorry, this functionality is disabled.</p>';
include 'layout/overall/footer.php'; ?>
 
Last edited:
Yes! Finally fixed. Your a Boss Ninja.
Code:
if ($config['shop']['showImage']) echo '<td><img src="shop_items/'. $offers['itemid'] .'.gif" alt="img"></td>';

Resolved.
 
Unfortunately it doesn't work for me lol !-.-?


I copied your whole Script + created folder

UniServer\www\layout\images\shop_items

items are inside with the item id ingame as gif2014-01-28_17h48_59.png
 
Back
Top