View Single Post
  #1  
Old 12-14-2016, 04:48 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 32,821
Ittermat is on a distinguished road
Default Adding trophies to user profile

I want to add trophies to a users profile- (by making a new tab and whatnot-)

our items are sorted by category, so if I could just put the items in the "trophy" category in their inventory in the tab that'd be awesome (that way when a user gets another one it automatically adds it.)... I just dunno how to do that...

I want the tab after "pets"
And Id like it to show the tooltip description on hover as well please

This is my profileview.php.

PHP Code:
<?php

use Resource\Native\String;
use 
Resource\Collection\LinkedHashMap;

class 
ProfileView extends View{
    
    public function 
index(){
        
$pagination $this->getField("pagination");
        
$users $this->getField("users");        
        
$document $this->document;    
        
$document->setTitle($this->lang->title);        
        
$document->addLangvar($this->lang->memberlist);
        
        
$iterator $users->iterator();
        while(
$iterator->hasNext()){
            
$entry $iterator->next();
            
$username = (string)$entry->getKey();
            
$usergroup = (string)$entry->getValue();
            if(
cancp($usergroup) == "yes"$document->add(new Image("templates/icons/star.gif"));
            
$document->add(new Link("profile/view/{$username}"$usernameTRUE));
        }
        
$document->addLangvar($pagination->showPage());
    }
    
    public function 
view(){
        
$mysidia Registry::get("mysidia");
        
$user $this->getField("user");
        
$profile $this->getField("profile");
        
$document $this->document;
        
$document->setTitle($this->lang->profile);

        
$profile->display("aboutme");

        
$document->add(new Comment('<div id="tabs" class="c-tabs no-js"><div class="c-tabs-nav">',false));
        
$document->add(new Comment('<a href="#" class="c-tabs-nav__link outer-nav__link is-active">Pets</a>
            <a href="#" class="c-tabs-nav__link outer-nav__link">Visitor Message</a>
    <a href="#" class="c-tabs-nav__link outer-nav__link">Friends</a>
    <a href="#" class="c-tabs-nav__link outer-nav__link">Contact Info</a>
    <a href="#" class="c-tabs-nav__link outer-nav__link">Trophies</a>
    </div>'
,false));

        
// Adopts Tab
        
$document->add(new Comment('<div class="c-tab outer-tab is-active">
    <div class="c-tab__content">'
,false));
        if(
$user->getadopts()) $document->addLangvar($this->lang->noadopts);
        else 
$profile->display("adopts");
     
        
// Visitor Message
        
$document->add(new Comment('</div></div><div class="c-tab outer-tab">
    <div class="c-tab__content">'
,false));
        
$vmTitle = new Comment($mysidia->input->get("user").$this->lang->VM_member);
        
$vmTitle->setBold();
        
$vmTitle->setUnderlined();
        
$document->add($vmTitle);
        
$profile->display("vmessages");
     
        if(!
$mysidia->user->isloggedin$document->addLangvar($this->lang->VM_guest);
        elseif(!
$mysidia->user->status->canvm$document->addLangvar($this->lang->VM_banned);
        else{
            
$document->addLangvar($this->lang->VM_post);
            
$vmForm = new Form("vmform""{$mysidia->input->get("user")}""post");
            
$vmForm->add(new PasswordField("hidden""user"$user->username));
            
$vmForm->add(new TextArea("vmtext"""450));
            
$vmForm->add(new Button("Post Comment""submit""submit"));
            if(
$mysidia->input->post("vmtext")){
                
$reminder = new Paragraph;
                
$reminder->add(new Comment("You may now view your conversation with {$user->username} from "FALSE));
                
$reminder->add(new Link("vmessage/view/{$mysidia->input->post("touser")}/{$mysidia->input->post("fromuser")}""Here"));
                
$document->addLangvar($this->lang->VM_complete);
                
$document->add($reminder);
            }    
            else 
$document->add($vmForm);
        }


        
// Friends.
        
$document->add(new Comment('</div></div><div class="c-tab outer-tab">
    <div class="c-tab__content">'
,false));
        
$profile->display("friends"$user);

        
// The last tab: Contact Info!    
        
$document->add(new Comment('</div></div><div class="c-tab outer-tab">
    <div class="c-tab__content">'
,false));
        
$user->getcontacts();
        
$user->formatcontacts();
        
$profile->display("contactinfo"$user->contacts);

        
$document->add(new Comment('</div></div>
</div>
<script src="/js/otherTabs.js"></script>
<script>
  var myTabs = tabs({
    el: "#tabs",
    tabNavigationLinks: ".outer-nav__link",
    tabContentContainers: ".outer-tab"
  });
  myTabs.init();

  var petTabs = tabs({
                    el: "#pettabs",
                    tabNavigationLinks: ".pet-nav",
                    tabContentContainers: ".pet-tab"
                });

                  petTabs.init();
</script>'
,false));
    }
}
?>
I finally have time to work on my site... sorry for all the questions~!
Reply With Quote