General Community > WebsiteBaker Website Showcase

New custom website (dutch)

<< < (7/8) > >>

Ruud:
@Boudi

One more improvement.. Just in case you can't get enough of it.
Just did some small test to use the resizer from imageflow in the catalog.

In /module/catalogs/view.php you need to change the following:
From line 517 (the 2 lines with thumbnail_pic are added):

--- Code: --- if($num_pics > 0)
 {
    while($element = $query_pics->fetchRow())
     {
        $pic= stripslashes($element['pic']);
        $direction_pic=WB_URL.MEDIA_DIRECTORY."/cat_pics/".$pic;
        $thumbnail_pic=WB_URL."/modules/imageflow/reflect.php?img=/cat_pics/".$pic."&height=1&jpeg=70&newwidth=100&cache=1";
        $smarty->append('pics',array(
            'pic'=>$element['pic'],
            'thumbnail_pic'=>$thumbnail_pic,
            'direction_pic'=>$direction_pic
        ));
     }
 }

--- End code ---

Next in details_elements.tp l the line you changed before to get highslide working


--- Code: ---<a href="{$pics[sec2].direction_pic}" class="highslide" onclick="return hs.expand(this)"><img src="{$pics[sec2].thumbnail_pic}" alt="Highslide JS" title="Click to enlarge" width="100" /></a>

--- End code ---

You could use the same thumbnail trick on the list page too.
If you need help on doing that, let me know. You might be able to find out yourself looking at the code for the details pages.

Note: This will work because the imageflow module is installed.
Don't use this on other sites (without imageflow module)

Groetjes,

Ruud

Boudi:
hi Ruud,

Just implemented it but it didn't do the trick.

The view.php was original so there could be no error I think.

The details_elements.tp l is rather ripped off so may be here could be an error.

I give you a piece before and after the position where your code should be (this is the current code)


--- Code: ---<?php if ($this->_tpl_vars[&#39;pics&#39;][$this->_sections[&#39;sec2&#39;][&#39;index&#39;]][&#39;pic&#39;] != ""): ?>

       <a href="<?php echo $this->_tpl_vars[&#39;pics&#39;][$this->_sections[&#39;sec2&#39;][&#39;index&#39;]][&#39;direction_pic&#39;]; ?>
" class="highslide" onClick="return hs.expand(this)"><img src="<?php echo $this->_tpl_vars[&#39;pics&#39;][$this->_sections[&#39;sec2&#39;][&#39;index&#39;]][&#39;direction_pic&#39;]; ?>
" alt="Highslide JS" title="Klik om te vergroten" width="100" /></a>

&nbsp;<?php endif; ?>
--- End code ---

When changing your code with the piece that is in the middle it does not work  :-(

Ruud:
The additional ines in view.php will create an extra element (called thumbnail_pic) in the "pics" array.

You want to use the thumbnail in the <img src=""> part. So your code would become:


--- Code: ---<?php if ($this->_tpl_vars[&#39;pics&#39;][$this->_sections[&#39;sec2&#39;][&#39;index&#39;]][&#39;pic&#39;] != ""): ?>

       <a href="<?php echo $this->_tpl_vars[&#39;pics&#39;][$this->_sections[&#39;sec2&#39;][&#39;index&#39;]][&#39;direction_pic&#39;]; ?>
" class="highslide" onClick="return hs.expand(this)"><img src="<?php echo $this->_tpl_vars[&#39;pics&#39;][$this->_sections[&#39;sec2&#39;][&#39;index&#39;]][&#39;thumbnail_pic&#39;]; ?>
" alt="Highslide JS" title="Klik om te vergroten" width="100" /></a>

&nbsp;<?php endif; ?>
--- End code ---

Find the "thumbnail_pic" to see where it changed.

Ruud

Boudi:
Ok done, Implemented it.

But ehm no offense  :oops:, I see no difference? other than what was already there?  :|

Ruud:
Look at the properties of a thumbnail in a details page.

You will see it is now 3kb instead of the 300kb of the original image.
A page like http://www.telmakelaars.nl/pages/catalog/de-wilp32.php?cat_id=1&number=0 will load about 2MB less data.

Some people (especially with 48kb dial-up modems) will see the difference.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version