Curious problem with PHP and Netscape

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

carterjackson.com/joshua/photogallery/ doesn't display past the first click in Netscape 4.x browsers. If you view source, the code appears to be there and it's fine.

I'm using slooze.com and haven't hacked the code other than to add a commenting piece.

It *used* to work in Netscape 4.x, but it displayed a black background for everything.

ANY ideas on where to look for this elusive problem are greatly appreciated.

The stylesheet is carterjackson.com/joshua/style.css and contains a mishmash of crap, mostly because I haven't taken the time to finish his site.

Is it the PHP or is it the CSS? Ideas?

They have: 601 posts

Joined: Nov 2001

Where's the 'first click'? I can't see that with IE, or do I press on the image?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Never you mind, I fixed it.

It was the CSS, conflicting with the Slooze code. Specifically, the link bar at the top is in a that doesn't close within the code, and I had padding around it and a border, and Netscape wouldn't do that for an element that doesn't close.

Now to find the problem within Slooze and fix it.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

sorry, Wil, missed your comment -- There should be a list of items to click on right on the front page.

They have: 601 posts

Joined: Nov 2001

Aha - got them. Glad you got it sorted!

Cute baby Smiling

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Ah, thanks, Wil. It's a good thing he's cute because he's 3x as demanding as his brother and I'm 2x as busy. Wink

I've actually run into another problem -- I can't seem to get the tag to close. In fact, I don't know where in the code to look.

There are two areas where I can put the opening part, but I can't get the closing part to go in the right place. If I put it in code sample #1, the goes at the end of each link in the breadcrumbs at the top of the page. If I put in code sample #2, it misses the breadcrumbs altogether.

CODE SAMPLE #1

/* private: show a hyperlinked topic heirarchy down to the given topic */
function showNav( $topicID = "/" ) {
if ($topic = $this->ct->getTopic($topicID)) {
$desc = $this->defaultText($topic['Description'], SLZ_STR_NO_DESC);
if ($topicID == "/") {
$this->show("actionURL . "\">" . $desc . "");
}
else {
$this->showNav($topic['ParentTopicID']);
$this->show(" : actionURL . "?TopicID=" . urlencode($topic['TopicID']) . "\">" . $desc . "");
echo "";
}
}
}

CODE SAMPLE #2

/* private: render a page body for a given topic */
function renderTopic( $topicID = "/", $sort="" ) {
echo "";
if ($topicID != "/") {
$this->showNav($topicID);
}
$topic = $this->ct->getTopic($topicID);
$this->showTopic($topic);
$subTopics = $this->ct->getTopicsInParentTopic($topicID);
$this->showTopics($subTopics);
$pictures = $this->ct->getPicturesInTopic($topicID);
if ($sort != "") {
$this->showSortType($sort);
$pictures = $this->sortPictures($pictures, $sort, $this->sortThreshold);
}
$this->showThumbs($pictures);
if ( (count($pictures) > $this->sortThreshold) || $sort!="" )
$this->showSort($topicID);
if ($this->admin) {
$this->showFormUpdateTopic($topicID);
if ($topicID == "/") {
$this->showFormAddTopic();
$this->showRolls();
$this->showFormAddRoll();
}
else {
$this->showFormDeleteTopic($topicID);
}
}
$this->showFormSearch();
echo "";

}

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Where do you want the ?
Did you already fix that too?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Ah, no, sadly, I am flummoxed.

I want the darn to go at the end of the last link in the breadcrumbs.

So on a page like this:

http://carterjackson.com/joshua/photogallery/photos.php?RollID=2002march&FrameID=020331-snork

The HTML would read:

Joshua's Photo Gallery
: Joshua
: 5-6m

SNORK! [ Viewed: 4 times ]

Instead of how it is now:

Joshua's Photo Gallery
: Joshua
: 5-6m
SNORK! [ Viewed: 4 times ]

Does that make sense?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Oh, everything in italics in my post with the two code samples is where I have tried to put the code but haven't had the right results.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I think it should go in CODE SAMPLE #1, but I can't figure out how to get it to render properly (i.e. not after every link).

Busy's picture

He has: 6,151 posts

Joined: May 2001

instead of use Smiling

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

sadly, Busy, I need it to be within a or tag in order to control it the way I want to. It needs to be in some element other than the table or body element. But thanks! Smiling

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

see what this does...

<?php
/* private: render a page body for a given topic */
function renderTopic( $topicID = \"/\", $sort=\"\" ) {
    echo \"<p class=\\\"nav\\\">\";
    if (
$topicID != \"/\") {
       
$this->showNav($topicID);
    }
    echo \"</p>\";
   
$topic = $this->ct->getTopic($topicID);
    echo \"<p class=\\\"topic\\\">\";
   
$this->showTopic($topic);
    echo \"</p>\";
   
$subTopics = $this->ct->getTopicsInParentTopic($topicID);
    echo \"<p class=\\\"subtopics\\\">\";
   
$this->showTopics($subTopics);
    echo \"</p>\";
   
$pictures = $this->ct->getPicturesInTopic($topicID);
    if (
$sort != \"\") {
       
$this->showSortType($sort);
       
$pictures = $this->sortPictures($pictures, $sort, $this->sortThreshold);
    }
   
$this->showThumbs($pictures);
    if ( (count(
$pictures) > $this->sortThreshold) || $sort!=\"\" )
       
$this->showSort($topicID);
    if (
$this->admin) {
       
$this->showFormUpdateTopic($topicID);
        if (
$topicID == \"/\") {
           
$this->showFormAddTopic();
           
$this->showRolls();
           
$this->showFormAddRoll();
        }
        else {
           
$this->showFormDeleteTopic($topicID);
        }
    }
   
$this->showFormSearch();
}
?>

Mark Hensler
If there is no answer on Google, then there is no question.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I got this as a result:

<?php
Parse error
: parse error in /home/carterja/carterjackson-
www/joshua/photogallery/slooze.php on line 137

Fatal error
: Class myslooze: Cannot inherit from undefined
class slooze in /home/carterja/carterjackson-
www/joshua/photogallery/slooze_local.php on line 139
?>

Darn.

I'm not familiar enough with the this-> and classes to know where to start on this.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

which are those lines?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

one is the function itself, the other is one of the echo statements. If I remove the echo statement, it has an error at the next one. ?!

Sorry, I should have mentioned that. I guess this is why there is no closing ! Frustrating.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

try this..

<?php
/* private: render a page body for a given topic */
function renderTopic( $topicID = \"/\", $sort=\"\" ) {
   
$this->show(\"<p class=\\"nav\\">\");
    if (
$topicID != \"/\") {
       
$this->showNav($topicID);
    }
   
$this->show(\"</p>\");
   
$topic = $this->ct->getTopic($topicID);
   
$this->show(\"<p class=\\"topic\\">\");
   
$this->showTopic($topic);
   
$this->show(\"</p>\");
   
$subTopics = $this->ct->getTopicsInParentTopic($topicID);
   
$this->show(\"<p class=\\"subtopics\\">\");
   
$this->showTopics($subTopics);
   
$this->show(\"</p>\");
   
$pictures = $this->ct->getPicturesInTopic($topicID);
    if (
$sort != \"\") {
       
$this->showSortType($sort);
       
$pictures = $this->sortPictures($pictures, $sort, $this->sortThreshold);
    }
   
$this->showThumbs($pictures);
    if ( (count(
$pictures) > $this->sortThreshold) || $sort!=\"\" )
       
$this->showSort($topicID);
    if (
$this->admin) {
       
$this->showFormUpdateTopic($topicID);
        if (
$topicID == \"/\") {
           
$this->showFormAddTopic();
           
$this->showRolls();
           
$this->showFormAddRoll();
        }
        else {
           
$this->showFormDeleteTopic($topicID);
        }
    }
   
$this->showFormSearch();
}
?>

Mark Hensler
If there is no answer on Google, then there is no question.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I was reading up on the classes thing and my very rudimentary understanding isn't enough to understand why this works, but I think it has to do with instances, right?

Errors:

134: /* private: render a page body for a given topic */
135: function renderTopic( $topicID = "/", $sort="" ) {
136:    $this->show("");
137:    if ($topicID != "/") {
138:        $this->showNav($topicID);
139:    }

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /home/carterja/carterjackson-www/joshua/photogallery/slooze.php on line 135

139: class MySlooze extends Slooze {
var $admin = FALSE; /* enable full admin mode */
var $enableComments = TRUE; /* enable user addition of comments */
var $enableRatings = TRUE; /* enable user rating of pictures */
var $enableViews = TRUE; /* enable counting how many times a picture has been viewed */
var $enableNav = TRUE; /* enable First|Prev|Next|Last navigation */
// var $enableCache = FALSE; /* enable caching of pages for speed */
var $allPathsLower = FALSE; /* make all image paths lower-case, no matter their recorded case */
// var $showCommentIPs = FALSE; /* put IP of commenter before comment */
// var $ownIPSubstring = "192.168.1."; /* don't count picture views coming from this address substring */
var $sortThreshold = 5; /* number of pics in topic before sorting offered */
var $basePath = "./"; /* path to photos directory */
// var $cachePath = "./cache/"; /* path to cache directory */
var $baseURL = "./"; /* URL of photos directory */
// var $actionURL = ""; /* URL for further actions */
// var $picture_suffix = ".jpg"; /* filename suffix for pictures */
// var $thumb_suffix = "-t.jpg"; /* filename suffix for thumbnails */
// var $nl = "\r\n"; /* newline sequence */

// var $ctClass = "MySloozeCtCsv"; /* store data in text files */
var $ctClass = "MySloozeCtSql"; /* store data in RDBMS */

/* public: constructor, call parent constructor */
function MySlooze() {
$this->Slooze();
}
}

Fatal error: Class myslooze: Cannot inherit from undefined class slooze in /home/carterja/carterjackson-www/joshua/photogallery/slooze_local.php on line 139

I think maybe I need to research more before attempting to hack this. My understanding of OOP is negliable.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

The first error is preventing the first file from being parsed correctly. As a result, the Slooze class is not being defined.

The second error is occuring because there is no Slooze class for it to extend.

So, fix the first error, and the second will go away too.

Count your braces, {}... they may not be paired correctly above line 135. You should have only one pair open when you get to line 135, as that function should be defined within the class.

Mark Hensler
If there is no answer on Google, then there is no question.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

k, I'll take a boo. I'm only selecting the code and replacing it with the one you offered, so it's probably close in there somewhere, lol.

I know that this is something I can understand, but it's taunting me. The damn closing . *sigh*

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

you know what? I think I know what the problem is. It's not the braces -- when I select php code and copy it from the browser, there is a non-breaking space character instead of a space character (part of the php code colouring script?) and it breaks the code.

Shoot!

Let me remove that and see if it works.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

That was it!!

Okay, I don't need the other paragraphs, but I do see where the one I want it, and it's working, so thank you!!

Smiling happy happy! A closing tag! HAPPY HAPPY!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

hmmm... found another place where it should be but it isn't. how odd.

It's there when you pick a gallery, when you pick a subgallery, et cetera, but as soon as you pick an image, it's gone.

So I'm going to take what I have learned and see if I can make it work.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Badda bing, I did it!! And I think I might even understand how the heck that works, too. YAY! Smiling

Thanks, Mark!

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Woohoo! Laughing out loud

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.