Thread: Mys 1.3.4 Encyclopedia
View Single Post
  #13  
Old 04-06-2018, 01:56 PM
goofyunicorn's Avatar
goofyunicorn goofyunicorn is offline
Kelpie
 
Join Date: Feb 2018
Location: Unicorn Land
Posts: 101
Gender: Female
Credits: 12,707
goofyunicorn is on a distinguished road
Default

Quote:
Originally Posted by Dinocanid View Post
Can you show what your view file looks like?

  Spoiler: encyclopediaview.php 
PHP Code:
<style>
   .myTable { width:600px; border-collapse:collapse; }
.myTable th { background-color:#543210;width:600px; padding:5px;border:5px solid #543210;color:#000;}
.myTable td { padding:5px;border:5px solid #543210;height:100px; }
</style>
<?php
class EncyclopediaView extends View{

    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;        
        
$document->setTitle("Encyclopedia");  
        
$document->add(new Comment("<h2>Choose a species below</h2>"));
        
        
$document->add(new Comment("<a href='/encyclopedia/green_budgie'>Green Budgie February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/blue_budgie'>Blue Budgie February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/harry'>Harry February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/pied_budgie'>Pied Budgie February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/beau'>Beau February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/half_sider'>Half Sider Budgie February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/dark_grey_yellowface'>Dark Grey Yellowface Cockatiel February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/light_grey_yellowface'>Light Grey Yellowface Cockatiel February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/blue_grey_yellowface'>Blue Grey Yellowface Cockatiel February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/grey_with_white_wing'>Grey with White Wing Cockatiel February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/white_and_grey'>White and Grey Cockatiel February/March 2018</a>"));
        
$document->add(new Comment("<a href='/encyclopedia/lutino'>Lutino Cockatiel February/March 2018</a>"));
    }
    
    public function 
green_budgie(){
    
$mysidia Registry::get("mysidia"); 
    
$document $this->document;
    
$species "Green Budgie";
    
$topclicks $mysidia->db->select("owned_adoptables", array("totalclicks"), "Type='{$species}'""1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
    
$topadopt $mysidia->db->select("owned_adoptables", array("name"), "Type='{$species}'""1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
    
$topadoptowner $mysidia->db->select("owned_adoptables", array("owner"), "Type='{$species}'""1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
    
$count $mysidia->db->select("owned_adoptables", array(), "Type='{$species}'")->rowCount();
    
$document->setTitle("<center>{$species}</center>");
    
$document->add(new Image("http://ibb.co/js7YrH"));
    
$document->add(new Comment("<center><table class='myTable'>
<tr>
<th>Basic info</th>
</tr>
<tr>
<td><b>Species:</b> 
{$species} <br></br><b>Height:</b> 20cm<br></br><b>Group:</b> Budgie <br></br><b>Rarity:</b> Very Common<br></br><b>Disposition:</b> Good<br></br><b>Description:</b> A lovely, simple green budgie with extra fluff. <br></br><b>Obtainable:</b> Adoption Center<br></br</td>
</tr>
</table>"
));

    
$document->add(new Comment("<center><table class='myTable'>
<tr>
<th>Background</th>
</tr>
<tr>
<td>The green budgie is based on it's natural colour, but the most important thing is that it is super fluffy.</td>
</tr>
</table>"
));

    
$document->add(new Comment("<center><table class='myTable'>
<tr>
<th>Statistics</th>
</tr>
<tr>
<td><b>Amount In-Game:</b> 
{$count}<br></br><b>Top {$species}:</b> {$topadopt} with {$topclicks} clicks. (Owned by {$topadoptowner})</td>
</tr>
</table>"
));

$document->add(new Comment("<a href='http://beausaviary.mysidiahost.com/encyclopedia'>Return to Encyclopedia</a>"));
    }

 public function 
blue_budgie(){
    
$mysidia Registry::get("mysidia"); 
    
$document $this->document;
    
$species "Blue Budgie";
    
$topclicks $mysidia->db->select("owned_adoptables", array("totalclicks"), "Type='{$species}'""1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
    
$topadopt $mysidia->db->select("owned_adoptables", array("name"), "Type='{$species}'""1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
    
$topadoptowner $mysidia->db->select("owned_adoptables", array("owner"), "Type='{$species}'""1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
    
$count $mysidia->db->select("owned_adoptables", array(), "Type='{$species}'")->rowCount();
    
$document->setTitle("<center>{$species}</center>");
    
$document->add(new Image("http://ibb.co/gvRhkc"));
    
$document->add(new Comment("<center><table class='myTable'>
<tr>
<th>Basic info</th>
</tr>
<tr>
<td><b>Species:</b> 
{$species} <br></br><b>Height:</b> 20cm<br></br><b>Group:</b> Budgie <br></br><b>Rarity:</b> Common<br></br><b>Disposition:</b> Good<br></br><b>Description:</b> Fred. Fred who? Fred who is Freda of course! <br></br><b>Obtainable:</b> Adoption Center<br></br</td>
</tr>
</table>"
));

    
$document->add(new Comment("<center><table class='myTable'>
<tr>
<th>Background</th>
</tr>
<tr>
<td>The blue budgie is summed up in 2 words. Fred. Freda.</td>
</tr>
</table>"
));

    
$document->add(new Comment("<center><table class='myTable'>
<tr>
<th>Statistics</th>
</tr>
<tr>
<td><b>Amount In-Game:</b> 
{$count}<br></br><b>Top {$species}:</b> {$topadopt} with {$topclicks} clicks. (Owned by {$topadoptowner})</td>
</tr>
</table>"
));

$document->add(new Comment("<a href='http://beausaviary.mysidiahost.com/encyclopedia'>Return to Encyclopedia</a>"));
    }
}
?>
__________________

Check out my Adoptable's Site! Art by the wonderful Eyesauce.
Reply With Quote