Jump to content

Need Help- newbie


mot777mot

Recommended Posts

Good day people,  got this open source script for a dog pedigree database on the net.  I have no programming skills at all.

 

Need some help with the script,  i want to change the font color of the Sire's side of the pedigree that is displayed ,  but have no idea how to do it,  any help would be appreciated.

Example of displayed pedigree -  http://www.sa-apbt.co.za/details.php?id=63854

below are the code.

Thanks in advance

 


<?php
function DbTriad($dogVO, $level, $generations, $childText) {
global $THUMBNAIL_WIDTH;
global $dogDAO;
# do the individual.

if ($level == $generations) {

echo "<TD >";

} else {

echo "<TD ROWSPAN=" . pow(2,($generations - $level));

echo " >";

}

if (($dogVO != -1) && (!empty($dogVO ))) {

if (empty($dogVO)) {

echo "Unknown Individual";

} else {

$name = $dogVO->name;

$sireId = $dogVO->sire->id;

$damId = $dogVO->dam->id;

$landofbirth = $dogVO->landofbirth;

$yearofbirth = $dogVO->yearofbirth;

$color = $dogVO->color;

$title = $dogVO->title;

$photo = $dogVO->photo->thumb_ref;
if (empty($photo))
$photo = $dogVO->photo->reference;
}


### Highlight title w/ Blue font

if (!empty($title)) {
echo "<label>";
echo "<font color=\"blue\">$title</font><BR>";
echo "</label>";
}

echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$dogVO->id.'">';

if (!empty($photo)) {

echo '<p><img SRC="'.$photo.'" width="'.$THUMBNAIL_WIDTH.'"></p>';

}

echo "$name</a>";



echo "<label>";

//if (($level <= 3) && (!empty($color))) {

if (!empty($color)) {

echo "<BR>$color ";

}

if (!empty($landofbirth)) {

echo "<BR>$landofbirth";

}

if (!empty($yearofbirth)) {

echo "<BR>$yearofbirth";

}

echo "</label>";
}

else {

echo " ";

if (!empty($childText) )

echo '<a href="addDog.php?child='.$childText.'">Add Dog</a>';

}

echo "</TD>";

# do the father.

if ($level < $generations) {

if (!empty($dogVO))

$childText = "fatherOf_".$dogVO->id;

         

else

unset($childText);

$dogDAO = new DogDAO();
if (empty($sireId))
$father = null;
else
    $father = $dogDAO->get($sireId);
DbTriad($father, $level + 1, $generations, $childText);

             
}

# do the mother.
   

if ($level < $generations) {

if (!empty($dogVO))

$childText = "motherOf_".$dogVO->id;

else

unset($childText);

$dogDAO = new DogDAO();
if (empty($damId))
$mother = null;
else
$mother = $dogDAO->get($damId);
DbTriad($mother, $level + 1, $generations, $childText);

}

# finish up.

if ($level == $generations) {

echo "</TR><TR>";

}



}





# begin table

echo '<table id="pedigree" align="center" width="96%" border="0"><tr><th colspan='.$generations.'>Pedigree of '.$dog->name.' '.$dog->title.'</th></tr>';


# do tree.

$dogDAO = new DogDAO();

$dog = $dogDAO->get($currId);

DbTriad ($dog, 1, $generations, null);
   

# end table

echo "</td></tr></table>";

?>[/code]

Link to comment
https://forums.phpfreaks.com/topic/211451-need-help-newbie/
Share on other sites

hi newbie,

i think there is another page that you need to look into.....the cames from the Global $dogDAO. thats where the colors are

 

other than that i only see this line

 

"<font color=\"blue\">$title</font><BR>";

 

that could change the color you want

 

thank you come again

Link to comment
https://forums.phpfreaks.com/topic/211451-need-help-newbie/#findComment-1102490
Share on other sites

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.