View Single Post
  #4  
Old 02-11-2016, 11:13 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 89,084
Kyttias is on a distinguished road
Default

Oh, um, put it wherever you like/need to? In my version, it also happens to contain 'Children:' beforehand but takes into account whether or not they have any before displaying the text at all. My code as it is currently just loops through a list of text names, whereas yours are images.

So let's start again, now that I see what you have. ^^;;;

You really shouldn't need to access the database over and over again as you are, the variables that hold the id# of the the parents and grandparents are now literally part of the current pet's object in the same way their species type, gender, and the personality/stat mod is. So, try just {$adopt->grandfatherB} for example, rather than making a database call?

Actually, here:
PHP Code:
if ($adopt->mother == NULL) { $motherview "Unknown"; } else { $motherview "<a href='../../levelup/click/{$adopt->mother}'><img src='../../levelup/siggy/{$adopt->mother}' width='25%' height='25%'/></a>"; }
if (
$adopt->father == NULL) { $fatherview "Unknown"; } else { $fatherview "<a href='../../levelup/click/{$adopt->father}'><img src='../../levelup/siggy/{$adopt->father}' width='25%' height='25%'/></a>"; }
if (
$adopt->grandmotherA == NULL) { $grandmotherAview "Unknown"; } else { $grandmotherAview "<a href='../../levelup/click/{$adopt->grandmotherA}'><img src='../../levelup/siggy/{$adopt->grandmotherA}' width='12%' height='12%'/></a>"; }
if (
$adopt->grandmotherB == NULL) { $grandmotherBview "Unknown"; } else { $grandmotherBview "<a href='../../levelup/click/{$adopt->grandmotherB}'><img src='../../levelup/siggy/{$adopt->grandmotherB}' width='12%' height='12%'/></a>"; }
if (
$adopt->grandfatherA == NULL) { $grandfatherAview "Unknown"; } else { $grandfatherAview "<a href='../../levelup/click/{$adopt->grandfatherA}'><img src='../../levelup/siggy/{$adopt->grandfatherA}' width='12%' height='12%'/></a>"; }
if (
$adopt->grandfatherB == NULL) { $grandfatherBview "Unknown"; } else { $grandfatherBview "<a href='../../levelup/click/{$adopt->grandfatherB}'><img src='../../levelup/siggy/{$adopt->grandfatherB}' width='12%' height='12%'/></a>"; } 
Also, try this for establishing children instead (so it works on the myadoptsview.php page and uses just images):
PHP Code:
$babies = array();
$offsprings explode(","$adopt->offsprings);
if (
$offsprings != ""){
    foreach(
$offsprings as $offspring){
        if (
$offspring != 0){
            
$babies[] = "<a href='../../levelup/click/{$offspring}'><img src='../../levelup/siggy/{$offspring}' width='12%' height='12%'/></a>";
        }
    }
    
$children implode(""$babies);
    if (empty(
$children)){ $children "None"; } 

Use {$children} just like you're using things like {$grandfatherBview} in your table.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 02-12-2016 at 12:19 AM.
Reply With Quote