Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:26:54 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155533 Posts in 21713 Topics by 7739 Members
Latest Member: audillino
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Bakery with another fotogallery  (Read 1351 times)
snark
Guest
« on: June 07, 2010, 08:23:27 AM »

for a bakery with http://spaceforaname.com/gallery-light.html as a image slideshow


1.
change the file view_item.php

replace line 130 to app. 188 for
Code:
// Initialize or reset thumb(s) and image(s) befor laoding next item
$thumb_arr = array();
$image_arr = array();
$thumb = "";
$image = "";
$img_hoogte = 400;

// Prepare thumb and image directory pathes and urls
$thumb_dir = WB_PATH.MEDIA_DIRECTORY.'/showroom/thumbs/item'.ITEM_ID.'/';
$img_dir = WB_PATH.MEDIA_DIRECTORY.'/showroom/images/item'.ITEM_ID.'/';
$thumb_url = WB_URL.MEDIA_DIRECTORY.'/showroom/thumbs/item'.ITEM_ID.'/';
$img_url = WB_URL.MEDIA_DIRECTORY.'/showroom/images/item'.ITEM_ID.'/';

// Check if the thumb and image directories exist
if (is_dir($thumb_dir) && is_dir($img_dir)) {
// Open the image directory then loop through its contents
$dir = dir($img_dir);
while (false !== $image_file = $dir->read()) {
// Skip index file and pointers
if (eregi(".php", $image_file) || substr($image_file, 0, 1) == ".") {
continue;
}
// Thumbs use .jpg extension only
$thumb_file = str_replace (".png", ".jpg", $image_file);

// Convert filename to lightbox2 title
$img_title = str_replace(array(".png", ".jpg"), "", $image_file);
$img_title = str_replace("_", " ", $img_title);

// Make array of all item thumbs and images
if (file_exists($thumb_dir.$thumb_file) && file_exists($img_dir.$image_file)) {
// If needed add lightbox2 link to the thumb/image...
if ($setting_lightbox2 == "detail" || $setting_lightbox2 == "all") {
$prepend = "<a href='".$img_url.$image_file."' rel='lightbox[image_".ITEM_ID."]' title='".$img_title."'><img src='";
$thumb_append = "' alt='".$img_title."' title='".$img_title."'  /></a>";
$img_append = "' alt='".$img_title."' title='".$img_title."'  /></a>";
// ...else add thumb/image only
} else {
$prepend = "<li><img src='";
$img_prepend = "<div class=\"panel\"><img src='";
$thumb_append = "' alt='".$img_title."' title='".$img_title."' /></li>";
$img_append = "' alt='".$img_title."' title='".$img_title."'  height='".$img_hoogte."'/></div>";
}
// Check if a main thumb/image is set
if ($image_file == $item['main_image']) {
$thumb = $prepend.$thumb_url.$thumb_file.$thumb_append;
$image = $img_prepend.$img_url.$image_file.$img_append;
continue;
}
// Make array
$thumb_arr[] = $prepend.$thumb_url.$thumb_file.$thumb_append;
$image_arr[] = $img_prepend.$img_url.$image_file.$img_append;
}
}
}

// Make strings for use in the item templates
$thumbs = implode("\n", $thumb_arr);
$images = implode("\n", $image_arr);


2.
add to your template between <head> and </head>:
Code:
<script type="text/javascript" src="<?php echo TEMPLATE_DIR?>/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php echo TEMPLATE_DIR?>/scripts/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="<?php echo TEMPLATE_DIR?>/scripts/jquery.galleryview-1.1.js"></script>
<script type="text/javascript" src="<?php echo TEMPLATE_DIR?>/scripts/jquery.timers-1.1.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#photos').galleryView({
panel_width: 600,
panel_height: 450,
frame_width: 100,
frame_height: 100
});
});
</script>


3. include in your template files the attached zip with the js scripts

4. add to the add.php or directly into the page settings in the admin:
Code:
<div id="photos" class="galleryview">
[IMAGE]
[IMAGES]

  <ul class="filmstrip">
[THUMB]
[THUMBS]
  </ul>
</div>

« Last Edit: June 07, 2010, 12:46:09 PM by snoork » Logged
maverik

Offline Offline

Posts: 1568



WWW
« Reply #1 on: June 07, 2010, 12:25:18 PM »

This is not quite right. In your first step, you load the scripts from the view_tem.php. In your second step, you load the scripts once in the head of the template.

jQuery 1.3.2 is no longer current.

jQuery in the latest version you can use with register_frontend_m odfiles in head section.

Code:
<?php
if (function_exists('register_frontend_modfiles')) {
        
register_frontend_modfiles('css');
        
register_frontend_modfiles('jquery');
        
register_frontend_modfiles('js');
?>

sorry english is not my language but i hope you understand it
Logged

Signatur wird geladen...
snark
Guest
« Reply #2 on: June 07, 2010, 12:47:18 PM »

sorry, wrong copy paste shizzle ...

now it is corrected

the simplified code to include the jquery, yes offcourse, that is better ...
Logged
DGEC

Offline Offline

Posts: 386


WWW
« Reply #3 on: June 08, 2010, 05:31:28 PM »

Probably worth noting that this photo gallery is the plugin called GalleryView, and the homepage is http://spaceforaname.com/galleryview
However, the latest version & release information is only on http://plugins.jquery.com/project/galleryview

Thanks snoork, this looks like a nice option. Any thought of packaging it into a module or another package?
« Last Edit: June 08, 2010, 05:34:52 PM by DGEC » Logged
snark
Guest
« Reply #4 on: June 08, 2010, 07:10:07 PM »

you can reather easily use bakery and comment out all shop options so that you have an imagegallery with a textfield

on the other hand you might want the option like brax highslide gallery to point out a folder to automatically generate the image gallery.

I guess it can be done, I will try to find the time
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!