not showing already clicked pets/pets owned by system on page

Forum
Last Post
Threads / Messages

Ittermat

The awesomesauce
Member
Joined
Feb 2, 2016
Messages
304
Points
18
Location
in front of my laptop
Mysidian Dollar
21,294
Im wondering how to make it so pets that are already clicked for the day or are owned by SYSTEM (As they're dead if they are on my site and cant be clicked further) I tried to edit the code in daycareclass- but not sure how to translate it to just a page..thats not a bigger bit of code.

For context im making a page thats like a pet park where people can go play with pets- and give them clicks.
However I dont want the ones already clicked/dead to appear.


this is what I have at the moment:


Code:
<?php

class petparkclickView extends View{

    public function index(){
        $mysidia = Registry::get("mysidia");
        $mysidia->db->update("users_profile", ["last_seen" => "Playing with pets at the park"], "uid = {$mysidia->user->uid}");
         $document = $this->document;
        $document->setTitle("<center>Pet Park</center>");
$document->add(new Comment("<br><center><h2>This is where you can find pets to play with! </h2><br> (It only shows 15 at a a time to save bandwidth)<br>", FALSE));

    $idsM = $mysidia->db->select("vote_voters", array("adoptableid"), "date='{$datetime}' and username='{$user->username}'")->fetchAll(PDO::FETCH_COLUMN);
        $adoptsIDs = new ArrayObject($idsM);

$document->add(new Comment("<div class='row'><h2>15 random playing pets!</h2>", FALSE));

if($owner != 'SYSTEM' ){
        $stat_rand5 = $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY RAND() DESC LIMIT 15");       
        while($aid = $stat_rand5->fetchColumn()){
            $adopt = new OwnedAdoptable($aid);   
            //take adoptable IDs that have been clicked by the user in today's date
    
            $document->add(new Comment("
                <div style='display: inline-table; text-align: center;'>
                <a href='levelup/click/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a></br>
                  <a href='levelup/click/{$adopt->getAdoptID()}'><br><b>{$adopt->getName()}</b></a><br> the <small><b>LVL.</b> {$adopt->getCurrentLevel()}</small><br> {$adopt->getType()}</div>
              ", FALSE));
        }
        $document->add(new Comment("</div>", FALSE));


}
            }}
            ?>
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,274
Messages
33,115
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top