Page 1 of 1

Missing field(s) in Cat-eLog species view...

Posted: 04 Dec 2006, 13:38
by MatsP
I don't know how many fields are missing, but definitely the "distribution" is missing. [But only on certain fishes - perhaps only those that don't have temp/pH?]

Example:
Example showing distribution:


--
Mats

Posted: 13 Dec 2006, 21:12
by Jools
Fixed.

I tidied up the page so that it doesn't output subsection title bars if no information exists for any field in that group. Just got it a little wrong...

Jools

Posted: 14 Dec 2006, 10:18
by MatsP
That's the kind of thing I thought it was...

A thought: Since you probably do an if for each of the lines in each section, could you do something like this...:

Code: Select all

... Some section of Cat-eLog page ... 
$html = "";
if ($row["something"] != "")
   $html .= "..." . $row["something"] . "...";
if ($row["otherthing"] != "")
   $html .= "..." . $row["otherthing"] . "...";
...
if ($html != "") {
   echo "... Section header ... ";
   echo $html;
   echo "... Section footer ... ";
}
That way you don't need to have a long set of checks to see if you need the header, only to check the same thing again when you get to outputting each field... Just a thought of course...

--
Mats

Posted: 15 Dec 2006, 14:46
by MatsP
Jools, are you sure that you updated the Cat-eLog species page correctly? Because it seems like it's still not working... I just looked at Megalonem platanum, and it's not showing it's dsitribution, but if I look at the data in the database, it's there...

--
Mats

Posted: 15 Dec 2006, 18:16
by Jools
MatsP wrote:Jools, are you sure that you updated the Cat-eLog species page correctly? Because it seems like it's still not working... I just looked at Megalonem platanum, and it's not showing it's distribution, but if I look at the data in the database, it's there...
It's fixed, here's the kind of code we're using....

Code: Select all

if ($species_row["min_ph"] > 0 || $species_row["min_temp"] > 0 || $species_row["water"] != "" || $species_row["distribution"] != "")
... basically, you only get a header if any one of the fields that belong to that group have a value.

Jools