Jump to content

PHP Newbie here! Can someone please tell what is going on?!?


jandreoni

Recommended Posts

http://www.capturedimageofmaine.com/tempsite_002/gallerydetail002.php?id=3

I don't really know what I've done here to be getting this error. I had it working fine a little while ago, but now it's blowing out. I've only got the first 2 galleries going at this point, but they are giving the same error, and the NEXT and PREVIOUS show the same ID.

AAAGH!!

Can anyone help me??
Link to comment
Share on other sites

Yeah, that would help, wouldn't it. =)

Here's the PHP code from the page the error is coming from:

(red text is the line of the error, 49)

Not sure what else I need to post from. I've got another class page and a definition page. Hope this helps. =)

<?php

include_once("includes/Gallery.class.php");

class CustomGallery001 extends Gallery {

var $title;

function CustomGallery(){
$this->Gallery();
$this->title = "";
$index = isset($_GET["id"]) ? $_GET["id"]-1 : 0;
Gallery::setActive($index);
}

// get/set title
function setTitle($title){
$this->title = $title;
}
function getTitle(){
return $this->title;
}

// get/set display index
function getActiveDisplay(){
return ($this->getActive()+1);
}
function getCountDisplay(){
return $this->getActiveDisplay() ." of ". $this->getCount();
}
function getPreviousDisplay(){
$index = $this->getPrevious();
if(is_int($index)) return "<a href=\"gallerydetail001.php?id=".($index+1)."\" title=\"Previous Photo\">Previous</a>";
else return "<span>Previous</span>";
}
function getNextDisplay(){
$index = $this->getNext();
if(is_int($index)) return "<a href=\"gallerydetail001.php?id=".($index+1)."\" title=\"Next Photo\">Next</a>";
else return "<span>Next</span>";
}

// get/set display data
function getActiveTextDisplay(){
return $this->getActiveText();
}
function getActiveImageDisplay(){
$image = $this->getActiveImage();
$index = $this->getActiveDisplay();
[color=red]list($width, $height) = getimagesize($image);[/color]
return "<img src=\"$image\" width=\"$width\" height=\"$height\" alt=\"Photo $index\" />";
}
function getThumbnailsDisplay(){
$thumbnails = $this->getThumbnails();
$result = "";
for($i = 0; $i < count($thumbnails); $i++){
$index = $i+1;
$thumb = $thumbnails[$i];
list($width, $height) = getimagesize($thumb);
$result .= "<span><a href=\"gallerydetail001.php?id=$index\" title=\"View Photo $index\"><img src=\"$thumb\" width=\"$width\" height=\"$height\" alt=\"Thumbnail $index\" /></a></span>";
}
return $result;
}
}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.