Jump to content

Need help with php code


ActiveZuuch

Recommended Posts

I have this code:

defined('_JEXEC') or die('Restricted access');

$plugin_folder = basename(dirname(dirname(dirname(__FILE__))));

$template_folder = basename(dirname(__FILE__));

$files_path = JURI::base() . 'plugins/k2/'.$plugin_folder.'/tmpl/'.$template_folder.'';

$document = &JFactory::getDocument();

$visibleItems = $plugin_params->visibleItems;

$height = $plugin_params->slider_height;

$width = $plugin_params->slider_width;

$slideType = $plugin_params->type_slider;

$orientation = $plugin_params->sorient;

$slideTime = $plugin_params->stime;

$duration = $plugin_params->sduration;

$autoslide = $plugin_params->autoSlide;

$document->addStyleSheet($files_path.'/css/stylesheet.css');

$document->addScript($files_path.'/src/'.$template_folder.'.js');

$document->addScriptDeclaration("

window.addEvent('load', function(){

new YJK2SimpleSlide({

outerContainer : 'SimpleSlide_outer',

innerContainer : 'SimpleSlide_inner',

elements: '.SimpleSlide_slide',

navigation: {

'forward':'SimpleSlide_right',

'back':'SimpleSlide_left',

container: 'SimpleSlide_inner_nav',

elements:'.SimpleSlide_navLink',

outer: 'SimpleSlide_nav',

visibleItems:$visibleItems

 

},

navInfo: 'SimpleSlide_nav_info',

navLinks: '.SimpleSlide_navLink',

slideType: $slideType,

orientation:$orientation,

slideTime:$slideTime,

duration:$duration,

autoslide:$autoslide,

startElem:0

 

});

});

 

");

?>

<div class="SimpleSlide" style="width:<?php echo $width ?>px;">

<div id="SimpleSlide_outer" class="slide" style="width:<?php echo $width ?>px; height:<?php echo $height ?>px;">

<a href="#" title="previous" id="SimpleSlide_left"></a> <a href="#" title="next" id="SimpleSlide_right"></a>

<div id="SimpleSlide_inner" style="width:<?php echo $width ?>px; height:<?php echo $height ?>px;">

 

<?php

if(!empty($all_photos)){

foreach($all_photos as $photo_row => $photo_value){

?>

<div class="SimpleSlide_slide" style="width:<?php echo $width ?>px; height:<?php echo $height ?>px; display:none">

<img src="<?php echo JURI::root().$photo_value; ?>" alt=""/>

</div>

<?php

}

}

?>

</div>

</div>

 

<div class="navContainer" style="width:<?php echo $width ?>px;">

<div id="SimpleSlide_nav" style="width:<?php echo $width ?>px;">

<div class="nav_inner" id="SimpleSlide_inner_nav">

<?php

if(!empty($all_photos)){

foreach($all_photos as $photo_row => $photo_value){

?>

<a href="#" class="SimpleSlide_navLink">

<span class="slide_img" style="background:url(<?php echo JURI::root().$photo_value ?>) no-repeat center 50%;"></span>

</a>

<?php

}

}

?>

</div>

</div>

</div>

</div>

 

This code does display what i need but in the thumbnail area it is showing a piece of big image, I need help in showing the whole image. I figured out that code in red is responsible for it, but I dont know how it can display the whole image thumbnail instead of just one piece of image. Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/273527-need-help-with-php-code/
Share on other sites

It looks like the 50% that is in that red line is outputting 50% of the image. If you are trying put something over the thumbnail which it looks like you are, absolute position the image, don't make it the background and resize it using CSS height width percents.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.