X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Detailed Image(s) Popup 2.1 [3.4.x-4.0.x] (https://forum.x-cart.com/showthread.php?t=8460)

dazybabes 05-03-2005 02:37 AM

had initial problems with the product.tpl but got rid of the strip tags and it seemed to work but now in the pop up I get


Quote:

Parse error: parse error in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 19

this is the product_detailed_images.php

Code:

<?php
#
# Detailed Images Popup
# Version 2.1
# http://www.cart-lab.com
# info@cart-lab.com
# (C)opyright 2003-2004 CartLab, all rights reserved.
# Full license at: http://www.cart-lab.com/license.php
#
require "./auth.php";

#
# Collect product images
#
$images = func_query("select * from $sql_tbl[images] where productid='$productid' order by orderby,imageid");

# Find max width and total height of all collected images (currently not used)
foreach($images as $k=>$v) {
Б─═ Б─═foreach($v as $kk=>$vv) {
Б─═ Б─═Б─═ Б─═if($kk=="image_x") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxwidth >= $previous_maxwidth) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxwidth=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxwidth=$vv;
Б─═ Б─═Б─═ Б─═} elseif($kk=="image_y") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxheight >= $previous_maxheight) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxheight=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxheight=$vv;
Б─═ Б─═Б─═ Б─═}Б─═ Б─═Б─═ Б─═
Б─═ Б─═}
}

$smarty->assign("winw",$maxwidth);
$smarty->assign("winh",$maxheight);
$smarty->assign("images",$images);
$smarty->display("customer/main/product_images.tpl");

?>


any ideas??

TelaFirma 05-03-2005 04:24 AM

you need to get rid of all those Б─═ Б─═Б─═ Б─═Б─═ Б─═ marks infront of the code (starting at line 19)

dazybabes 05-03-2005 05:48 AM

I dont know where all those crosses came from as all Ive done is copy and paste the coding. Anyway Ive deleted them now and I get this now?!

Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


Should I be keeping my images somewhere special or something??[/b][/code]

dazybabes 05-04-2005 12:30 AM

Ok so I've re-added all original files of Boomers and Im still getting this error message in the pop up?


Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


Can anyone see where the problem might be?

Code:

<?php
#
# Detailed Images Popup
# Version 2.1
# http://www.cart-lab.com
# info@cart-lab.com
# (C)opyright 2003-2004 CartLab, all rights reserved.
# Full license at: http://www.cart-lab.com/license.php
#
require "./auth.php";

#
# Collect product images
#
$images = func_query("select * from $sql_tbl[images] where productid='$productid' order by orderby,imageid");

# Find max width and total height of all collected images (currently not used)
foreach($images as $k=>$v) {
Б─═ Б─═foreach($v as $kk=>$vv) {
Б─═ Б─═Б─═ Б─═if($kk=="image_x") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxwidth >= $previous_maxwidth) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxwidth=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxwidth=$vv;
Б─═ Б─═Б─═ Б─═} elseif($kk=="image_y") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxheight >= $previous_maxheight) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxheight=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxheight=$vv;
Б─═ Б─═Б─═ Б─═}Б─═ Б─═Б─═ Б─═
Б─═ Б─═}
}

$smarty->assign("winw",$maxwidth);
$smarty->assign("winh",$maxheight);
$smarty->assign("images",$images);
$smarty->display("customer/main/product_images.tpl");

?>

Ignore the crosses they just turn up when I copy and paste the code from dreamweaver??

if anyone needs to look at the site let me know

B00MER 05-04-2005 05:34 AM

Quote:

Originally Posted by dazybabes
Ignore the crosses they just turn up when I copy and paste the code from dreamweaver??


Dreamweaver, is probably the problem try editing the files with Notepad or a simple text editor and reupload the files. Dreamweaver is known for mucking up code. :wink:

dazybabes 05-05-2005 05:51 AM

Sorry still no go???

I've uploaded the files from your website also straight to my ftp etc and still getting the same problem when I click on the 'view details' bit in the product info

Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


this is line 18

Code:

foreach($images as $k=>$v) {

This is the full coding for the product_detailed_images.php
Code:

<?php
#
# Detailed Images Popup
# Version 2.1
# http://www.cart-lab.com
# info@cart-lab.com
# (C)opyright 2003-2004 CartLab, all rights reserved.
# Full license at: http://www.cart-lab.com/license.php
#
require "./auth.php";

#
# Collect product images
#
$images = func_query("select * from $sql_tbl[images] where productid='$productid' order by orderby,imageid");

# Find max width and total height of all collected images (currently not used)
foreach($images as $k=>$v) {
foreach($v as $kk=>$vv) {
if($kk=="image_x") {
if($maxwidth >= $previous_maxwidth) {
$maxwidth=$vv;
}
$previous_maxwidth=$vv;
} elseif($kk=="image_y") {
if($maxheight >= $previous_maxheight) {
$maxheight=$vv;
}
$previous_maxheight=$vv;
}
}
}

$smarty->assign("winw",$maxwidth);
$smarty->assign("winh",$maxheight);
$smarty->assign("images",$images);
$smarty->display("customer/main/product_images.tpl");

?>


Is that coding in line 18 correct? has it been changed or should I be saving or loading my detailed images somewhere else??

Any help would be great or I will have to revert to an alternative way of viewing images??[/code][/b]

B00MER 05-05-2005 06:26 AM

Quote:

Originally Posted by dazybabes
Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


this is line 18

Code:

foreach($images as $k=>$v) {


Are you currently passing product_detailed_images.php an productid from the product.tpl page? Also do you have a product added that has more than 2 detailed images, as well as the module is not disabled.

It seems the array is empty, which means no productid was specified or no detailed images exist, this is why you see No Image(s) Found! after the warning.

Hope this helps.
:wink:

bmm 05-06-2005 12:09 AM

Thank You Boomer
 
BOOMER,
WOW, somehow my reply...made into a NEW TOPIC!
So I am reposting.

Just a simple "Thank You", the mod works great using 4.0.12 ( too chicken to update to 4.0.13).
Et al,
you have to read the WHOLE post (2 parts) most questions are answered
in the first thread http://forum.x-cart.com/viewtopic.php?t=276 for 3.XXX questions.

I have a list of ideas based off this mod, but you would have to charge.....

What a sick mod...and for free! = Donations!

BTW, I checked out http://www.cart-lab.com, WOW. Where do I start?

Thanks,


-r

dazybabes 05-06-2005 01:53 AM

Well a new day and a Fresh look at things has brought success!?

Had another gander thru the coding and saw something wrong in the product.tpl so copied your original coding and hey presto!?

Works Brilliantly Boomer thanks for your help!?

although I do have a question???

Is there anyway of incorporating the detailed image alt text inbetween the next and previous buttons???

Pleeease, pretty pleeease??? :lol:

offline 05-10-2005 08:12 AM

With a little modification I got this great mod working in no time. One question, how do I make the popup window slightly larger so I can see the next & prev tags?


All times are GMT -8. The time now is 03:08 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.