Forums / Addon Sideboxes / jScroller Sidebox Package Support Thread

jScroller Sidebox Package Support Thread

Started by clydejones on 21 Jan 2009, 3:30 AM · Views: 46,845

Results 121 to 140 of 167
9 Feb 2010, 7:11 AM
#121
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

jScroller Sidebox Package Support Thread

clydejones:

The sidebox uses the small image size you have set in

admin -> configuration -> images

If the default size is too small, this is where you would make the changes.

You can make changes in the scroll speed by:

open includes/templates/YOUR_TEMPLATE/sideboxes/tpl_featured.php

find the following line of code and change the highlighted portion

$content .= '<div class="scroller_container"><div class="jscroller2_up jscroller2_speed-20 jscroller2_mousemove">' . $fp .'</div></div>';

Thank you Clyde:clap:

MY Website
The best of the best: Zen Cart

7 Mar 2010, 4:28 PM
#122
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: jScroller Sidebox Package Support Thread

Hi i have just added the jScroller sidebox but it doesnt seem to be scrolling - ive uploaded everything in my custom folder and the new sideboxes appeared in my layout boxes controller.

I have enabled both the featured and whats new sidebox but still no scrolling

site: http://www.zainabscollection.com

7 Mar 2010, 4:38 PM
#123
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

Hi i have just added the jScroller sidebox but it doesnt seem to be scrolling - ive uploaded everything in my custom folder and the new sideboxes appeared in my layout boxes controller.

I have enabled both the featured and whats new sidebox but still no scrolling

site: http://www.zainabscollection.com

make sure you have uploaded the following:

includes/js/jscroller2-1.5.js

includes/templates/YOUR_TEMPLATE/jscript/jscript_scroller.php

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

7 Mar 2010, 5:14 PM
#125
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

hi they have both been uploaded

thanks

What are your settings in:

admin -> configuration -> maximum values -> Random New Products for SideBox

AND

admin -> configuration -> maximum values -> Random Featured Products for SideBox

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

7 Mar 2010, 5:45 PM
#127
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

hi
random new products for sidebox = 3
random featured products for sidebox = 5

looking at the page source for the site, I don't see any indication that the jscroller script is being called.

I do see the imagehover script is being called but nothing else.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

8 Mar 2010, 5:56 PM
#129
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

any idea what i can do so that the store calls the js file

thanks for all your help so far

make sure all the files in includes/templates/YOUR_TEMPLATE/jscript

are being included when your minifier script is run.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

8 Mar 2010, 6:11 PM
#131
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

Hi
Im not really sure how to do that. sorry

thanks

I don't either, you might want to check with whoever provided the minify script

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

8 Mar 2010, 6:17 PM
#132
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: jScroller Sidebox Package Support Thread

ok thanks alot
not too sure what the minify script is - but the last thing that I added was the jquery lightbox and zoom - yes there was some sort of extra javascript sql patch which shows up under admin>configurations>css/java loader in the backend of the store.

Not too sure what this does but i am presuming its got to do with this.

I dont think there is a file as such that I can edit. Do you know a work around?

Yup minify came with jquery zoom. the contents reads as follows```html

<?php /** * Class Minify * @package Minify */ /** * Minify_Source */ require_once 'Minify/Source.php'; /** * Minify - Combines, minifies, and caches JavaScript and CSS files on demand. * * See README for usage instructions (for now). * * This library was inspired by {@link mailto:[email protected] jscsscomp by Maxim Martynyuk} * and by the article {@link http://www.hunlock.com/blogs/Supercharged_Javascript "Supercharged JavaScript" by Patrick Hunlock}. * * Requires PHP 5.1.0. * Tested on PHP 5.1.6. * * @package Minify * @author Ryan Grove <[email protected]> * @author Stephen Clay <[email protected]> * @copyright 2008 Ryan Grove, Stephen Clay. All rights reserved. * @license http://opensource.org/licenses/bsd-license.php New BSD License * @link http://code.google.com/p/minify/ */ class Minify { const VERSION = '2.1.3'; const TYPE_CSS = 'text/css'; const TYPE_HTML = 'text/html'; // there is some debate over the ideal JS Content-Type, but this is the // Apache default and what Yahoo! uses.. const TYPE_JS = 'application/x-javascript'; /** * How many hours behind are the file modification times of uploaded files? * * If you upload files from Windows to a non-Windows server, Windows may report * incorrect mtimes for the files. Immediately after modifying and uploading a * file, use the touch command to update the mtime on the server. If the mtime * jumps ahead by a number of hours, set this variable to that number. If the mtime * moves back, this should not be needed. * * @var int $uploaderHoursBehind */ public static $uploaderHoursBehind = 0; /** * If this string is not empty AND the serve() option 'bubbleCssImports' is * NOT set, then serve() will check CSS files for @import declarations that * appear too late in the combined stylesheet. If found, serve() will prepend * the output with this warning. * * @var string $importWarning */ public static $importWarning = "/* See http://code.google.com/p/minify/wiki/CommonProblems#@imports_can_appear_in_invalid_locations_in_combined_CSS_files */\n"; /** * Specify a cache object (with identical interface as Minify_Cache_File) or * a path to use with Minify_Cache_File. * * If not called, Minify will not use a cache and, for each 200 response, will * need to recombine files, minify and encode the output. * * @param mixed $cache object with identical interface as Minify_Cache_File or * a directory path, or null to disable caching. (default = '') * * @param bool $fileLocking (default = true) This only applies if the first * parameter is a string. * * @return null */ public static function setCache($cache = '', $fileLocking = true) { if (is_string($cache)) { require_once 'Minify/Cache/File.php'; self::$_cache = new Minify_Cache_File($cache, $fileLocking); } else { self::$_cache = $cache; } } /** * Serve a request for a minified file. * * Here are the available options and defaults in the base controller: * * 'isPublic' : send "public" instead of "private" in Cache-Control * headers, allowing shared caches to cache the output. (default true) * * 'quiet' : set to true to have serve() return an array rather than sending * any headers/output (default false) * * 'encodeOutput' : set to false to disable content encoding, and not send * the Vary header (default true) * * 'encodeMethod' : generally you should let this be determined by * HTTP_Encoder (leave null), but you can force a particular encoding * to be returned, by setting this to 'gzip' or '' (no encoding) * * 'encodeLevel' : level of encoding compression (0 to 9, default 9) * * 'contentTypeCharset' : appended to the Content-Type header sent. Set to a falsey * value to remove. (default 'utf-8') * * 'maxAge' : set this to the number of seconds the client should use its cache * before revalidating with the server. This sets Cache-Control: max-age and the * Expires header. Unlike the old 'setExpires' setting, this setting will NOT * prevent conditional GETs. Note this has nothing to do with server-side caching. * * 'rewriteCssUris' : If true, serve() will automatically set the 'currentDir' * minifier option to enable URI rewriting in CSS files (default true) * * 'bubbleCssImports' : If true, all @import declarations in combined CSS * files will be move to the top. Note this may alter effective CSS values * due to a change in order. (default false) * * 'debug' : set to true to minify all sources with the 'Lines' controller, which * eases the debugging of combined files. This also prevents 304 responses. * @see Minify_Lines::minify() * * 'minifiers' : to override Minify's default choice of minifier function for * a particular content-type, specify your callback under the key of the * content-type: * <code> * // call customCssMinifier($css) for all CSS minification * $options['minifiers'][Minify::TYPE_CSS] = 'customCssMinifier'; * * // don't minify Javascript at all * $options['minifiers'][Minify::TYPE_JS] = ''; * </code> * * 'minifierOptions' : to send options to the minifier function, specify your options * under the key of the content-type. E.g. To send the CSS minifier an option: * <code> * // give CSS minifier array('optionName' => 'optionValue') as 2nd argument * $options['minifierOptions'][Minify::TYPE_CSS]['optionName'] = 'optionValue'; * </code> * * 'contentType' : (optional) this is only needed if your file extension is not * js/css/html. The given content-type will be sent regardless of source file * extension, so this should not be used in a Groups config with other * Javascript/CSS files. * * Any controller options are documented in that controller's setupSources() method. * * @param mixed instance of subclass of Minify_Controller_Base or string name of * controller. E.g. 'Files' * * @param array $options controller/serve options * * @return mixed null, or, if the 'quiet' option is set to true, an array * with keys "success" (bool), "statusCode" (int), "content" (string), and * "headers" (array). */ public static function serve($controller, $options = array()) { if (is_string($controller)) { // make $controller into object $class = 'Minify_Controller_' . $controller; if (! class_exists($class, false)) { require_once "Minify/Controller/" . str_replace('_', '/', $controller) . ".php"; } $controller = new $class(); } // set up controller sources and mix remaining options with // controller defaults $options = $controller->setupSources($options); $options = $controller->analyzeSources($options); self::$_options = $controller->mixInDefaultOptions($options); // check request validity if (! $controller->sources) { // invalid request! if (! self::$_options['quiet']) { header(self::$_options['badRequestHeader']); echo self::$_options['badRequestHeader']; return; } else { list(,$statusCode) = explode(' ', self::$_options['badRequestHeader']); return array( 'success' => false ,'statusCode' => (int)$statusCode ,'content' => '' ,'headers' => array() ); } } self::$_controller = $controller; if (self::$_options['debug']) { self::_setupDebug($controller->sources); self::$_options['maxAge'] = 0; } // determine encoding if (self::$_options['encodeOutput']) { if (self::$_options['encodeMethod'] !== null) { // controller specifically requested this $contentEncoding = self::$_options['encodeMethod']; } else { // sniff request header require_once 'HTTP/Encoder.php'; // depending on what the client accepts, $contentEncoding may be // 'x-gzip' while our internal encodeMethod is 'gzip'. Calling // getAcceptedEncoding(false, false) leaves out compress and deflate as options. list(self::$_options['encodeMethod'], $contentEncoding) = HTTP_Encoder::getAcceptedEncoding(false, false); } } else { self::$_options['encodeMethod'] = ''; // identity (no encoding) } // check client cache require_once 'HTTP/ConditionalGet.php'; $cgOptions = array( 'lastModifiedTime' => self::$_options['lastModifiedTime'] ,'isPublic' => self::$_options['isPublic'] ,'encoding' => self::$_options['encodeMethod'] ); if (self::$_options['maxAge'] > 0) { $cgOptions['maxAge'] = self::$_options['maxAge']; } $cg = new HTTP_ConditionalGet($cgOptions); if ($cg->cacheIsValid) { // client's cache is valid if (! self::$_options['quiet']) { $cg->sendHeaders(); return; } else { return array( 'success' => true ,'statusCode' => 304 ,'content' => '' ,'headers' => $cg->getHeaders() ); } } else { // client will need output $headers = $cg->getHeaders(); unset($cg); } if (self::$_options['contentType'] === self::TYPE_CSS && self::$_options['rewriteCssUris']) { reset($controller->sources); while (list($key, $source) = each($controller->sources)) { if ($source->filepath && !isset($source->minifyOptions['currentDir']) && !isset($source->minifyOptions['prependRelativePath']) ) { $source->minifyOptions['currentDir'] = dirname($source->filepath); } } } // check server cache if (null !== self::$_cache) { // using cache // the goal is to use only the cache methods to sniff the length and // output the content, as they do not require ever loading the file into // memory. $cacheId = 'minify_' . self::_getCacheId(); $fullCacheId = (self::$_options['encodeMethod']) ? $cacheId . '.gz' : $cacheId; // check cache for valid entry $cacheIsReady = self::$_cache->isValid($fullCacheId, self::$_options['lastModifiedTime']); if ($cacheIsReady) { $cacheContentLength = self::$_cache->getSize($fullCacheId); } else { // generate & cache content $content = self::_combineMinify(); self::$_cache->store($cacheId, $content); if (function_exists('gzencode')) { self::$_cache->store($cacheId . '.gz', gzencode($content, self::$_options['encodeLevel'])); } } } else { // no cache $cacheIsReady = false; $content = self::_combineMinify(); } if (! $cacheIsReady && self::$_options['encodeMethod']) { // still need to encode $content = gzencode($content, self::$_options['encodeLevel']); } // add headers $headers['Content-Length'] = $cacheIsReady ? $cacheContentLength : strlen($content); $headers['Content-Type'] = self::$_options['contentTypeCharset'] ? self::$_options['contentType'] . '; charset=' . self::$_options['contentTypeCharset'] : self::$_options['contentType']; if (self::$_options['encodeMethod'] !== '') { $headers['Content-Encoding'] = $contentEncoding; } if (self::$_options['encodeOutput']) { $headers['Vary'] = 'Accept-Encoding'; } if (! self::$_options['quiet']) { // output headers & content foreach ($headers as $name => $val) { header($name . ': ' . $val); } if ($cacheIsReady) { self::$_cache->display($fullCacheId); } else { echo $content; } } else { return array( 'success' => true ,'statusCode' => 200 ,'content' => $cacheIsReady ? self::$_cache->fetch($fullCacheId) : $content ,'headers' => $headers ); } } /** * Return combined minified content for a set of sources * * No internal caching will be used and the content will not be HTTP encoded. * * @param array $sources array of filepaths and/or Minify_Source objects * * @param array $options (optional) array of options for serve. By default * these are already set: quiet = true, encodeMethod = '', lastModifiedTime = 0. * * @return string */ public static function combine($sources, $options = array()) { $cache = self::$_cache; self::$_cache = null; $options = array_merge(array( 'files' => (array)$sources ,'quiet' => true ,'encodeMethod' => '' ,'lastModifiedTime' => 0 ), $options); $out = self::serve('Files', $options); self::$_cache = $cache; return $out['content']; } /** * On IIS, create $_SERVER['DOCUMENT_ROOT'] * * @param bool $unsetPathInfo (default false) if true, $_SERVER['PATH_INFO'] * will be unset (it is inconsistent with Apache's setting) * * @return null */ public static function setDocRoot($unsetPathInfo = false) { if (isset($_SERVER['SERVER_SOFTWARE']) && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/') ) { $_SERVER['DOCUMENT_ROOT'] = rtrim(substr( $_SERVER['PATH_TRANSLATED'] ,0 ,strlen($_SERVER['PATH_TRANSLATED']) - strlen($_SERVER['SCRIPT_NAME']) ), '\\'); if ($unsetPathInfo) { unset($_SERVER['PATH_INFO']); } require_once 'Minify/Logger.php'; Minify_Logger::log("setDocRoot() set DOCUMENT_ROOT to \"{$_SERVER['DOCUMENT_ROOT']}\""); } } /** * @var mixed Minify_Cache_* object or null (i.e. no server cache is used) */ private static $_cache = null; /** * @var Minify_Controller active controller for current request */ protected static $_controller = null; /** * @var array options for current request */ protected static $_options = null; /** * Set up sources to use Minify_Lines * * @param array $sources Minify_Source instances * * @return null */ protected static function _setupDebug($sources) { foreach ($sources as $source) { $source->minifier = array('Minify_Lines', 'minify'); $id = $source->getId(); $source->minifyOptions = array( 'id' => (is_file($id) ? basename($id) : $id) ); } } /** * Combines sources and minifies the result. * * @return string */ protected static function _combineMinify() { $type = self::$_options['contentType']; // ease readability // when combining scripts, make sure all statements separated and // trailing single line comment is terminated $implodeSeparator = ($type === self::TYPE_JS) ? "\n;" : ''; // allow the user to pass a particular array of options to each // minifier (designated by type). source objects may still override // these $defaultOptions = isset(self::$_options['minifierOptions'][$type]) ? self::$_options['minifierOptions'][$type] : array(); // if minifier not set, default is no minification. source objects // may still override this $defaultMinifier = isset(self::$_options['minifiers'][$type]) ? self::$_options['minifiers'][$type] : false; if (Minify_Source::haveNoMinifyPrefs(self::$_controller->sources)) { // all source have same options/minifier, better performance // to combine, then minify once foreach (self::$_controller->sources as $source) { $pieces[] = $source->getContent(); } $content = implode($implodeSeparator, $pieces); if ($defaultMinifier) { self::$_controller->loadMinifier($defaultMinifier); $content = call_user_func($defaultMinifier, $content, $defaultOptions); } } else { // minify each source with its own options and minifier, then combine foreach (self::$_controller->sources as $source) { // allow the source to override our minifier and options $minifier = (null !== $source->minifier) ? $source->minifier : $defaultMinifier; $options = (null !== $source->minifyOptions) ? array_merge($defaultOptions, $source->minifyOptions) : $defaultOptions; if ($minifier) { self::$_controller->loadMinifier($minifier); // get source content and minify it $pieces[] = call_user_func($minifier, $source->getContent(), $options); } else { $pieces[] = $source->getContent(); } } $content = implode($implodeSeparator, $pieces); } if ($type === self::TYPE_CSS && false !== strpos($content, '@import')) { $content = self::_handleCssImports($content); } // do any post-processing (esp. for editing build URIs) if (self::$_options['postprocessorRequire']) { require_once self::$_options['postprocessorRequire']; } if (self::$_options['postprocessor']) { $content = call_user_func(self::$_options['postprocessor'], $content, $type); } return $content; } /** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @return string */ protected static function _getCacheId() { return md5(serialize(array( Minify_Source::getDigest(self::$_controller->sources) ,self::$_options['minifiers'] ,self::$_options['minifierOptions'] ,self::$_options['postprocessor'] ,self::$_options['bubbleCssImports'] ))); } /** * Bubble CSS @imports to the top or prepend a warning if an * @import is detected not at the top. */ protected static function _handleCssImports($css) { if (self::$_options['bubbleCssImports']) { // bubble CSS imports preg_match_all('/@import.*?;/', $css, $imports); $css = implode('', $imports[0]) . preg_replace('/@import.*?;/', '', $css); } else if ('' !== self::$importWarning) { // remove comments so we don't mistake { in a comment as a block $noCommentCss = preg_replace('@/\\*[\\s\\S]*?\\*/@', '', $css); $lastImportPos = strrpos($noCommentCss, '@import'); $firstBlockPos = strpos($noCommentCss, '{'); if (false !== $lastImportPos && false !== $firstBlockPos && $firstBlockPos < $lastImportPos ) { // { appears before @import : prepend warning $css = self::$importWarning . $css; } } return $css; } } ```
8 Mar 2010, 6:21 PM
#133
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

ok thanks alot
not too sure what the minify script is - but the last thing that I added was the jquery lightbox and zoom - yes there was some sort of extra javascript sql patch which shows up under admin>configurations>css/java loader in the backend of the store.

Not too sure what this does but i am presuming its got to do with this.

I dont think there is a file as such that I can edit. Do you know a work around?

thanks

Again, sorry I'm not familiar with this at all. You might want to post something in the support thread for that mod.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

8 Mar 2010, 7:10 PM
#134
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

abs007:

ok thanks alot
not too sure what the minify script is - but the last thing that I added was the jquery lightbox and zoom - yes there was some sort of extra javascript sql patch which shows up under admin>configurations>css/java loader in the backend of the store.

Not too sure what this does but i am presuming its got to do with this.

I dont think there is a file as such that I can edit. Do you know a work around?

Yup minify came with jquery zoom. the contents reads as follows```html

<?php /** * Class Minify * @package Minify */ /** * Minify_Source */ require_once 'Minify/Source.php'; /** * Minify - Combines, minifies, and caches JavaScript and CSS files on demand. * * See README for usage instructions (for now). * * This library was inspired by {@link mailto:[email protected] jscsscomp by Maxim Martynyuk} * and by the article {@link http://www.hunlock.com/blogs/Supercharged_Javascript "Supercharged JavaScript" by Patrick Hunlock}. * * Requires PHP 5.1.0. * Tested on PHP 5.1.6. * * @package Minify * @author Ryan Grove <[email protected]> * @author Stephen Clay <[email protected]> * @copyright 2008 Ryan Grove, Stephen Clay. All rights reserved. * @license http://opensource.org/licenses/bsd-license.php New BSD License * @link http://code.google.com/p/minify/ */ class Minify { const VERSION = '2.1.3'; const TYPE_CSS = 'text/css'; const TYPE_HTML = 'text/html'; // there is some debate over the ideal JS Content-Type, but this is the // Apache default and what Yahoo! uses.. const TYPE_JS = 'application/x-javascript'; /** * How many hours behind are the file modification times of uploaded files? * * If you upload files from Windows to a non-Windows server, Windows may report * incorrect mtimes for the files. Immediately after modifying and uploading a * file, use the touch command to update the mtime on the server. If the mtime * jumps ahead by a number of hours, set this variable to that number. If the mtime * moves back, this should not be needed. * * @var int $uploaderHoursBehind */ public static $uploaderHoursBehind = 0; /** * If this string is not empty AND the serve() option 'bubbleCssImports' is * NOT set, then serve() will check CSS files for @import declarations that * appear too late in the combined stylesheet. If found, serve() will prepend * the output with this warning. * * @var string $importWarning */ public static $importWarning = "/* See http://code.google.com/p/minify/wiki/CommonProblems#@imports_can_appear_in_invalid_locations_in_combined_CSS_files */\n"; /** * Specify a cache object (with identical interface as Minify_Cache_File) or * a path to use with Minify_Cache_File. * * If not called, Minify will not use a cache and, for each 200 response, will * need to recombine files, minify and encode the output. * * @param mixed $cache object with identical interface as Minify_Cache_File or * a directory path, or null to disable caching. (default = '') * * @param bool $fileLocking (default = true) This only applies if the first * parameter is a string. * * @return null */ public static function setCache($cache = '', $fileLocking = true) { if (is_string($cache)) { require_once 'Minify/Cache/File.php'; self::$_cache = new Minify_Cache_File($cache, $fileLocking); } else { self::$_cache = $cache; } } /** * Serve a request for a minified file. * * Here are the available options and defaults in the base controller: * * 'isPublic' : send "public" instead of "private" in Cache-Control * headers, allowing shared caches to cache the output. (default true) * * 'quiet' : set to true to have serve() return an array rather than sending * any headers/output (default false) * * 'encodeOutput' : set to false to disable content encoding, and not send * the Vary header (default true) * * 'encodeMethod' : generally you should let this be determined by * HTTP_Encoder (leave null), but you can force a particular encoding * to be returned, by setting this to 'gzip' or '' (no encoding) * * 'encodeLevel' : level of encoding compression (0 to 9, default 9) * * 'contentTypeCharset' : appended to the Content-Type header sent. Set to a falsey * value to remove. (default 'utf-8') * * 'maxAge' : set this to the number of seconds the client should use its cache * before revalidating with the server. This sets Cache-Control: max-age and the * Expires header. Unlike the old 'setExpires' setting, this setting will NOT * prevent conditional GETs. Note this has nothing to do with server-side caching. * * 'rewriteCssUris' : If true, serve() will automatically set the 'currentDir' * minifier option to enable URI rewriting in CSS files (default true) * * 'bubbleCssImports' : If true, all @import declarations in combined CSS * files will be move to the top. Note this may alter effective CSS values * due to a change in order. (default false) * * 'debug' : set to true to minify all sources with the 'Lines' controller, which * eases the debugging of combined files. This also prevents 304 responses. * @see Minify_Lines::minify() * * 'minifiers' : to override Minify's default choice of minifier function for * a particular content-type, specify your callback under the key of the * content-type: * <code> * // call customCssMinifier($css) for all CSS minification * $options['minifiers'][Minify::TYPE_CSS] = 'customCssMinifier'; * * // don't minify Javascript at all * $options['minifiers'][Minify::TYPE_JS] = ''; * </code> * * 'minifierOptions' : to send options to the minifier function, specify your options * under the key of the content-type. E.g. To send the CSS minifier an option: * <code> * // give CSS minifier array('optionName' => 'optionValue') as 2nd argument * $options['minifierOptions'][Minify::TYPE_CSS]['optionName'] = 'optionValue'; * </code> * * 'contentType' : (optional) this is only needed if your file extension is not * js/css/html. The given content-type will be sent regardless of source file * extension, so this should not be used in a Groups config with other * Javascript/CSS files. * * Any controller options are documented in that controller's setupSources() method. * * @param mixed instance of subclass of Minify_Controller_Base or string name of * controller. E.g. 'Files' * * @param array $options controller/serve options * * @return mixed null, or, if the 'quiet' option is set to true, an array * with keys "success" (bool), "statusCode" (int), "content" (string), and * "headers" (array). */ public static function serve($controller, $options = array()) { if (is_string($controller)) { // make $controller into object $class = 'Minify_Controller_' . $controller; if (! class_exists($class, false)) { require_once "Minify/Controller/" . str_replace('_', '/', $controller) . ".php"; } $controller = new $class(); } // set up controller sources and mix remaining options with // controller defaults $options = $controller->setupSources($options); $options = $controller->analyzeSources($options); self::$_options = $controller->mixInDefaultOptions($options); // check request validity if (! $controller->sources) { // invalid request! if (! self::$_options['quiet']) { header(self::$_options['badRequestHeader']); echo self::$_options['badRequestHeader']; return; } else { list(,$statusCode) = explode(' ', self::$_options['badRequestHeader']); return array( 'success' => false ,'statusCode' => (int)$statusCode ,'content' => '' ,'headers' => array() ); } } self::$_controller = $controller; if (self::$_options['debug']) { self::_setupDebug($controller->sources); self::$_options['maxAge'] = 0; } // determine encoding if (self::$_options['encodeOutput']) { if (self::$_options['encodeMethod'] !== null) { // controller specifically requested this $contentEncoding = self::$_options['encodeMethod']; } else { // sniff request header require_once 'HTTP/Encoder.php'; // depending on what the client accepts, $contentEncoding may be // 'x-gzip' while our internal encodeMethod is 'gzip'. Calling // getAcceptedEncoding(false, false) leaves out compress and deflate as options. list(self::$_options['encodeMethod'], $contentEncoding) = HTTP_Encoder::getAcceptedEncoding(false, false); } } else { self::$_options['encodeMethod'] = ''; // identity (no encoding) } // check client cache require_once 'HTTP/ConditionalGet.php'; $cgOptions = array( 'lastModifiedTime' => self::$_options['lastModifiedTime'] ,'isPublic' => self::$_options['isPublic'] ,'encoding' => self::$_options['encodeMethod'] ); if (self::$_options['maxAge'] > 0) { $cgOptions['maxAge'] = self::$_options['maxAge']; } $cg = new HTTP_ConditionalGet($cgOptions); if ($cg->cacheIsValid) { // client's cache is valid if (! self::$_options['quiet']) { $cg->sendHeaders(); return; } else { return array( 'success' => true ,'statusCode' => 304 ,'content' => '' ,'headers' => $cg->getHeaders() ); } } else { // client will need output $headers = $cg->getHeaders(); unset($cg); } if (self::$_options['contentType'] === self::TYPE_CSS && self::$_options['rewriteCssUris']) { reset($controller->sources); while (list($key, $source) = each($controller->sources)) { if ($source->filepath && !isset($source->minifyOptions['currentDir']) && !isset($source->minifyOptions['prependRelativePath']) ) { $source->minifyOptions['currentDir'] = dirname($source->filepath); } } } // check server cache if (null !== self::$_cache) { // using cache // the goal is to use only the cache methods to sniff the length and // output the content, as they do not require ever loading the file into // memory. $cacheId = 'minify_' . self::_getCacheId(); $fullCacheId = (self::$_options['encodeMethod']) ? $cacheId . '.gz' : $cacheId; // check cache for valid entry $cacheIsReady = self::$_cache->isValid($fullCacheId, self::$_options['lastModifiedTime']); if ($cacheIsReady) { $cacheContentLength = self::$_cache->getSize($fullCacheId); } else { // generate & cache content $content = self::_combineMinify(); self::$_cache->store($cacheId, $content); if (function_exists('gzencode')) { self::$_cache->store($cacheId . '.gz', gzencode($content, self::$_options['encodeLevel'])); } } } else { // no cache $cacheIsReady = false; $content = self::_combineMinify(); } if (! $cacheIsReady && self::$_options['encodeMethod']) { // still need to encode $content = gzencode($content, self::$_options['encodeLevel']); } // add headers $headers['Content-Length'] = $cacheIsReady ? $cacheContentLength : strlen($content); $headers['Content-Type'] = self::$_options['contentTypeCharset'] ? self::$_options['contentType'] . '; charset=' . self::$_options['contentTypeCharset'] : self::$_options['contentType']; if (self::$_options['encodeMethod'] !== '') { $headers['Content-Encoding'] = $contentEncoding; } if (self::$_options['encodeOutput']) { $headers['Vary'] = 'Accept-Encoding'; } if (! self::$_options['quiet']) { // output headers & content foreach ($headers as $name => $val) { header($name . ': ' . $val); } if ($cacheIsReady) { self::$_cache->display($fullCacheId); } else { echo $content; } } else { return array( 'success' => true ,'statusCode' => 200 ,'content' => $cacheIsReady ? self::$_cache->fetch($fullCacheId) : $content ,'headers' => $headers ); } } /** * Return combined minified content for a set of sources * * No internal caching will be used and the content will not be HTTP encoded. * * @param array $sources array of filepaths and/or Minify_Source objects * * @param array $options (optional) array of options for serve. By default * these are already set: quiet = true, encodeMethod = '', lastModifiedTime = 0. * * @return string */ public static function combine($sources, $options = array()) { $cache = self::$_cache; self::$_cache = null; $options = array_merge(array( 'files' => (array)$sources ,'quiet' => true ,'encodeMethod' => '' ,'lastModifiedTime' => 0 ), $options); $out = self::serve('Files', $options); self::$_cache = $cache; return $out['content']; } /** * On IIS, create $_SERVER['DOCUMENT_ROOT'] * * @param bool $unsetPathInfo (default false) if true, $_SERVER['PATH_INFO'] * will be unset (it is inconsistent with Apache's setting) * * @return null */ public static function setDocRoot($unsetPathInfo = false) { if (isset($_SERVER['SERVER_SOFTWARE']) && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/') ) { $_SERVER['DOCUMENT_ROOT'] = rtrim(substr( $_SERVER['PATH_TRANSLATED'] ,0 ,strlen($_SERVER['PATH_TRANSLATED']) - strlen($_SERVER['SCRIPT_NAME']) ), '\\'); if ($unsetPathInfo) { unset($_SERVER['PATH_INFO']); } require_once 'Minify/Logger.php'; Minify_Logger::log("setDocRoot() set DOCUMENT_ROOT to \"{$_SERVER['DOCUMENT_ROOT']}\""); } } /** * @var mixed Minify_Cache_* object or null (i.e. no server cache is used) */ private static $_cache = null; /** * @var Minify_Controller active controller for current request */ protected static $_controller = null; /** * @var array options for current request */ protected static $_options = null; /** * Set up sources to use Minify_Lines * * @param array $sources Minify_Source instances * * @return null */ protected static function _setupDebug($sources) { foreach ($sources as $source) { $source->minifier = array('Minify_Lines', 'minify'); $id = $source->getId(); $source->minifyOptions = array( 'id' => (is_file($id) ? basename($id) : $id) ); } } /** * Combines sources and minifies the result. * * @return string */ protected static function _combineMinify() { $type = self::$_options['contentType']; // ease readability // when combining scripts, make sure all statements separated and // trailing single line comment is terminated $implodeSeparator = ($type === self::TYPE_JS) ? "\n;" : ''; // allow the user to pass a particular array of options to each // minifier (designated by type). source objects may still override // these $defaultOptions = isset(self::$_options['minifierOptions'][$type]) ? self::$_options['minifierOptions'][$type] : array(); // if minifier not set, default is no minification. source objects // may still override this $defaultMinifier = isset(self::$_options['minifiers'][$type]) ? self::$_options['minifiers'][$type] : false; if (Minify_Source::haveNoMinifyPrefs(self::$_controller->sources)) { // all source have same options/minifier, better performance // to combine, then minify once foreach (self::$_controller->sources as $source) { $pieces[] = $source->getContent(); } $content = implode($implodeSeparator, $pieces); if ($defaultMinifier) { self::$_controller->loadMinifier($defaultMinifier); $content = call_user_func($defaultMinifier, $content, $defaultOptions); } } else { // minify each source with its own options and minifier, then combine foreach (self::$_controller->sources as $source) { // allow the source to override our minifier and options $minifier = (null !== $source->minifier) ? $source->minifier : $defaultMinifier; $options = (null !== $source->minifyOptions) ? array_merge($defaultOptions, $source->minifyOptions) : $defaultOptions; if ($minifier) { self::$_controller->loadMinifier($minifier); // get source content and minify it $pieces[] = call_user_func($minifier, $source->getContent(), $options); } else { $pieces[] = $source->getContent(); } } $content = implode($implodeSeparator, $pieces); } if ($type === self::TYPE_CSS && false !== strpos($content, '@import')) { $content = self::_handleCssImports($content); } // do any post-processing (esp. for editing build URIs) if (self::$_options['postprocessorRequire']) { require_once self::$_options['postprocessorRequire']; } if (self::$_options['postprocessor']) { $content = call_user_func(self::$_options['postprocessor'], $content, $type); } return $content; } /** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @return string */ protected static function _getCacheId() { return md5(serialize(array( Minify_Source::getDigest(self::$_controller->sources) ,self::$_options['minifiers'] ,self::$_options['minifierOptions'] ,self::$_options['postprocessor'] ,self::$_options['bubbleCssImports'] ))); } /** * Bubble CSS @imports to the top or prepend a warning if an * @import is detected not at the top. */ protected static function _handleCssImports($css) { if (self::$_options['bubbleCssImports']) { // bubble CSS imports preg_match_all('/@import.*?;/', $css, $imports); $css = implode('', $imports[0]) . preg_replace('/@import.*?;/', '', $css); } else if ('' !== self::$importWarning) { // remove comments so we don't mistake { in a comment as a block $noCommentCss = preg_replace('@/\\*[\\s\\S]*?\\*/@', '', $css); $lastImportPos = strrpos($noCommentCss, '@import'); $firstBlockPos = strpos($noCommentCss, '{'); if (false !== $lastImportPos && false !== $firstBlockPos && $firstBlockPos < $lastImportPos ) { // { appears before @import : prepend warning $css = self::$importWarning . $css; } } return $css; } } ``` Post something in the jquery zoom support thread.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

11 Apr 2010, 6:27 PM
#135
ltaylorbrown avatar

ltaylorbrown

New Zenner

Join Date:
Jun 2005
Posts:
39
Plugin Contributions:
0

Re: jScroller Sidebox Package Support Thread

Hi..just installed the jscroller sidebox for my 'best sellers' sidebox and its working great. My only problem is I lost my image header for the sidebox. (see here: http://www.oopsie-daisy.net/index.php) I went through the same process as i originally did to change the text to images and it didnt fix it. I also selected to put the text back in place in the english.php file..but the text wont even show up.

Thanks in advance for any help :)

11 Apr 2010, 6:43 PM
#136
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

LTaylorBrown:

Hi..just installed the jscroller sidebox for my 'best sellers' sidebox and its working great. My only problem is I lost my image header for the sidebox. (see here: http://www.oopsie-daisy.net/index.php) I went through the same process as i originally did to change the text to images and it didnt fix it. I also selected to put the text back in place in the english.php file..but the text wont even show up.

Thanks in advance for any help :)

Which sidebox?

The "new" sidebox seems to have your header image.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

11 Apr 2010, 7:12 PM
#137
ltaylorbrown avatar

ltaylorbrown

New Zenner

Join Date:
Jun 2005
Posts:
39
Plugin Contributions:
0

Re: jScroller Sidebox Package Support Thread

The "best sellers" box on the right.

11 Apr 2010, 7:24 PM
#138
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: jScroller Sidebox Package Support Thread

LTaylorBrown:

The "best sellers" box on the right.

None of the sideboxes in the package changes/modifies the heading of the box.

The bestseller sidebox uses the normal BOX_HEADING_BESTSELLERS definition statement.

make sure you've edited this definition to meet your requirements.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

11 Apr 2010, 7:37 PM
#139
ltaylorbrown avatar

ltaylorbrown

New Zenner

Join Date:
Jun 2005
Posts:
39
Plugin Contributions:
0

Re: jScroller Sidebox Package Support Thread

The header was there when I had a static box...no scroller. The box at the top on the right with no header is the jscroller 'best sellers' one. sigh Guess i'll just keep tinkering with it.

19 Apr 2010, 5:21 PM
#140
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,021
Plugin Contributions:
2

Re: jScroller Sidebox Package Support Thread

Is it possible to change the flow direction of the scroller, where the image scrolls downwards rather than upwards.

TIA