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 12-20-2014, 01:58 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,503
parayna is on a distinguished road
Default My Adopts Page

Does anyone know how to edit the TCells in the myadoptsview.php file? I am attempting to make it so that your adoptables show up side by side (maybe more than 2 in a row if I can find out a way to auto size them smaller). But I have been trying to edit them for 4 hours now and I am officially lost... I have managed to get it down to where it just shows their image but I don't want that... I want it to also show their gender, their total clicks and their name. So this is what it looks like so far:

  Spoiler: Image 


Basically, I want the table GONE. I don't like it. And for some reason it won't get rid of the black even when I go into the CSS file and try and manually make the border white... unless it has a shadow and I haven't spotted it? All it seems to have done is make it appear smaller/thinner...


Anyway, what I want now is for it to appear in this format:

IMAGE
NAME
GENDER
TOTAL CLICKS

And for that to continue along the whole page and then go down and start a new row once it reaches the end of the wrapper. Basically, I want it to look like the daycare. I have been looking at the daycare file and attempting to copy across similar commands but it isn't working as I don't think it is compatible if I just change stuff >.< So... it's irritating me now. And I didn't want to ask for help as I want to learn how to do stuff myself now, but without a teacher here to tell me what to do and show me at the same time, learning is going to be VERY hard.. but I will have to just try and find some books or something when I can and see if they help me.

But for now, can anyone help me? ^_^ Thank you..
Reply With Quote
  #2  
Old 12-20-2014, 03:22 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,376
IntoRain is on a distinguished road
Default

Well, when you are new to something, you will need people's help in some way or another (directly asking questions or reading guides made by others) to go through the initial learning process. So don't feel bad for asking questions

Alright, when we want to do something, we should write down the process. It will make it easier to translate into coding.

1) We take all the adoptables owned by the person
2) We set a limit of how many adoptables will be displayed per row
3) With the number of adoptables (for example, 30) and the limit (for example, 5), we can get the number of rows our table will have (30/5 = 6)
5) To go through all rows, we need a for() cycle.
6) We need to display 5 adoptables per row, so we make an internal for() cycle

PHP Code:

use Resource\Collection\ArrayList;//add this to use ArrayLists
//rest of code here

    
public function index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($this->lang->title);
 
        
$pagination $this->getField("pagination");
        
$stmt $this->getField("stmt")->get();
        if(
$stmt->rowCount() == 0){
            
$document->addLangvar($this->lang->empty);
            return;
        }

//new code starts here:

            
$adoptTable = new Table("adopttable"""false);    
    
        
$numAdoptsPerRow 5;
        
$total $stmt->rowCount();
        
$numTotalRows ceil($total $numAdoptsPerRow);

        
$index 0;

//this is a copy from the table in the Daycare:
        
for($row 0$row $numTotalRows$row++){//for cycle to write the rows
            
$aRow = new TRow("row{$row}");
            for(
$column 0$column $numAdoptsPerRow$column++){//internal for cycle for the columns
                    
$adopt = new OwnedAdoptable($stmt->fetchColumn());
                
$cell = new ArrayList;
                
$cell->add(new Comment("<a href='/levelup/click/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a>"));
                
$cell->add(new Comment("<b>Name:</b>{$adopt->getName()}"));
                
$cell->add(new Comment("<b>Gender:</b>{$adopt->getGender()}"));
                
$cell->add(new Comment("<b>Clicks:</b>{$adopt->getTotalClicks()}"));
                
$aCell = new TCell($cell"cell{$index}");
                
$aCell->setAlign(new Align("center""center"));
                
$aRow->add($aCell);
                
$index++;
                if(
$index == $total) break;
            }
            
$adoptTable->add($aRow);            
        }
        
        
$document->add($adoptTable);
        
$document->addLangvar($pagination->showPage());
    } 
__________________


asp.net stole my soul.
Reply With Quote
  #3  
Old 12-20-2014, 04:12 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,503
parayna is on a distinguished road
Default

Thank you. I guess it just get's frustrating not having anyone physically being here to teach me and so I get a bit frustrated when I don't get something XD Do you know how to change the line:

PHP Code:
$cell->add(new Comment("<a href='/levelup/click/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a>")); 
to something like:

PHP Code:
$cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}'></a>")); 
because that up there ^ doesn't work XD I kind of want it to still link to the stats page as then people can still access the codes and trading options and stuff...
Reply With Quote
  #4  
Old 12-20-2014, 06:26 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,376
IntoRain is on a distinguished road
Default

Ah, I forgot about that! Sorry!

PHP Code:
$aid $stmt->fetchColumn();
$adopt = new OwnedAdoptable($aid);
                
$cell = new ArrayList;
                
$cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}'></a>"));
                
$cell->add(new Comment("<b>Name:</b>{$adopt->getName()}"));
                
$cell->add(new Comment("<b>Gender:</b>{$adopt->getGender()}"));
                
$cell->add(new Comment("<b>Clicks:</b>{$adopt->getTotalClicks()}")); 
__________________


asp.net stole my soul.
Reply With Quote
  #5  
Old 12-20-2014, 07:01 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,503
parayna is on a distinguished road
Default

Thanks! It worked! XD
Reply With Quote
  #6  
Old 12-20-2014, 07:53 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,503
parayna is on a distinguished road
Default

Do you know how to make it so that the genders appear as 'Female' and 'Male' not 'f' and 'm'? I tried editing the array in the deep down core and that works, but stops everything recognising them as male and female (basically breeding doesn't work XD) because I would need to edit everything and anything that specifies their genders. When I put them back to 'm' and 'f' in the table, the adoptables showed back up as available.. and then promptly banned me for modifying the genders XD So I put the files back to normal, but would like to know how to make the gender appear as words?

Could you do a command where it gets the gender, senses whether it is 'f' or 'm' and then inputs Female or Male instead of the letter? (Just for the word on the adopt page, really)

Thanks~
Reply With Quote
  #7  
Old 12-20-2014, 08:17 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,349
Kyttias is on a distinguished road
Default

If this is doing what I think it's doing, then it's something I had plans for over break, yay~ headstart!

As for gender, try this:
PHP Code:
if ($adopt->getGender() == "m") { $gender "Male"; }
if (
$adopt->getGender() == "f") { $gender "Female"; } 
Or possibly this, if the above isn't going to work:
PHP Code:
 $gender_lookup $mysidia->db->select("owned_adoptables", array("gender"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if (
$gender_lookup == "m") { $gender "Male"; }
if (
$gender_lookup == "f") { $gender "Female"; } 
Place either below
PHP Code:
$adopt = new OwnedAdoptable($aid); 
And replace {$adopt->getGender()} with just {$gender}.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #8  
Old 12-20-2014, 08:28 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,503
parayna is on a distinguished road
Default

No, it doesn't quite work. It get's rid of the m and f but's replaces it with nothing. It just shows 'Gender:'

This is what I have:

PHP Code:
                $aid $stmt->fetchColumn();
                
$adopt = new OwnedAdoptable($aid);
                
$gender_lookup $mysidia->db->select("owned_adoptables", array("gender"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
                if (
$gender_lookup == "m") { $gender "Male"; }
                if (
$gender_lookup == "f") { $gender "Female"; }  
                
$cell = new ArrayList
                
$cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}'></a>"));
                
$cell->add(new Comment("<b>Name: </b>{$adopt->getName()}"));
                
$cell->add(new Comment("<b>Gender: </b>{$Gender}"));
                
$cell->add(new Comment("<b>Clicks: </b>{$adopt->getTotalClicks()}")); 
Thanks ~
Reply With Quote
  #9  
Old 12-20-2014, 08:31 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,349
Kyttias is on a distinguished road
Default

Use $gender. Not $Gender.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #10  
Old 12-20-2014, 08:34 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,503
parayna is on a distinguished road
Default

Oh! XD Alright XD Yes, thank you, it worked XD

Silly mistake :P

Thanks XD
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
Placing descriptions on the My Adopts page Vaporman87 Questions and Supports 7 02-21-2014 02:02 PM
Pagination/ My Adopts Page Missy Master Suggestions and Feature Requests 13 01-23-2011 08:37 PM
Neater Adopts Page LilPixie Questions and Supports 0 09-06-2009 10:14 PM
My Adopts Page Seapyramid Addons/Mods Graveyard 8 05-02-2009 03:04 PM


All times are GMT -5. The time now is 07:48 AM.

Currently Active Users: 9735 (0 members and 9735 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