• 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
898
Solutions
21
Reaction score
428
Location
Santiago - Chile
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.

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,913
Solutions
248
Reaction score
1,833
Location
Norway
GitHub
Znote
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
OP
OP
ralke

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
898
Solutions
21
Reaction score
428
Location
Santiago - Chile
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:
Top