• 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!

[Znote AAC] Linking item shop images from folder

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,492
Solutions
27
Reaction score
858
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi! I wonder if someone can help me with this. Znote has a shop page that redirects the image from image server.

I would like to set my own image server, based on the id from the config.php array
Example
PHP:
        3 => array(
            'type' => 2,
            'itemid' => 12735, // Item to display on page
            'count' => 7, // Days of premium account
            'description' => "Premium membership",
            'points' => 25,
        ),

I want that the image of that item gets loaded by folder layout/item/12735.gif, where the ID match with the filename.
example_shop.png

If this is the line from shop.php that make that occur
PHP:
<?php if ($config['shop']['showImage']):?>
                    <td><img src="http://<?php echo $config['shop']['imageServer']; ?>/<?php echo $offers['itemid']; ?>.<?php echo $config['shop']['imageType']; ?>" alt="img"></td>
                <?php endif; ?>

What should I write in replacement of that to achieve what I want?

Option 2

Create a new <td> category to show the corresponding image. Like a <img src="/layout/12735.gif> but that responds to a "if ($config['shop´] [imgid] then src = image id. Please let me know if I didn't explain this well.
Thanks in advance, regards!
 

Attachments

Last edited:
Solution
By default images are loaded from the default image host:

Here you can change the <img src attribute from:
PHP:
http://<?php echo $config['shop']['imageServer']; ?>/<?php echo $offers['itemid']; ?>.<?php echo $config['shop']['imageType']; ?>

to:
PHP:
//layouts/items/<?php echo $offers['itemid']; ?>.png

That will make all offers in premium duration table target your items folder instead of the default host.
By default images are loaded from the default image host:

Here you can change the <img src attribute from:
PHP:
http://<?php echo $config['shop']['imageServer']; ?>/<?php echo $offers['itemid']; ?>.<?php echo $config['shop']['imageType']; ?>

to:
PHP:
//layouts/items/<?php echo $offers['itemid']; ?>.png

That will make all offers in premium duration table target your items folder instead of the default host.
 
Solution
By default images are loaded from the default image host:

Here you can change the <img src attribute from:
PHP:
http://<?php echo $config['shop']['imageServer']; ?>/<?php echo $offers['itemid']; ?>.<?php echo $config['shop']['imageType']; ?>

to:
PHP:
//layouts/items/<?php echo $offers['itemid']; ?>.png

That will make all offers in premium duration table target your items folder instead of the default host.

Thanks a lot! Worked with some little changes
Code:
<img src="http://localhost/layout/items/<?php echo $offers['itemid']; ?>.png" alt="img">

shop.png
 
Last edited:
Back
Top