Restyling Pound?

Forum
Last Post
Threads / Messages

KittHaven

Member
Member
Joined
May 21, 2013
Messages
478
Points
28
Age
25
Location
Devon, UK
Mysidian Dollar
8,292
Aloha! Could anyone please help me to restyle the pound page? I know how to change the information that is there but I would like it to appear like my My Adopts page.

  Spoiler: Image 
dsc_zpse25gqpm9.png


This is the My Adopts page and I really like how it is set out, and so want the pound to be the same. I would know how to display info like the name and gender (and hide it for eggs), I'd just love it if the pound had this layout. And perhaps clicking the adoptable took you to a page where it asked if you wanted to adopt. Readopting costs nothing on my site, so I don't need anything included about price at all!


My pound currently looks like this:

  Spoiler: Image 
gbfb_zpscjtjdzjq.png


I have changed it a little but I don't like this XD


Thank you very much! ^_^
 
Um, I managed to get the page not showing any errors but no adopts show up.. :/ I had tried before but couldn't find my way around it, but this time is slightly better, I suppose...

Would you have any idea on how to make it work?

PHP:
	public function index(){
	    $mysidia = Registry::get("mysidia");
		$document = $this->document;	
		$document->setTitle($this->lang->title);		
        $document->addLangvar($this->lang->default);
		
		$readoptForm = new Form("readoptform", "pound/adopt", "post");
		$readoptHeader = new Comment("Pounded Adoptables for adoption");
		$readoptHeader->setHeading(3);
		$readoptForm->add($readoptHeader);
		
		$readoptTable = new TableBuilder("readopttable");
		$readoptTable->setAlign(new Align("center", "middle"));
		$readoptTable->buildHeaders();
		$readoptTable->setHelper(new AdoptTableHelper);
		
		$pounds = $this->getField("pounds");		
		$iterator = $pounds->iterator();		
		while($iterator->hasNext()){
		    $entry = $iterator->next();
			$adopt = $entry->getKey();
            $cost = $entry->getValue();

                $cells = new ArrayList;
				$lvl = $adopt->getCurrentLevel();
				if ($lvl == 0) { $cells->add(new Comment("<a href='/myadopts/manage/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a>")); }
				if ($lvl == 1) { $cells->add(new Comment("<a href='/myadopts/manage/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a>")); }
				if ($lvl >= 2) { $cells->add(new Comment("<a href='/myadopts/manage/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}' width= '200px'></a>")); }  
                $cells->add(new Comment("<b>Name: </b>"));
                $cells->add(new Comment("<b>Gender: </b>"));
                $cells->add(new Comment("<b>Total Clicks: </b>"));
				$aCells = new TCell($cells, "cell{$index}");
                $aCells->setAlign(new Align("center", "center"));
}
		    $readoptTable->add($aCells);
		
	}

Thanks ^_^
 
How's this?:
PHP:
public function index(){ 
        $mysidia = Registry::get("mysidia"); 
        $document = $this->document;     
        $document->setTitle($this->lang->title);         
        $document->addLangvar($this->lang->default); 
         
        $readoptForm = new Form("readoptform", "pound/adopt", "post"); 
        $readoptHeader = new Comment("Pounded Adoptables for adoption"); 
        $readoptHeader->setHeading(3); 
        $readoptForm->add($readoptHeader); 
         
        $readoptTable = new TableBuilder("readopttable"); 
        $readoptTable->setAlign(new Align("center", "middle")); 
        $readoptTable->buildHeaders(); 
        $readoptTable->setHelper(new AdoptTableHelper); 
         
        $pounds = $this->getField("pounds");         
        $iterator = $pounds->iterator();         
        while($iterator->hasNext()){ 
            $entry = $iterator->next(); 
            $adopt = $entry->getKey(); 
            $cost = $entry->getValue(); 

                $cells = new ArrayList; 
                $lvl = $adopt->getCurrentLevel(); 
                if ($lvl == 0) { $cells->add(new Comment("<a href='/myadopts/manage/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a>")); } 
                if ($lvl == 1) { $cells->add(new Comment("<a href='/myadopts/manage/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a>")); } 
                if ($lvl >= 2) { $cells->add(new Comment("<a href='/myadopts/manage/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}' width= '200px'></a>")); }  
                $cells->add(new Comment("<b>Name: </b>")); 
                $cells->add(new Comment("<b>Gender: </b>")); 
                $cells->add(new Comment("<b>Total Clicks: </b>")); 
                $aCells = new TCell($cells, "cell{$index}"); 
                $aCells->setAlign(new Align("center", "center")); 
} 
            $readoptTable->add($aCells); 
            $readoptForm->add($readoptTable);
            $document->add($readoptForm);
         
    }
 
Ooh, that's definitely on the right track! Thank you! It shows up but only 1 adoptable appears (and I know that there are 6 currently in the pound). :ooo:

EDIT: Also, I am not sure how to make it so that the adoptable is actually adopted... I've put in that when you click an adoptable it sends you to the adopt link, however, it doesn't like you having the ID included (but how else can I say what adoptable is adopted? lol XD) Sorry for the trouble aha ^_^"
 
Last edited:
I just found this post again lol XD I still need help with it, hmm... just had a tinker with it all and can't get anything working without an error popping up XD No idea what I need to do to get it working and in order....
 
I got it to work!

PHP:
public function index(){  
        $mysidia = Registry::get("mysidia");  
        $document = $this->document;      
        $document->setTitle($this->lang->title);          
        $document->addLangvar($this->lang->default);  
          
        $readoptHeader = new Comment("Pounded Adoptables for adoption");  
        $readoptHeader->setHeading(3);  
        $document->add($readoptHeader);  
          
        $readoptTable = new TableBuilder("readopttable");  
        $readoptTable->setAlign(new Align("center", "middle"));  
        $readoptTable->buildHeaders();  
        $readoptTable->setHelper(new AdoptTableHelper);  
          
          
        $pounds = $this->getField("pounds");          
        $iterator = $pounds->iterator();          
        while($iterator->hasNext()){  
            $entry = $iterator->next();  
            $adopt = $entry->getKey();  
            $cost = $entry->getValue();  
            if($adopt->getGender() == "m"){$gender = "Male";}
            if($adopt->getGender() == "f"){$gender = "Female";}

                $cells = new ArrayList;  
                $lvl = $adopt->getCurrentLevel();  
                if ($lvl == 0) { $cells->add(new Comment("<img src='{$adopt->getImage()}'></a>")); }  
                if ($lvl == 1) { $cells->add(new Comment("<img src='{$adopt->getImage()}'></a>")); }  
                if ($lvl >= 2) { $cells->add(new Comment("<img src='{$adopt->getImage()}' width= '200px'></a>")); }   
                $cells->add(new Comment("<b>Name:</b> {$adopt->getName()}"));  
                $cells->add(new Comment("<b>Gender:</b> {$gender}"));  
                $cells->add(new Comment("<b>Total Clicks:</b> {$adopt->getTotalClicks()}"));
                $readoptForm = new Form("readoptform", "pound/adopt", "post");
                $readoptForm->add(new PasswordField("hidden","aid", "{$adopt->getAdoptID()}", "yes"));
                $readoptForm->add(new Button("Adopt Me", "submit", "submit"));
		        $cells->add($readoptForm);
                $aCells = new TCell($cells, "cell{$index}");  
                $aCells->setAlign(new Align("center", "center"));
                $readoptTable->add($aCells);
}  
            $document->add($readoptTable); 
          
    }

Now it should show more than one pet. Here's what it looks like:
6281221048107008.png
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top