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-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,817
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
  #2  
Old 12-14-2016, 06:49 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,635
Dinocanid is on a distinguished road
Default

I'm afraid I don't exactly know how to work with the setup you have for the profile page since it seems to have a different way of showing the tabs. I can, however, say that this is how I add a new tab with the default code. Maybe it will point you in the right direction?

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");  
        
$tabsList = new LinkedHashMap;
        
$tabsList->put(new String("Visitor Message"), new String("visitormessage"));
        
$tabsList->put(new String("Adoptables"), new String("adopts"));
        
$tabsList->put(new String("Friends"), new String("friends"));
        
$tabsList->put(new String("Contact Info"), new String("contactinfo"));
        
$tabsList->put(new String("New tab"), new String("newinfo")); //This was added!
        
$tabs = new Tab(5$tabsList1); //And this!
        
$document->add(new Comment("<center>"));
        
$tabs->createtab();
     
        
// Here we go with the first tab content: Visitor Message
        
$tabs->starttab(0);
        
$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);
        }
        
$tabs->endtab(0);
     
        
// The third tab: Adopts...    
        
$tabs->starttab(1);
        if(
$user->getadopts()) $document->addLangvar($this->lang->noadopts);
        else 
$profile->display("adopts");

        
$tabs->endtab(1);
     
        
// The fourth tab: Friends...
        
$tabs->starttab(2);
        
$profile->display("friends"$user);
        
$tabs->endtab(2);

        
// The last tab: Contact Info!    
        
$tabs->starttab(3); 
        
$user->getcontacts();
        
$user->formatcontacts();
        
$profile->display("contactinfo"$user->contacts);
        
$tabs->endtab(3);
        
        
        
$tabs->starttab(4);  //This is the new tab!
        
$document->add(new Comment("Wow! Things!"));
        
$tabs->endtab(4);
    }
}
?>
To add a tooltip, you can use this code (I'm assuming you use the one from the shop and tooltip mod):
PHP Code:
$document->add(new Comment("<img rel='tooltip' title='Description!' src='DIRECT IMAGE LINK'/>")); 
__________________
Reply With Quote
  #3  
Old 12-14-2016, 07:03 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,817
Ittermat is on a distinguished road
Default

Sorry I appreciate the help but it doesnt help me at all XD
Reply With Quote
  #4  
Old 10-05-2018, 08:53 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 10,745
draugluin is on a distinguished road
Default

open classes / class_tab.php

find

PHP Code:
public function createtab(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        if(
$this->num or $this->num 5) throw new Exception("The number of tabs must be restricted between 2 to 5!",272); 
and change 5 to 6. ( two times ! )


then open css / tabs.css

find

PHP Code:
<style type="text/css">



body { }
html overflow-yscroll; }
text-decorationnone; }
a:focus outline0; }
margin0 0 20px 0; }
#page-wrap { width: 640px; margin: 30px;} 
and change the page-wrap width to 740px.


Hope, this helps
__________________
Reply With Quote
  #5  
Old 11-05-2018, 11:48 AM
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,817
Ittermat is on a distinguished road
Default

I got that part XD but now I have no idea how to make the Trophies actually appear

They're under the category "Trophy" in my items..

I tried this- and that didnt work.. >_<

//trophies
$document->add(new Comment('</div></div><div class="c-tab outer-tab">
<div class="c-tab__content">',false));
$user->getitem();
$profile->display("Trophy", $user);
Reply With Quote
  #6  
Old 11-06-2018, 01:42 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 10,745
draugluin is on a distinguished road
Default

Hmmm.... this works for me. try it...
(profileview.php)

you just have to change the names and the path.

PHP Code:
// The new tab    
        
$tabs->starttab(5); 
        
$document->add(new Comment("Throphies!<br> ")); 
        
        
$throphy $mysidia->db->select("inventory", array("itemname"), "category ='throphy' and owner='{$mysidia->user->username}' ");
             
        while(
$row $throphy->fetchObject()) {    
                  
$itemname $row->itemname;
                  
$document->add(new Comment("<img src='/pics/{$itemname}.png'>" ));
         }  
        
        
$tabs->endtab(5); 
__________________
Reply With Quote
  #7  
Old 11-06-2018, 08:51 AM
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,817
Ittermat is on a distinguished road
Default

I got it working (dinocanid helped me) but this thread will be supe useful for future tabs I may want to add- Thank you so much!

(Or if someone else needs to know how)
Reply With Quote
  #8  
Old 11-06-2018, 09:46 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 10,745
draugluin is on a distinguished road
Default

:) you're welcome.
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:34 AM.

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