-
AuthorPosts
-
October 31, 2008 at 2:55 am #134944
If i active a module (JA Bulletin or otherwise) in the topsl2 position the site stops displaying anything at all, but returns to normal once the module is disabled
content is just test stuff atm, and although not a quickstart install, i have followed and checked settings vs the guide
any advice?
jimmer Friendjimmer
- Join date:
- December 2006
- Posts:
- 260
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 43
- Thanked:
- 11 times in 1 posts
October 31, 2008 at 3:36 am #277581<em>@bluhoney 88746 wrote:</em><blockquote>If i active a module (JA Bulletin or otherwise) in the topsl2 position the site stops displaying anything at all, but returns to normal once the module is disabled
content is just test stuff atm, and although not a quickstart install, i have followed and checked settings vs the guide
any advice?</blockquote>
I have been having issues with topsl1 and topsl2. I notice in order for topsl1 to work you need to have topsl2 published as well.
Not sure what is happening when you publish topsl2 and everything stops displaying?
1 user says Thank You to jimmer for this useful post
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
October 31, 2008 at 7:16 am #277604Hi all,
please read here :http://www.joomlart.com/forums/topic/width-of-template-2/October 31, 2008 at 11:41 am #277646I’m aware of this solution, however it does not cover the problem i’m experiencing:
WIth topsl1 ON, topsl2 OFF, neither box displays, this is expected. The rest of the site does display.
With topsl1 ON and topsl2 ON, which should make both modules appear, no information displays on the site whatsoever, I am presented with a white screen, which remains until i unpublish one of the topsl modules.
Seems to be connected to image resizing and thumbnails, as when these options are turned off (in both slideshow and bulletin) the modules appear
October 31, 2008 at 12:45 pm #277652This is definately connected to resizing images, when the option to auto-resize images in JA Slideshow is enabled, the front page no longer displays.. when turned off the slideshow and bulletin both work fine.
Where would I place the thumbnail images if I wished to manually resize and upload these to JA Slideshow instead of allowing it to automatically create these?
For some info, i have GD library installed, all resized folders have been created manually, and chmod to 777
October 31, 2008 at 1:19 pm #277659When i switch on auto image-resize i recieve the following error in firebug:
Class is not defined
ja.slideshow.js()()ja.slideshow.js (line 4)
[Break on this error] JaSlideshowClass = new Class({Similar issue to this thread it appears: http://www.joomlart.com/forums/topic/slideshow-not-working-help-solved-thanks-jimg/
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$folder = $params->get( 'folder', 'images/stories/fruit' );
$mootools = $params->get('mootools',1);
$swidth = $params->get( 'swidth', 430 );
$sheight = $params->get( 'sheight', 200 );
$altimage = $params->get( 'altimage', 'JA Slideshow - http://www.joomlart.com' );
$orderby = $params->get( 'sortCriteria', 0);
$sort = $params->get( 'sort', '1');
$setimagearray = $params->get( 'setimagearray', '');
$startwith = $params->get( 'startwith', 0);
$autoresize = $params->get( 'autoresize', 0);
$timedisplay = $params->get( 'timedisplay', 9000 );
$timeanimation = $params->get( 'timeanimation', 2000);
$animation = $params->get( 'animation', 'combo');
$ppercent = $params->get( 'ppercent', 10);
$zpercent = $params->get( 'zpercent', 10);
$effect = $params->get( 'effect', 'bounceOut');
$showCaption = $params->get( 'showCaption', 1 );
$showmode = $params->get( 'showmode', 0 );
$navigation = $params->get('navigation',"");
$showDescription = $params->get('showDescription',0);
$descriptions = $params->get('description',"");
$play = $params->get('play',"play");
if($showDescription){
global $iso_client_lang;
$descriptionArr = preg_split('/<lang=([^>]*)>/', $descriptions , -1 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$description = '';
if(count($descriptionArr) > 1){
for($i=0;$i<count($descriptionArr);$i=$i+2){
if($descriptionArr[$i] == $iso_client_lang){
$description = $descriptionArr[($i+1)];
break;
}
}
if(!$description){
$description = $descriptionArr[1];
}
}
else{
$description = $descriptionArr[0];
}
$description = str_replace("<br />", "n", $description);
$description = explode("n",$description);$descriptionArray = array();
foreach($description as $desc){
//~ $list = explode(":", $desc , 2);
//~ $descriptionArray[$list[0]] = $list[1];
if ($desc) {
$list = split(":", $desc, 2);
$list[1] = (count($list) > 1) ? split("&", $list[1]) : array();
$temp = array();
for ($i = 0; $i < count($list[1]); ++$i) {
$l = split("=", $list[1][$i]);
$temp)] = trim($l[1]);
}
$descriptionArray[$list[0]] = $temp;
}
}
}
$folder = checkURL($folder);
if(!$folder){ echo "This folder doesn't exist."; }
else{
if (trim($setimagearray) != "") $images = explode(",", $setimagearray);
else $images = getFileInDir($folder, $orderby, $sort );
if (count($images) > 0) {
$imgcount = 0;
$firstImage = '';
$transDetails = '';
$captionDetails = '';
$imageArray = array();
$captionArray = array();
$listDescription = "";
foreach($images as $img) {
if ($imgcount++ == 0) {
if ($startwith)
$firstImage = $folder . $startwith;
else
$firstImage = $folder . $img;
}
$imageArray[] = "'$img'";
if($showDescription) {
$captionsArray[] = (isset($descriptionArray[$img]) && isset($descriptionArray[$img]['caption'])) ? str_replace("'", "'", $descriptionArray[$img]['caption']) :'';
$urlsArray[] = (isset($descriptionArray[$img]) && isset($descriptionArray[$img]['url'])) ? $descriptionArray[$img]['url'] :'';
}
}
if ($showDescription) {
$listCaption = " captions: ['" . implode("','", $captionsArray) . "'],";
$listURL = " urls: ['" . implode("','", $urlsArray) . "'],";
}
if ($mootools) { echo '<script src="'.JURI::base().'modules/mod_jaslideshow/ja_slideshow/mootools.v1.1.js" type="text/javascript"></script>' . "n"; }
if (trim($animation) == 'push' or trim($animation == 'wipe')) $transDetails = "transition: Fx.Transitions.$effect";
else $transDetails = "transition: Fx.Transitions.sineInOut";
echo '<script src="'.JURI::base().'modules/mod_jaslideshow/ja_slideshow/ja-slideshow.js" type="text/javascript"></script>' . "n";
$linktag = '<link href="'.JURI::base().'modules/mod_jaslideshow/ja_slideshow/ja-slideshow.css" rel="stylesheet" type="text/css" />';
JHTML::stylesheet('ja-slideshow.css', JURI::base().'modules/mod_jaslideshow/ja_slideshow/');$buffer = ob_get_contents();
$pos = strpos ($buffer, '</head>');
if (!strpos ($buffer, "ja-slideshow.css") && $pos) {
$buffer = substr ($buffer, 0, $pos) . "n$linktagn". substr($buffer, $pos);
ob_clean();
echo $buffer;
}
echo '<div id="ja-slideshow-wrap">' . "n";
echo '<div id="ja-slideshow-case" class="ja-slideshow-case">' . "n";
echo '<img src="' . $firstImage . '" alt="' . $altimage . '" title="' .$altimage. '" />' . "n";
echo '</div>' . "n";
echo '<div id="ja-slidebar" class="ja-slidebar">' . "n";
echo '</div>' . "n";
echo '</div>' . "n";?>
<script type="text/javascript">
JaSlideshow = new JaSlideshowClass({
siteurl: '<?php echo JURI::base(); ?>',
type: '<?php echo $animation; ?>',
pan: '<?php echo $ppercent; ?>',
zoom: '<?php echo $zpercent; ?>',
width: <?php echo $swidth; ?>,
height: <?php echo $sheight; ?>,
url: '<?php echo $folder; ?>',
images: [<?php echo implode(",", $imageArray); ?>],
<?php if (isset($listCaption)) echo $listCaption; ?>
<?php if (isset($listURL)) echo $listURL; ?>
duration: [<?php echo $timeanimation*1000; ?>, <?php echo $timedisplay*1000; ?>],
<?php echo $transDetails; ?> ,
navigation: '<?php echo $navigation; ?>',
resize: <?php echo $autoresize; ?>,
classes: ['prev', 'next', 'active'],
play : <?php echo "'$play'"; ?>,
thumbnailre: [/./, 't.']
});
</script>
<?php
}
}
function getFileInDir($folder, $orderby, $sort){
$imagePath = JPATH_SITE ."/".$folder;
$imgFiles = JFolder::files( $imagePath );
$folderPath = $folder .'/';
$imageFile = array();
$i = 0;
foreach ($imgFiles as $file){
$i_f = $imagePath .'/'. $file;
if ( eregi( "bmp|gif|jpg|png|jpeg", $file ) && is_file( $i_f ) ) {
$imageFile[$i][0] = $file;
$imageFile[$i][1] = filemtime($i_f) ;
$i++;
}
}
$images = sortImage($imageFile, $orderby , $sort);
return $images;
}
function sortImage($image, $orderby , $sort){
$sortObj = array();
$imageName = array();
if($orderby == 1){
for($i=0;$i<count($image);$i++){
$sortObj[$i] = $image[$i][1];
$imageName[$i] = $image[$i][0];
}
}
else{
for($i=0;$i<count($image);$i++){
$sortObj[$i] = $image[$i][0];
}
$imageName = $sortObj;
}
if($sort == 1) array_multisort($sortObj, SORT_ASC, $imageName);
elseif($sort == 2) array_multisort($sortObj, SORT_DESC, $imageName);
else shuffle($imageName);
return $imageName;
}
function checkURL($url){
if(is_dir($url)){ $url = (substr($url,-1,1) == "/") ? $url : $url."/"; return $url; }
else { return false; }
}
?>
except that if i use the fix above, the thumbnails and resizing is diabled indefinately, and so this does not actually fix the issue, has the same effect as turning off image resizing, however the errors are the same
my mod_jasideshow.php:
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$folder = $params->get( 'folder', 'images/stories/fruit' );
$mootools = $params->get('mootools',1);
$swidth = $params->get( 'swidth', 430 );
$sheight = $params->get( 'sheight', 200 );
$altimage = $params->get( 'altimage', 'JA Slideshow - http://www.joomlart.com' );
$orderby = $params->get( 'orderby', 0);
$sort = $params->get( 'sort', '1');
$setimagearray = $params->get( 'setimagearray', '');
$startwith = $params->get( 'startwith', 0);
$autoresize = $params->get( 'autoresize', 0);
$timedisplay = $params->get( 'timedisplay', 9000 );
$timeanimation = $params->get( 'timeanimation', 2000);
$animation = $params->get( 'animation', 'combo');
$ppercent = $params->get( 'ppercent', 10);
$zpercent = $params->get( 'zpercent', 10);
$effect = $params->get( 'effect', 'bounceOut');
$showCaption = $params->get( 'showCaption', 1 );
$showmode = $params->get( 'showmode', 0 );
$navigation = $params->get('navigation',"");
$showDescription = $params->get('showDescription',0);
$descriptions_effect = $params->get('description_effect',"fade");
$descriptions = $params->get('description',"");
$play = $params->get('play',"1");
$twidth = $params->get( 'twidth', 100 );
$theight = $params->get( 'theight', 100 );
$switch_action = $params->get( 'switch_action', 'click' );
if($showDescription){
global $iso_client_lang;
$descriptionArr = preg_split('/<lang=([^>]*)>/', $descriptions , -1 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$description = '';
if(count($descriptionArr) > 1){
for($i=0;$i<count($descriptionArr);$i=$i+2){
if($descriptionArr[$i] == $iso_client_lang){
$description = $descriptionArr[($i+1)];
break;
}
}
if(!$description){
$description = $descriptionArr[1];
}
}
else{
$description = $descriptionArr[0];
}function parseDescOld ($description) {
$description = str_replace("<br />", "n", $description);
$description = explode("n",$description);
$descriptionArray = array();
foreach($description as $desc){
if ($desc) {
$list = split(":", $desc, 2);
$list[1] = (count($list) > 1) ? split("&", $list[1]) : array();
$temp = array();
for ($i = 0; $i < count($list[1]); ++$i) {
$l = split("=", $list[1][$i]);
$temp)] = trim($l[1]);
}
$descriptionArray[$list[0]] = $temp;
}
}
return $descriptionArray;
}function parseDescNew($description) {
$regex = '#]*)]([^[]*)#m';preg_match_all ($regex, $description, $matches, PREG_SET_ORDER);
$descriptionArray = array();
foreach ($matches as $match) {
$params = parseParams($match[1]);
if (is_array($params)) {
$img = isset($params['img'])?trim($params['img']):'';
if (!$img) continue;
$url = isset($params['url'])?trim($params['url']):'';
$descriptionArray[$img] = array('url'=>$url,'caption'=>str_replace("n","<br />",trim($match[2])));
}
}
return $descriptionArray;
}function parseParams($params) {
$params = html_entity_decode($params, ENT_QUOTES);
$regex = "/s*([^=s]+)s*=s*('([^']*)'|"([^"]*)"|([^s]*))/";
preg_match_all($regex, $params, $matches);$paramarray = null;
if(count($matches)){
$paramarray = array();
for ($i=0;$i<count($matches[1]);$i++){
$key = $matches[1][$i];
$val = $matches[3][$i]?$matches[3][$i]:($matches[4][$i]?$matches[4][$i]:$matches[5][$i]);
$paramarray[$key] = $val;
}
}
return $paramarray;
}//Parse description. Description in format: Description goes here
$descriptionArray = parseDescNew ($description);
if (!count($descriptionArray)) $descriptionArray = parseDescOld ($description);
}
$folder = checkURL($folder);
if(!$folder){ echo "This folder doesn't exsits."; }
else{
if (trim($setimagearray) != "") $images = explode(",", $setimagearray);
else $images = getFileInDir($folder, $orderby, $sort );
if (count($images) > 0) {
$imgcount = 0;
$firstImage = '';
$transDetails = '';
$captionDetails = '';
$imageArray = array();
$captionArray = array();
$listDescription = "";
foreach($images as $img) {if ($imgcount++ == 0) {
if ($startwith)
$firstImage = $folder . $startwith;
else
$firstImage = $folder . $img;
}
$imageArray[] = "$folder"."$img";
if($showDescription) {
$captionsArray[] = (isset($descriptionArray[$img]) && isset($descriptionArray[$img]['caption'])) ? str_replace("'", "'", $descriptionArray[$img]['caption']) :'';
$urlsArray[] = (isset($descriptionArray[$img]) && isset($descriptionArray[$img]['url'])) ? $descriptionArray[$img]['url'] :'';
}
}if ($showDescription) {
$listCaption = " captions: ['" . implode("','", $captionsArray) . "'],";
$listURL = " urls: ['" . implode("','", $urlsArray) . "'],";
}JHTML::_('behavior.mootools');
echo '<script src="'.JURI::base().'modules/mod_jaslideshow/ja_slideshow/ja.slideshow.js" type="text/javascript"></script>' . "n";if (trim($animation) == 'push' or trim($animation == 'wipe')) $transDetails = "transition: Fx.Transitions.$effect";
else $transDetails = "transition: Fx.Transitions.sineInOut";
$filename = JPATH_SITE.DS.'templates/'.$mainframe->getTemplate().'/css/ja.slideshow.css';
$css_path = JURI::base().'templates/'.$mainframe->getTemplate().'/css/';
if(!file_exists($filename)){
$css_path = JURI::base().'modules/mod_jaslideshow/ja_slideshow/';
}
if (function_exists('imagecreatetruecolor')) {
$thumbArray = buildThumbnail ($imageArray, $twidth, $theight);
if ($autoresize) {
for ($i=0; $i<count($imageArray); $i++){
if ($image1 = processImage ( $imageArray[$i], $swidth, $sheight )) {
$imageArray[$i] = "$image1";
}
}
}
} else {
$thumbArray = $imageArray;
}
if($autoresize && $image1 = processImage( $firstImage, $swidth, $sheight ) ) {
$firstImage = $image1;
}JHTML::stylesheet('ja.slideshow.css', $css_path);
?>
<div id="ja-slideshowwrap">
<div id="ja-slideshow-case" class="ja-slideshow-case">
<img src="<?php echo JURI::base().$firstImage;?>" alt="<?php echo $altimage;?>" title="<?php echo $altimage;?>" />
</div>
<div id="ja-slidebar" class="ja-slidebar">
</div>
</div>
<script type="text/javascript">
//<!,
thumbnails: ['<?php echo implode("','", $thumbArray); ?>'],
<?php if (isset($listCaption)) echo str_replace('/','\/',$listCaption); ?>
<?php if (isset($listCaption)) echo "caption_effect: '$descriptions_effect',"; ?>
<?php if (isset($listURL)) echo $listURL; ?>
duration: [<?php echo $timeanimation*1000; ?>, <?php echo $timedisplay*1000; ?>],
<?php echo $transDetails; ?> ,
navigation: '<?php echo $navigation; ?>',
classes: ['prev', 'next', 'active'],
play : <?php echo "'$play'"; ?>,
mouse_action: '<?php echo $switch_action;?>'
});
//]]>
</script><?php
}
}
function processImage ( &$img, $width, $height, $keepratio=1) {
if(!$img) return;
if (substr($img, 0, 4)!='http') {
$img = $img;
}
$img = str_replace(JURI::base(),'',$img);
$img = str_replace("'",'',$img);
$img = rawurldecode($img);
$imagesurl = (file_exists(JPATH_SITE .'/'.$img)) ? jaResize($img,$width,$height, $keepratio) : '' ;
return $imagesurl;
}
function jaResize($image,$max_width,$max_height, $keepratio=1){
$path = JPATH_SITE;
$sizeThumb = getimagesize(JPATH_SITE.'/'.$image);
$width = $sizeThumb[0];
$height = $sizeThumb[1];
if(!$max_width && !$max_height) {
$max_width = $width;
$max_height = $height;
}else{
if(!$max_width) $max_width = 1000;
if(!$max_height) $max_height = 1000;
}
if ($keepratio) {
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if (($width <= $max_width) && ($height <= $max_height) ) {
$tn_width = $width;
$tn_height = $height;
} else if (($x_ratio * $height) < $max_height) {
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
} else {
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
}else{
$tn_width = $max_width;
$tn_height = $max_height;
}
// read image
$ext = strtolower(substr(strrchr($image, '.'), 1)); // get the file extension
$rzname = strtolower(substr($image, 0, strpos($image,'.')))."_{$tn_width}_{$tn_height}.{$ext}"; // get the file extension
$resized = $path.'/images/resized/'.$rzname;
if(file_exists($resized)){
$smallImg = getimagesize($resized);
if (($smallImg[0] <= $tn_width && $smallImg[1] == $tn_height) ||
($smallImg[1] <= $tn_height && $smallImg[0] == $tn_width)) {
return "images/resized/".$rzname;
}
}if(!file_exists($path.'/images/resized/') && !mkdir($path.'/images/resized/',0755)) return '';
$folders = explode('/',$image);
$tmppath = $path.'/images/resized/';
for($i=0;$i < count($folders)-1; $i++){
if(!file_exists($tmppath.$folders[$i]) && !mkdir($tmppath.$folders[$i],0755)) return '';
$tmppath = $tmppath.$folders[$i].'/';
}
switch ($ext) {
case 'jpg': // jpg
$src = imagecreatefromjpeg(JPATH_SITE.'/'.$image);
break;
case 'png': // png
$src = imagecreatefrompng(JPATH_SITE.'/'.$image);
break;
case 'gif': // gif
$src = imagecreatefromgif(JPATH_SITE.'/'.$image);
break;
default:
}
$dst = imagecreatetruecolor($tn_width,$tn_height);
//imageantialias ($dst, true);
if (function_exists('imageantialias')) imageantialias ($dst, true);
imagecopyresampled ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height);
imagejpeg($dst, $resized, 90); // write the thumbnail to cache as well...return "images/resized/".$rzname;
}
function getFileInDir($folder, $orderby, $sort){
$imagePath = JPATH_SITE ."/".$folder;
$imgFiles = JFolder::files( $imagePath );
$folderPath = $folder .'/';
$imageFile = array();
$i = 0;
foreach ($imgFiles as $file){
$i_f = $imagePath .'/'. $file;
if ( eregi( "bmp|gif|jpg|png|jpeg", $file ) && is_file( $i_f ) ) {
$imageFile[$i][0] = $file;
$imageFile[$i][1] = filemtime($i_f) ;
$i++;
}
}
$images = sortImage($imageFile, $orderby , $sort);
return $images;
}
function sortImage($image, $orderby , $sort){
$sortObj = array();
$imageName = array();
if($orderby == 1){
for($i=0;$i<count($image);$i++){
$sortObj[$i] = $image[$i][1];
$imageName[$i] = $image[$i][0];
}
}
else{
for($i=0;$i<count($image);$i++){
$sortObj[$i] = $image[$i][0];
}
$imageName = $sortObj;
}
if($sort == 1) array_multisort($sortObj, SORT_ASC, $imageName);
elseif($sort == 2) array_multisort($sortObj, SORT_DESC, $imageName);
else shuffle($imageName);
return $imageName;
}
function checkURL($url){
if(is_dir($url)){ $url = (substr($url,-1,1) == "/") ? $url : $url."/"; return $url; }
else { return false; }
}
function buildThumbnail ($imageArray, $twidth, $theight) {
$thumbs = array();
foreach ($imageArray as $image) {
if ($image1 = processImage ( $image, $twidth, $theight, 0 )) {
$thumbs[] = "$image1";
}
}
return $thumbs;
}
?>
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
November 3, 2008 at 3:58 am #277841Hi,
Can you please PM me your site admin account as well as FPT account? Without investigating into the codes, I am afraid that we can not provide any solutionNovember 3, 2008 at 4:30 pm #277924Only issue now is that the thumbnails are not created correctly..
Slideshow displays ok, as does any description, thumbnails however do not resize to specified size. instead are remaining at full size, and displaying a section of the image as a thumbnail
eg.
would be happy to manually create these if there is some way of doing so
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
November 6, 2008 at 7:28 am #278242Hi
Please provide me more info, so I can view your sources file
November 6, 2008 at 3:07 pm #278320originally requested help 5 days previously, and so far all i’ve recieved as support is a request for my site details, which i provided…..
i had no reply to this pm containing secure site details, no sign of login to my site, and no real attempt at answering my questions
e.g. is it possible to manually create these thumbnails instead of relying on php to resize and build the thumbarray from the original images?
as you have provided this modification with this theme, and i have not changed anyhing related to it other than configuration options direcly following the guide provided on this site, i see no reason why i should hand out further secure access to my server at present, without some evidence or more information about what you intend todo
so please clarify, which “sources” file are you speaking of other than the php i have provided above? this is far from clear
-
AuthorPosts
This topic contains 11 replies, has 3 voices, and was last updated by bluhoney 16 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum