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 01-05-2016, 12:25 AM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,690
tahbikat is on a distinguished road
Default Reconstructing profile page, halp? :c

I'm trying to reconstruct profile pages. I want to remove the tabs. Not a big fan of them.

This is basically what I'm trying to do (just a mockup): http://i.imgur.com/W7jwLeV.png


I've managed to figure out how to edit the About Me section and such in the class_userprofile.php, however, I'd like the friends and the Adoptables sections to display on pages similar to what's on the myadopts.php page (or see mockup above). Could anyone help me with this? :c It would look sooo much better and load so much faster.

edit: Also can't seem to figure out how to get the spotlight adopt to display in the about me part.

Also you can see what I've done so far here (very big mess, beware!) http://mysgardia.com/profile/view/Lavie

Last edited by tahbikat; 01-05-2016 at 06:23 AM.
Reply With Quote
  #2  
Old 01-05-2016, 09:41 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,542
Abronsyth is on a distinguished road
Default

Well, for the favepet, the lines here in .../classes/class_userprofile.php are what display the favepet on the adoptables tab:
PHP Code:
      $document->add($this->favpet);
      
$document->add(new Comment($this->about)); 
I just copied those lines and added it to the about me tab like this;
PHP Code:
  private function aboutme(){
      
$mysidia Registry::get("mysidia");    
      
$document $mysidia->frame->getDocument();
      
$title = new Comment($mysidia->lang->basic.$mysidia->input->get("user"));
      
$title->setBold(TRUE);
      
$title->setUnderlined(TRUE);
      
$membersince $mysidia->db->select("users", array("membersince"), "username = '{$mysidia->input->get("user")}'")->fetchColumn();      
      
$basicinfo "<br><strong>Member Since:</strong> {$membersince}<br>
                    <strong>Gender:</strong> 
{$this->gender}<br>
                    <strong>Favorite Color:</strong> 
{$this->color}<br>
                    <strong>Nickname:</strong> 
{$this->nickname}<br>
                    <strong>Bio:</strong> 
{$this->bio}";
      
      
$document->add($title);
      
$document->add(new Image($this->avatar"avatar"100));
      
$document->add(new Comment($basicinfo));
      
$document->add($this->favpet);
      
$document->add(new Comment($this->about));
  } 
And as you can see here, it displays just fine.

As for the rest...well I know the adoptables section is done primarily through tables. If you want them to appear on separate pages then I believe you're going to need to build new pages to display the information. I'm going to play around with tables to see if I can get the pets, at least, to display like how you have it in your mockup.

EDIT:
OK, I got the pets to display in a table like they do on the myadopts page, the only issue is that when a user has a lot of pets you'll probably want to be able to go to another page of pets, and that's something I'm still working on.
PHP Code:
      $title = new Comment("{$mysidia->input->get("user")}'s Pets:");
      
$title->setBold(TRUE);
      
$title->setUnderlined(TRUE);
      
$document->add($title);
        
$adoptTable = new TableBuilder("adopttable"650);
        
$adoptTable->setAlign(new Align("center""middle"));
        
$adoptTable->buildHeaders("Creature""Name""Species""Level""Points");
      
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->input->get("user")}'");
      while(
$id $stmt->fetchColumn()){
            
$adopt = new OwnedAdoptable($id);
            
$cells = new LinkedList;
            
$cells->add(new TCell(new Comment("<a href='http://mysgardia.com/levelup/click/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'/></a>")));
            
$cells->add(new TCell("{$adopt->getName()}"));
            
$cells->add(new TCell("{$adopt->getType()}"));
            
$cells->add(new TCell($adopt->getCurrentLevel()));
            
$cells->add(new TCell($adopt->getTotalClicks()));
            
$adoptTable->buildRow($cells);
        }
        
$document->add($adoptTable);
    } 
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 01-05-2016 at 11:43 AM.
Reply With Quote
  #3  
Old 01-05-2016, 05:42 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,478
Kyttias is on a distinguished road
Default

Okay, well, friend list stuff. I see you've already managed to move it over to the page, which is a good first step.

So let's trace where these functions go. (Feel free to skip over if you just want to get to the good part.)

  Spoiler: Lead Up 
In profileview.php, a display() is called:
PHP Code:
$profile->display("friends"$user); 
With $profile being set earlier up the page:
PHP Code:
$profile $this->getField("profile"); 
This means it's been set on the non 'view' version of the page, so over to profile.php:
PHP Code:
$this->profile $this->user->getprofile(); 
It seems a bit of a jump, but getprofile() is exists in classes/class_member.php, and inside, this is called:
PHP Code:
$this->profile = new UserProfile($this->uid); 
And that's basically what I was looking for - a declaration of new Something I now know to look for the display function - yeah that thing from the start - in classes/class_userprofile.php. I could have guessed that from the start, but, I figured it was worth showing you how it all connects.

No need to change the display function. It's still what you need to call - and it's called by a few other things. Based on the parameters, it'll just display a different part of the page. Easy!
PHP Code:
$this->getfriends($data); 

So you want to find private function getfriends($user) in classes/class_userprofile.php, and this is where the fun begins. Here is where you'll find the title of the section, a count of how many friends the user has, a button to befriend the user (which only displays if you aren't that user, of course), and a notification that will display (if they are visiting their own page) if they have pending friend requests. You'll want to figure out what you're doing with that.

But $friendlist->display(); is also called, and
PHP Code:
$friendlist = new Friendlist($user); 
tells us that we can look in classes/class_friendlist.php for another display function - which is doing a lot of the real dirty work.

Okay, but when you find it, you'll see that it's a table. You'll probably want to break out of that, so we're still going to take advantage of the foreach loop going on. There are three things in this table - firstly, the user avatar. Secondly, a delete friend button that will only show if you are visiting your own profile. And then thirdly - all the rest of the info.

The rest of the info is being pulled from classes/class_friendtablehelper.php, in the getFriendInfo function. We should try to avoid a call to it if possible, so let's take a look to pull over information that we want from it. Doesn't look too bad.

So our real enemy is rewriting that foreach loop in classes/class_friendlist.php's display function to not use a table. Let's use some divs?

Save a copy of what's already there as a back up. Otherwise, try replacing the display function with this:
PHP Code:
public function display(){
        
// Display the user's friendlist     
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();

        if(!
$this->isfriend($mysidia->user->uid) and $this->privacy == "protected") return FALSE;
        elseif(!
$this->fids) return FALSE;
        else {
            foreach(
$this->fids as $fid){
                
$friend = new Member($fid);    
                
$document->add(new Comment("<div style='display: inline-block; text-align: center;'>
                    
{$friend->username}
                    <br>
                    <a href='../../profile/view/
{$friend->username}'>(Visit Profile)</a>
                    <br>
                    <a href='../../messages/newpm/
{$friend->username}'>(Send Message)</a>
                    "
FALSE));
               
                if(!empty(
$mysidia->user->username) and $this->user == $mysidia->user->username){
                    
$document->add(new Comment("<br><a href='../../friends/delete/{$friend->uid}'>(Remove Friend)</a>"FALSE));
                }

                
$document->add(new Comment("</div>"FALSE));
            }            
        }
        
// End of the display method
    

Does that help?
__________________
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.

Last edited by Kyttias; 01-05-2016 at 06:03 PM.
Reply With Quote
  #4  
Old 01-05-2016, 06:33 PM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,690
tahbikat is on a distinguished road
Default

Thank you guys!

@Abronsyth, thank you! It looks much better now, even if not paginated. Gonna see if I can figure it out. Probably take me a while though lol.

@Kyttias, I'm gonna add your code soon and let you know how it works! Thank you for explaining everything. <3
edit: Thank you Kyttias! Looks so nice and sleek now. :D

Last edited by tahbikat; 01-05-2016 at 09:58 PM.
Reply With Quote
  #5  
Old 01-06-2016, 07:16 AM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,690
tahbikat is on a distinguished road
Default

Humm, does anyone know how I could apply css styles to only the adopt, market, stats, etc tables? If I try to style them as is, it of course styles the container table too.

edit: oh and Abron, with the Spotlight Adopt, I wanted it to float to the right of the about me section, but I'm not sure how to do that with how it's currently written. :c

Last edited by tahbikat; 01-06-2016 at 07:30 AM.
Reply With Quote
  #6  
Old 01-06-2016, 09:47 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,542
Abronsyth is on a distinguished road
Default

If you show me how it's currently written I may be able to help, I've played around with getting images to display properly a lot, hehe.

As for the tables...if you give the tables a specific ID then you can style each individual one in the CSS...now I'm not very good with PHP tables but I *think* that the ID for, say, the myadopts table (and the way I've set it up the table that displays user pets on profiles as well), is "adopttable", so in CSS you could edit it with;
Code:
#adopttable { }
Edit:
I tested this and it works :D
#adopttable: myadopts table
#top10: Top 10 adoptables on stats page
#rand5: "5 random adoptables" table on stats page
#shoplist: market

((I have not tested for any others aside from adopttable yet!))

Edit 2:
The .../adopt.php page's table is simply ID'd as "table," so you might want to change that (line 37 in .../view/adoptview.php) to something else so that you can use CSS to customize it :)
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 01-06-2016 at 10:00 AM.
Reply With Quote
  #7  
Old 01-06-2016, 10:29 AM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,690
tahbikat is on a distinguished road
Default

Awww yess thank you so much! I'll experiment with this later! <3
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


All times are GMT -5. The time now is 02:11 PM.

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