WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: gicasso on August 04, 2014, 02:28:40 PM

Title: AnyItems - Bakery. How to display image?
Post by: gicasso on August 04, 2014, 02:28:40 PM
When I use 'anyItems' with Bakery, everything works ...only the image wont display!
Any suggestions how I can display  the image?

I use Bakery Anyitems 0.6 & WebsiteBaker 2.8.3 & Bakery 1.70
I use this php code in the index of my template;
Code: [Select]
<?php display_any_items(4311); ?>I also tried this code
Code: [Select]
<?php display_any_items(43111); ?>
Title: Re: AnyItems - Bakery. How to display image?
Post by: instantflorian on August 04, 2014, 03:10:06 PM
Hi,

update to the newer version (http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0CAD5DB1) (0.7), because the image handling has been changed with Bakery 1.70.
Title: Re: AnyItems - Bakery. How to display image?
Post by: gicasso on August 04, 2014, 03:40:33 PM
Thanks, it works fine with version 0.7 ;)
Title: Re: AnyItems - Bakery. How to display image?
Post by: Boudi on March 17, 2015, 02:48:16 PM
AnyItems images are gone again with Bakery 1.71.

Any update for this?
Title: Re: AnyItems - Bakery. How to display image?
Post by: Gast on March 17, 2015, 08:23:35 PM
i take a little look into the anyItem-Snippet Vers. 0.70 here from the Addon area (http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0CAD5DB1)

Problem 1: the include.php use for the internal links to the lightbox-files http://localhost/wb283/ instead of <?php echo WB_URL; ?>

corrected code from line 161 - 176 // file modules/anyitems/include.php
Code: [Select]
<script type="text/javascript">window.jQuery || document.write('<script src="<?php echo WB_URL?>/modules/bakery/jquery/jquery-1.7.2.min.js"><\/script>')</script>
                        <script type="text/javascript" src="<?php echo WB_URL?>/modules/bakery/lightbox2/js/lightbox.js"></script>
                        <script type="text/javascript">
                        //  Lightbox2 options
                        $(function () {
                            var lightbox, options;
                            options = new LightboxOptions;

                            options.fileLoadingImage = '<?php echo WB_URL?>/modules/bakery/lightbox2/images/loading.gif';
                            options.fileCloseImage   = '<?php echo WB_URL?>/modules/bakery/lightbox2/images/close.png';
                            options.labelImage       = 'Bild';
                            options.labelOf          = 'von';

                            return lightbox          = new Lightbox(options);
                        });
                        </script>

Problem 2: (maybe a bakery problem):
Bakery Vers. 1.71 use a 0 (zero) for the position of the main picture in the database
Vers. 1.70 use position = 1 for the main picture - this can be a problem, if you upgrade from Version 1.70 to Vers 1.71
(maybe it can be solved, if you change the picture order for every article 2x)
you have to change the value for the field position in the file modules/anyitems/include.php


Line 182
original code
Code: [Select]
$query_images = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_images` WHERE position = '1' AND active = '1'");
(for bakery Vers 1.71 only)
Code: [Select]
$query_images = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_images` WHERE position = '0' AND active = '1'");
Title: Re: AnyItems - Bakery. How to display image?
Post by: Boudi on March 17, 2015, 08:48:28 PM
Yes!

Your last point did the trick: (V1.71 only)

Quote
Original code:

$query_images = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_images` WHERE position = '1' AND active = '1'");

New code:

$query_images = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_images` WHERE position = '0' AND active = '1'");

Thnx for pointing this out.  :-)