<?php
/**
* additional_images module
*
* Prepares list of additional product images to be displayed in template
*
* @package templateSystem
* @copyright Copyright 2003-2007 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: additional_images.php 6132 2007-04-08 06:58:40Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
$images_array = array();
if ($products_image != '') {
// prepare image name
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = str_replace($products_image_extension, '', $products_image);
// if in a subdirectory
if (strrpos($products_image, '/')) {
$products_image_match = substr($products_image, strrpos($products_image, '/')+1);
//echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' - base ' . $products_image_base . '<br>';
$products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
$products_image_base = $products_image_match;
}
$products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
if ($products_image_directory != '') {
$products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
} else {
$products_image_directory = DIR_WS_IMAGES;
}
// Check for additional matching images
$file_extension = $products_image_extension;
$products_image_match_array = array();
if ($dir = @dir($products_image_directory)) {
while ($file = $dir->read()) {
if (!is_dir($products_image_directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
// if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
if(preg_match("/" . $products_image_base . "/i", $file) == 1) {
if ($file != $products_image) {
if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
// echo 'I AM A MATCH ' . $file . '<br>';
$images_array[] = $file;
} else {
// echo 'I AM NOT A MATCH ' . $file . '<br>';
}
}
}
}
}
}
if (sizeof($images_array)) {
sort($images_array);
}
$dir->close();
}
}
// Build output based on images found
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';
if ($num_images) {
$row = 0;
$col = 0;
if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
$col_width = floor(100/$num_images);
} else {
$col_width = floor(100/IMAGES_AUTO_ADDED);
}
for ($i=0, $n=$num_images; $i<$n; $i++) {
$file = $images_array[$i];
$products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
// bof Zen Lightbox 2008-12-11 aclarke
if (function_exists('handle_image')) {
$flag_has_large = true;
} else {
// eof Zen Lightbox 2008-12-11 aclarke
$flag_has_large = file_exists($products_image_large);
// bof Zen Lightbox 2008-12-11 aclarke
}
// eof Zen Lightbox 2008-12-11 aclarke
$products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
$flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
$base_image = $products_image_directory . $file;
$thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
// bof Zen Lightbox 2008-12-11 aclarke
if (function_exists('handle_image')) {
// remove additional single quotes from image attributes (important!)
$thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
}
// eof Zen Lightbox 2008-12-11 aclarke
$thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
// Link Preparation:
// bof Zen Lightbox 2008-12-11 aclarke
if (ZEN_LIGHTBOX_STATUS == 'true') {
if (ZEN_LIGHTBOX_GALLERY_MODE == 'true') {
$rel = 'lightbox-g';
} else {
$rel = 'lightbox';
}
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '" title="' . addslashes($products_name) . '">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
} else {
// eof Zen Lightbox 2008-12-11 aclarke
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
// bof Zen Lightbox 2008-12-11 aclarke
}
// eof Zen Lightbox 2008-12-11 aclarke
$noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';
// $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';
$link = $script_link . "\n " . $noscript_link;
// $link = $alternate_link;
// List Box array generation:
$list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => "\n " . $link);
$col ++;
if ($col > (IMAGES_AUTO_ADDED -1)) {
$col = 0;
$row ++;
}
} // end for loop
} // endif
?>
没有合适的资源?快使用搜索试试~ 我知道了~
原创 zen_lightbox 修复版本 支持firefox4 谷歌浏览器 最新版
共31个文件
php:17个
gif:5个
jpg:2个
5星 · 超过95%的资源 需积分: 9 28 下载量 39 浏览量
2011-06-15
09:37:24
上传
评论 1
收藏 116KB ZIP 举报
温馨提示
原创 zen_lightbox 修复版本 支持firefox4 谷歌浏览器 最新版 修复zen_lightbox在firefox最新版不能放大图片问题 国外网站整理覆盖的 。。 大家支持一下!~
资源推荐
资源详情
资源评论
收起资源包目录
zen_lightbox-v1.5-修正版.zip (31个子文件)
uninstall.sql 493B
readme.html 19KB
jscript_zen_lightbox.php 963B
includes
languages
english
extra_definitions
YOUR-TEMPLATE-FOLDER
zen_lightbox.php 664B
functions
extra_functions
zen_lightbox.php 1KB
modules
pages
page
jscript_zen_lightbox.php 997B
document_product_info
jscript_zen_lightbox.php 558B
product_info
jscript_zen_lightbox.php 558B
product_free_shipping_info
jscript_zen_lightbox.php 558B
document_general_info
jscript_zen_lightbox.php 558B
product_reviews_write
jscript_zen_lightbox.php 558B
product_music_info
jscript_zen_lightbox.php 558B
product_reviews_info
jscript_zen_lightbox.php 558B
product_reviews
jscript_zen_lightbox.php 558B
YOUR-TEMPLATE-FOLDER
additional_images.php 7KB
templates
YOUR-TEMPLATE-FOLDER
css
stylesheet_zen_lightbox.css 1KB
jscript
zen_lightbox_mootools_custom.js 138KB
zen_lightbox_mootools_default.js 46KB
images
zen_lightbox
loading.gif 1KB
Thumbs.db 8KB
buttons
english
zen_lightbox
nextlabel.gif 354B
prevlabel.gif 371B
closelabel.gif 971B
templates
tpl_modules_main_product_image.php 2KB
classes
zen_lightbox
autoload_default.php 741B
options.php 1KB
slimbox.php 6KB
_readme_files
example_large.jpg 20KB
example_small.jpg 19KB
x-click-but21.gif 574B
install.sql 7KB
共 31 条
- 1
资源评论
- yilufa16882012-12-08可以啊 ,用了 没出什么问题
cld455
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功