Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2014, 02:37 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,510
Abronsyth is on a distinguished road
Default Remove name and description on adoption page

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
Reply With Quote
  #2  
Old 08-06-2014, 02:26 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,142
Hall of Famer is on a distinguished road
Default

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

PHP Code:
        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 Code:
        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. ^^
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 08-13-2014, 12:18 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,510
Abronsyth is on a distinguished road
Default

I can't seem to find the directory "view?"

I am using version 1.3.3, if that changes anything.
Reply With Quote
  #4  
Old 08-13-2014, 01:46 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,142
Hall of Famer is on a distinguished road
Default

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?
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 08-13-2014, 03:05 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,510
Abronsyth is on a distinguished road
Default

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 Code:
<?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") != 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"1TRUE);
        
$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);    
    }
}
?>
Reply With Quote
  #6  
Old 08-13-2014, 03:17 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,142
Hall of Famer is on a distinguished road
Default

Quote:
Originally Posted by Abronsyth View Post
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 Code:
                $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 Code:
                $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); 
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 08-13-2014, 03:25 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,510
Abronsyth is on a distinguished road
Default

Awesome! Worked like a charm!

Many thanks to you, HoF!
Reply With Quote
  #8  
Old 08-13-2014, 03:28 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,142
Hall of Famer is on a distinguished road
Default

You are very welcome. ^^ I am glad to help like always.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search engine description edit? Ruinily Questions and Supports 14 06-20-2013 03:42 PM
Description Writer(s) Needed! AlexC Staff Central 11 03-26-2012 03:53 PM
Pet description Kyris Questions and Supports 5 01-31-2011 07:30 AM
Pet description Koppa Questions and Supports 6 04-05-2010 03:36 PM
Adoptable description is.... where? mugwumpr Questions and Supports 4 04-19-2009 05:06 PM


All times are GMT -5. The time now is 12:33 PM.

Currently Active Users: 9826 (0 members and 9826 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636