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