Author Topic: Image Constraints  (Read 5909 times)

Offline Greyias

Image Constraints
« on: July 04, 2006, 02:11:39 am »
Hey Dan, I'm wondering... is there a way I can set the shop's item images to not have a minimum or maximum? (or at least set it to where it won't resize everything?)

I have some images that are 25x25px and one that's 36x100, and so on, and so on. At the moment, everything gets squished or stretched to where it doesn't look right. I could set it at 100x100, and then resize every image individually, but that'd be a pain. Was hoping there would be a simpler solution I havne't thought of (I tried typing 0 and 0 into the image part of the shop settings, but that basicaly shrunk everything down to nothing).

Offline Daniel15

Re: Image Constraints
« Reply #1 on: July 08, 2006, 03:06:38 pm »
OK, what you could try doing is manually editing the Shop.php file. Open Sources/shop/shop.php, and find:
Code: [Select]
<img border='0' width='{$modSettings['shopImageWidth']}' height='{$modSettings['shopImageHeight']}' src='{$boardurl}/Sources/shop/item_images/{$itemRows[$x]['image']}'>
Replace with:
Code: [Select]
<img border='0' src='{$boardurl}/Sources/shop/item_images/{$itemRows[$x]['image']}'>(basically, remove the 'width' and  height')

Offline jacortina

Re: Image Constraints
« Reply #2 on: July 13, 2006, 07:22:01 am »
I also note these lines in ShopAdmin.php (in 1.1RC2 version, at least):

Code: [Select]
$newSettings['shopImageWidth'] = (int) $_POST['image_width'];
$newSettings['shopImageHeight'] = (int) $_POST['image_width'];

I don't think that's right.  ;)

EDIT====

And, ShopAdmin.Template.php has these lines:

Code: [Select]
                                <br />{$txt['shop_image_width']}: <input type="text" name="image_width" value="{$modSettings['shopImageWidth']}" size="3"><br />
                                {$txt['shop_image_height']}: <input type="text" name="image_width" value="{$modSettings['shopImageHeight']}" size="3"><br /><br />

This needs some fixin'
« Last Edit: July 13, 2006, 07:31:38 am by jacortina »

Offline Daniel15

Re: Image Constraints
« Reply #3 on: July 14, 2006, 10:53:47 pm »
OK, thanks for that, I added it as a bug, and fixed it. Unfortunately, the Sourceforge SVN service appears to be down, but once it's up again, I'll add this change to the latest development code.

EDIT: OK, ShopAdmin.php and ShopAdmin.template.php fixed ;)
« Last Edit: July 14, 2006, 10:59:24 pm by daniel15 »

Offline animecosmo

Re: Image Constraints
« Reply #4 on: July 31, 2006, 02:25:31 pm »
Is this still applicable for the newest version? I've looked through Shop.php five times now, and I cannot find the line you suggested changing. In fact, I don't see anything involving images at all.

I see $modSettings for "shopBankEnabled", "shopTradeEnabled", "shopPointsPerTopic", and "shopPointsPerPost".

Offline Greyias

Re: Image Constraints
« Reply #5 on: August 02, 2006, 12:29:06 am »
I was wondering too :) I wanted to be sure I could upgrade successfully before I started messing around with the image thing, but it still seems to be doing the constraint thing

Offline Daniel15

Re: Image Constraints
« Reply #6 on: August 04, 2006, 10:27:17 pm »
Quote
s this still applicable for the newest version?
Quote
I've looked through Shop.php five times now, and I cannot find the line you suggested changing.
Yes, it's still applicable. The lines have moved to Shop-Buy.php and Shop-Inventory.php ;)

Offline Greyias

Re: Image Constraints
« Reply #7 on: October 17, 2006, 12:54:59 am »
Oh rats, bumping this again. Followed your directions, Dan, and it worked like a charm. Now everything looks nice and in proportion... except now it's showing part of the address after the images:

http://www.lupous.net/candy/index.php?action=shop;do=buy

If I could figure out what was causing it, I'd go ahead and fix it myself... but I'm so code stupid sometimes, it's sad. (No rush on this, just something strange that cropped up)

Offline Daniel15

Re: Image Constraints
« Reply #8 on: October 20, 2006, 09:52:18 pm »
Hmmm... The output appears to be like:
Code: [Select]
<img border='0' src='http://www.lupous.net/candy/Sources/shop/item_images/adam.gif'>op/item_images/adam.gif'>
Please double-check your edits to the Shop-Buy.php file. If in doubt, please post the edited section here, and I'll take a look.