Home »
General »
PHP discussions »
need help. please!
need help. please! [message #34476] |
Sat, 04 November 2006 04:57 |
justinryan
Messages: 1 Registered: November 2006
Karma: 0
|
Junior Member |
|
|
Hey everyone,
I am currently working on a gallery for a friend using a script that i am assuming is named CustomGallery.
i have used it on a few different sites, you can see the script on www.mattparkerweddings.com and www.itakebandphotos.com.
the problem i am having is this,
my client wants to have it so that if you click the thumbnail, it opens in a new window. inside that window would be the buttons to go to the next one. the pop up would have to resize with the size of the image.
is there any code i can add to a php file to make images open in a new window on click?
here is the php for the include file
<?php
Class Gallery {
var $photo_array;
var $image_directory;
var $active_index;
function Gallery(){
$this->photo_array = array();
$this->image_directory = "";
$this->active_index = null;
}
// set data
function addPhoto($image, $thumb, $text){
$photo = array("image" => $image, "thumb" => $thumb, "text" => $text);
array_push($this->photo_array, $photo);
}
// get data
function getActiveText(){
return $this->photo_array[$this->getActive()]["text"];
}
function getActiveImage(){
return $this->getDirectory() . $this->photo_array[$this->getActive()]["image"];
}
function getThumbnails(){
$result = array();
for($i = 0; $i < $this->getCount(); $i++){
array_push($result, $this->getDirectory() . $this->photo_array[$i]["thumb"]);
}
return $result;
}
// get/set directory
function setDirectory($directory){
$this->image_directory = $directory;
}
function getDirectory(){
return $this->image_directory;
}
// get/set index
function setActive($index){
$this->active_index = $index;
}
function getActive(){
return $this->active_index;
}
function getPrevious(){
$index = $this->getActive();
return ($index > 0) ? $index-1 : null;
}
function getNext(){
$index = $this->getActive();
return ($index < $this->getCount()-1) ? $index+1 : null;
}
function getCount(){
return count($this->photo_array);
}
}
?>
.
i'm just not sure which part of that code to add to in order to make the thumbs open a popup on click.
thanks in advance!
|
|
|
Goto Forum:
Current Time: Sat Nov 23 08:05:40 GMT 2024
Total time taken to generate the page: 0.02114 seconds