Author Topic: AnyItems - Bakery. How to display image?  (Read 2887 times)

Offline gicasso

  • Posts: 62
AnyItems - Bakery. How to display image?
« 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); ?>

instantflorian

  • Guest
Re: AnyItems - Bakery. How to display image?
« Reply #1 on: August 04, 2014, 03:10:06 PM »
Hi,

update to the newer version (0.7), because the image handling has been changed with Bakery 1.70.

Offline gicasso

  • Posts: 62
Re: AnyItems - Bakery. How to display image?
« Reply #2 on: August 04, 2014, 03:40:33 PM »
Thanks, it works fine with version 0.7 ;)

Offline Boudi

  • Global Moderator
  • *****
  • Posts: 1190
  • Gender: Male
  • //o_-\\
    • Yze Webdesign
Re: AnyItems - Bakery. How to display image?
« Reply #3 on: March 17, 2015, 02:48:16 PM »
AnyItems images are gone again with Bakery 1.71.

Any update for this?
...:: Bake the Unbakable ::...

Offline Gast

  • Posts: 5920
Re: AnyItems - Bakery. How to display image?
« Reply #4 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

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'");
« Last Edit: March 17, 2015, 08:29:14 PM by jacobi22 »

Offline Boudi

  • Global Moderator
  • *****
  • Posts: 1190
  • Gender: Male
  • //o_-\\
    • Yze Webdesign
Re: AnyItems - Bakery. How to display image?
« Reply #5 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.  :-)
...:: Bake the Unbakable ::...