Forum Moderators: coopster
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<div class="phpheading">
<div class="contentheading">gallery</div>
</div>
<div class="clr"></div>
<div id="galleryTopSlider">
<div class="slideImages">
<?php
$galleryCall = '{gallery lightbox=none slider=boxplus.carousel slider:edges=blurred slider:step=single overlay=1 width="150" height="150" cols=4 slider:positioning=side }gallery/slider{/gallery}' ;
$galleryCall = JHTML::_('content.prepare', $galleryCall);
echo $galleryCall;
?>
</div>
</div>
<br />
<?php
$defaultPath = 'images/stories/gallery/'; //define folder root (located in images/stories)
if (empty($_GET["gallery"]))//Is the gallery assigned?
{
$defaultGallery = '1';//if not assign one to variable//
$gallery = $defaultGallery; //assign to the gallery get//
include('images/stories/gallery/'.$gallery.'/describe.php'); // Get the description from each gallery folder
echo '<h2 class="gallerytitle">'.$title.'</h2>';//title from description
$check = $defaultPath.''.$defaultGallery; //path for checking
// Scan each folder for files.//
if ( ($files = @scandir($check.'/before/')) && (count($files) > 2) )
{
echo '<div id="subGalleryLink" class="'.$active.'"><a href="gallery/?gallery='.$gallery.'&subGallery=before">Before</a></div>';
$before = TRUE;
}
//Check during folder for images
if ( ($files = @scandir($check.'/during/')) && (count($files) > 2) )
{
echo '<div id="subGalleryLink" class="'.$active.'"><a href="gallery/?gallery='.$gallery.'&subGallery=during">During</a></div>';
$during = TRUE;
}
//Check after folder for images
if ( ($files = @scandir($check.'/after/')) && (count($files) > 2) )
{
echo '<div id="subGalleryLink" class="'.$active.'"><a href="gallery/?gallery='.$gallery.'&subGallery=after">After</a></div>';
$after = TRUE;
}
echo '<div class="clr"></div>';
//assign default folder with thumbs by checking for the first non empty folder
if ($before == TRUE)
{
$active ='activeGallery';
$subGallery = 'before';
}
else if ($during == TRUE)
{
$subGallery = 'during';
$active ='activeGallery';
}
else if ($after ==TRUE)
{
$subGallery = 'after';
$active ='activeGallery';
}
//end assign defualt thumbs
//Create the gallery based on the default settings above
echo '<div id="galleryBottom">';
$galleryCall = '{gallery width=100 height=100 layout=flow}/gallery/'.$gallery.'/'.$subGallery.'/{/gallery}' ;
$galleryCall = JHTML::_('content.prepare', $galleryCall);
echo $galleryCall;
echo '</div>';
echo '<div id="bottomSlider">';
$galleryCall = '{gallery depth=1 animation=7000 slider=boxplus.transition slider:effect=fade width=350 height=310 }/gallery/'.$gallery.'/{/gallery}' ;
$galleryCall = JHTML::_('content.prepare', $galleryCall);
echo $galleryCall;
echo '<br />';
echo $description;
}
//If album is clicked
else {
$gallery = $_GET["gallery"];
include('images/stories/gallery/'.$gallery.'/describe.php');
echo '<h2 class="gallerytitle">'.$title.'</h2>';
$check = $defaultPath.''.$gallery.'/'; //path for checking
//check before folder for images
if ( ($files = @scandir($check.'before/')) && (count($files) > 2) )
{
echo '<div id="subGalleryLink" class="'.$active.'"><a href="gallery/?gallery='.$gallery.'&subGallery=before">Before</a></div>';
$before = TRUE;
}
//Check during folder for images
if ( ($files = @scandir($check.'during/')) && (count($files) > 2) )
{
echo '<div id="subGalleryLink" class="'.$active.'"><a href="gallery/?gallery='.$gallery.'&subGallery=during">During</a></div>';
$during = TRUE;
}
//Check after folder for images
if ( ($files = @scandir($check.'after/')) && (count($files) > 2) )
{
echo '<div id="subGalleryLink" class="'.$active.'"><a href="gallery/?gallery='.$gallery.'&subGallery=after">After</a></div>';
$after = TRUE;
}
echo '<div class="clr"></div>';
// End of folder Check
//assign album by clicking
$subGallery = $_GET["subGallery"];
if (empty($_GET["subGallery"]))//Is the gallery assigned?
{
if ($before == TRUE)
{
$subGallery = 'before'; //if user clicks before, the before tab is loaded
$active = 'activeGallery'; //make the link "active" which changes the css style
}
else if ($during == TRUE)
{
$active = 'activeGallery';
$subGallery = 'during';
}
else if ($after ==TRUE)
{
$active = 'activeGallery';
$subGallery = 'after';
}
}
//end
//Create the gallery based on the default settings above
$gallery = $_GET["gallery"];
echo '<div id="galleryBottom">';
$galleryCall = '{gallery width=100 height=100 layout=flow}/gallery/'.$gallery.'/'.$subGallery.'/{/gallery}' ;
$galleryCall = JHTML::_('content.prepare', $galleryCall);
echo $galleryCall;
echo '</div>'; //end galleryBottom
echo '<div id="bottomSlider">';
$galleryCall = '{gallery depth=1 animation=7000 slider=boxplus.transition slider:effect=fade width=350 height=310 }/gallery/'.$gallery.'/{/gallery}' ;
$galleryCall = JHTML::_('content.prepare', $galleryCall);
echo $galleryCall;
echo '<br />';
echo $description;
}
?> I have a feeling it has to do with when the variable is called and when its declared.
ifcontrol structure where you add that class to your element, but yet you have not assigned any value to it (or even initialized it) so naturally the resulting HTML will have an empty class value. As a matter of fact, if you have error_reporting turned up on your development machine you should be seeing errors if the variable has not yet been defined.