Remove name and description on adoption page

Forum
Last Post
Threads / Messages

Abronsyth

A Headache Embodied
Member
Joined
Aug 25, 2011
Messages
1,012
Points
36
Location
NY
Mysidian Dollar
73,285
Hello!

I was wondering how I should properly remove the "type" and "description" from the adopt page?

I think I see where to edit it, but I don't want to risk breaking it ^_^

Thanks!
Abron
 
In script file view/adoptview.php, you can find this for loop at around line 40:

PHP:
        for($i = 0; $i < $adopts->length(); $i++){
            $row = new TRow;
            $idCell = new TCell(new RadioButton("", "id", $adopts[$i]->getID()));                
            $imageCell = new TCell(new Image($adopts[$i]->getEggImage(), $adopts[$i]->getType()));
            $imageCell->setAlign(new Align("center"));
                
            $type = new Comment($adopts[$i]->getType());
            $type->setBold();
            $description = new Comment($adopts[$i]->getDescription(), FALSE);
            $typeCell = new TCell;
            $typeCell->add($type);
            $typeCell->add($description);            

            $row->add($idCell);
            $row->add($imageCell);
            $row->add($typeCell);
            $adoptTable->add($row);
        }

You can change it to this:

PHP:
        for($i = 0; $i < $adopts->length(); $i++){
            $row = new TRow;
            $idCell = new TCell(new RadioButton("", "id", $adopts[$i]->getID()));                
            $imageCell = new TCell(new Image($adopts[$i]->getEggImage(), $adopts[$i]->getType()));
            $imageCell->setAlign(new Align("center"));

            $row->add($idCell);
            $row->add($imageCell);
            $adoptTable->add($row);

Thus the cell that contains type/description will be gone, but keep in mind your site may look a bit weird with some blank space that doesnt fit well. Lemme know if anything weird happens. ^^
 
I can't seem to find the directory "view?"

I am using version 1.3.3, if that changes anything.
 
Oh I see, yeah version 1.3.3 does not separate controller from view so you dont have separate view files. I dont have version 1.3.3 source code with my new laptop now, can you post adopt.php here so I can help you sort out?
 
I have it right here. I can see where I need to change it, but I'm still uneasy about PHP, so I don't want to break it, haha.
PHP:
<?php

class AdoptController extends AppController{

	private $view;
	private $subController;

    public function __construct(){
        parent::__construct("member");
		$mysidia = Registry::get("mysidia");
		if($mysidia->usergroup->getpermission("canadopt") != "yes"){
		    throw new NoPermissionException("It appears that you are either not logged in, or do not have permission to adopt.");
		}	
    }
	
	public function index(){
	    $mysidia = Registry::get("mysidia");
		$document = $mysidia->frame->getDocument();
		
	    if($mysidia->input->post("submit")){
		    $this->flag = "member";
	        $this->handleAccess();
			if($mysidia->session->fetch("adopt") != 1 or !is_numeric($mysidia->input->post("id"))) throw new InvalidIDException($mysidia->lang->global_id);
			
			$adopt = new Adoptable($mysidia->input->post("id"));			    
			$conditions = $adopt->getConditions();
			if(!$conditions->checkConditions()) throw new NoPermissionException("It appears that you do not meet the condition to acquire this adoptable.");
			
			$name = (!$mysidia->input->post("name"))?$adopt->getType():$mysidia->input->post("name");
		    $alts = $adopt->getAltStatus();
		    $code = $adopt->getCode();
			$gender = $adopt->getGender();
		    $mysidia->db->insert("owned_adoptables", array("aid" => NULL, "type" => $adopt->getType(), "name" => $name, "owner" => $mysidia->user->username, "currentlevel" => 0, "totalclicks" => 0, "code" => $code, 
			                                            "imageurl" => NULL, "usealternates" => $alts, "tradestatus" => 'fortrade', "isfrozen" => 'no', "gender" => $gender, "lastbred" => 0));
		    			
			$aid = $mysidia->db->select("owned_adoptables", array("aid"), "code='{$code}' and owner='{$mysidia->user->username}'")->fetchColumn();
            $document->setTitle("{$name} adopted successfully");
			
		    $image = new Image($adopt->getEggImage());
			$image->setLineBreak(TRUE);
			
			$document->add($image);
			$document->addLangvar("Congratulations!  You just adopted {$name}.  You can now manage {$name} on the ");
			$document->add(new Link("myadopts", "Myadopts Page."));
			$document->add(new Comment(""));
			$document->add(new Link("myadopts/manage/{$aid}", "Click Here to Manage {$name}"));
			$document->add(new Comment(""));
			$document->add(new Link("myadopts/bbcode/{$aid}", "Click Here to get BBCodes/HTML Codes for {$name}"));
			$document->add(new Comment(""));
			$document->addLangvar("Be sure and");
			$document->add(new Link("levelup/{$aid}", "feed "));
			$document->addLangvar("{$name} with clicks so that they grow!");
		    return;
		}
		
		$mysidia->session->assign("adopt", 1, TRUE);
		$default = (!$mysidia->user->isloggedin)?$mysidia->lang->guest:$mysidia->lang->member;
		$document->setTitle($mysidia->lang->title);
        $document->addLangvar($default);  
        $ids = $mysidia->db->select("adoptables", array("id"), "shop='none'")->fetchAll(PDO::FETCH_COLUMN);

        $adoptForm = new Form("form", "adopt", "post");
		$adoptTitle = new Comment("Available Adoptables");
		$adoptTitle->setHeading(3);
		$adoptForm->add($adoptTitle);
		$adoptTable = new Table("table", "", FALSE);
 
		foreach($ids as $id){
		    $adopt = new Adoptable($id);
			$conditions = $adopt->getConditions();
			
	        if($conditions->checkConditions()){
			    $row = new TRow;
				$idCell = new TCell(new RadioButton("", "id", $id));				
				$imageCell = new TCell(new Image($adopt->getEggImage(), $adopt->getType()));
				$imageCell->setAlign(new Align("center"));
				
				$type = new Comment($adopt->getType());
				$type->setBold();
                $description = new Comment($adopt->getDescription(), FALSE);
				$typeCell = new TCell;
                $typeCell->add($type);
                $typeCell->add($description);			

				$row->add($idCell);
				$row->add($imageCell);
				$row->add($typeCell);
                $adoptTable->add($row);
	        }
        }
		if(!$ids) $adoptForm->add(new Comment("There is not an adoptable available at this point, please come back later."));
		else $adoptForm->add($adoptTable);
		
		$adoptSubtitle = new Comment("Adopt");
		$adoptSubtitle->setHeading(3);
		$adoptForm->add($adoptSubtitle);
		$adoptForm->add(new Comment("Adoptable Name: ", FALSE));
		$adoptForm->add(new TextField("name"));
		$adoptForm->add(new Comment(""));
        $adoptForm->add(new Button("Adopt Me", "submit", "submit"));
        $document->add($adoptForm);	
	}
}
?>
 
I have it right here. I can see where I need to change it, but I'm still uneasy about PHP, so I don't want to break it, haha.

Yup, you just have to remove anything related to the variable $typeCell. Here you goes, locate these lines:

PHP:
                $row = new TRow; 
                $idCell = new TCell(new RadioButton("", "id", $id));                 
                $imageCell = new TCell(new Image($adopt->getEggImage(), $adopt->getType())); 
                $imageCell->setAlign(new Align("center")); 
                 
                $type = new Comment($adopt->getType()); 
                $type->setBold(); 
                $description = new Comment($adopt->getDescription(), FALSE); 
                $typeCell = new TCell; 
                $typeCell->add($type); 
                $typeCell->add($description);             

                $row->add($idCell); 
                $row->add($imageCell); 
                $row->add($typeCell); 
                $adoptTable->add($row);

Replace them by:

PHP:
                $row = new TRow; 
                $idCell = new TCell(new RadioButton("", "id", $id));                 
                $imageCell = new TCell(new Image($adopt->getEggImage(), $adopt->getType())); 
                $imageCell->setAlign(new Align("center"));          
                $row->add($idCell); 
                $row->add($imageCell); 
                $adoptTable->add($row);
 

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