Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2020, 04:02 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 51,506
Micolai is on a distinguished road
Arrow Displaying different usergroup titles on profiles

I wanted to add a title to my members profile pages where it listed what type member they are. So, with the help of my friend, Ittermat, we figured out how to get the call to work that will display whatever the member's group is. I know that's probably to most a very simple code, but I don't know anything about PHP lol I only know HTML and CSS. So, anyway, below is how we got it to work.

- Open up your File Manager, and open class_userprofile.php
- Go around to about line 116. It should be the Private Function aboutme area. In here is where you can type in whatever you want, but I used 'Title'.

So, at the top of the other account information that was already there is where I placed my title area, but you can put it anywhere in here or call it something different. Here is my code:

Quote:
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();
$line = $mysidia->db->select("online", array("username"), "username = '{$mysidia->input->get("user")}'")->fetchColumn();
if($line == $mysidia->input->get("user")){$online = "<font color=green>Online</font>";}else{$online = '<font color=red>Offline</font>';}
$basicinfo = "<br><strong>Member Since:</strong> {$membersince}<br>
<br>
Online Status: {$online}</br>
Title: {$usergroup}<br>
Gender: {$this->gender}<br>
Name: {$this->nickname}<br>
<br>
Bio: {$this->bio}";

$document->add($title);
$document->add(new Image($this->avatar, "avatar", 100));
$document->add(new Comment($basicinfo));
$document->add(new Comment(""));
}
So you need to add this code under your {$membersince code:

Quote:
$usergroup = $mysidia->db->select("users", array("usergroup"), "username = '{$mysidia->input->get("user")}'")->fetchColumn();
$groups = $mysidia->db->select("groups", array("groupname"), "gid = '{$usergroup}'")->fetchColumn();
Then add in your basic info area:

Quote:
Title: {$groups}
and that's it! Hope this helps someone.

Note: You can also use this to call other things, too. Similar to the public pet profiles that call rarity and what not.

Once I learn more about how to add things that isn't already part of the framework I'll edit this post to also talk about how to go about creating the thing you're wanting to have. Say, you want to be able to use a rarity since that's not something already in the Mysidia framework, you would have to add it to the database and go to a few areas in the files and add some code before it would call and display right. I already have added a rarity system into my site so I can re-look at how I did that and edit this topic with a tutorial.

Whelp, that's it! :]
__________________
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion

Last edited by Micolai; 06-18-2020 at 03:04 PM.
Reply With Quote
  #2  
Old 06-16-2020, 06:42 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 51,506
Micolai is on a distinguished road
Default

Delete this reply post, code is fixed.
__________________
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion

Last edited by Micolai; 06-17-2020 at 11:05 AM.
Reply With Quote
Reply

Tags
display, profile, title, usergroup, usergroups


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 12:52 AM.

Currently Active Users: 708 (0 members and 708 guests)
Threads: 4,081, Posts: 32,032, 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