Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Horizontal Sidebar (http://www.mysidiaadoptables.com/forum/showthread.php?t=4742)

Abronsyth 12-23-2014 07:21 AM

Horizontal Sidebar
 
I used to be able to do this without much pain, but since some of the more recent Mys versions, I am no longer sure how to do this!

Trying to set it up like so:
Logged In User sees:
Username $000000 Messages Inventory Pets Logout
(Link to account, link to donate page, link to messages, inventory, etc.)

Logged In Staff sees:
Username $000000 Messages Inventory Pets Logout ACP

Guest sees:
Username: [input box here] Password: [input box here] Login or Register

I am looking through class_sidebar right now, and I am quite sure this is where I need to do the editing, but as I said I no longer actually know how. If someone could help out a bit, it would be greatly appreciated (and would help me to be able to start releasing some themes XD)

Kyttias 12-23-2014 02:02 PM

The links that appear there are done in the AdminCP (Links -> Edit a link, down past the navlinks are the sidelinks), or, you can modify the database table _links (which might even be a little faster - you can double click any of the fields in phpMyAdmin to edit them in place).

As for making the bar horizontal rather than vertical, this depends a bit on your theme and a bit of css. This should work if you're building a theme from scratch (it has some extra styling, for example purposes):
HTML Code:

.sidebar { text-align: center; }
.sidebar ul
{
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
display: inline;
}

.sidebar ul li { display: inline; }
.sidebar p { display: inline; }

.sidebar ul li a
{
margin: 1px;
padding: 2px;       
text-decoration: none;
padding: .2em 1em;
color: #fff;
background-color: #036;
}

.sidebar ul li a:hover
{
color: #fff;
background-color: #369;
}

But if you're using the "Main" theme, for example, #menu a in your stylesheet will be modifying all the links inside your sidebar, and you'd have to get very specific with your styling. It'll actually be easier if you just go on into the "Main" theme's template.tpl and simply remove id="menu" from the <td> surrounding the {$sidebar} (keep the td there, of course). Then add a <tr> before <td id="content">.

If you're using "Bootstrap" then you'll need to change the class on the ul element in the sidebar to btn-group-horizontal. To do this, you'll need to open up js-kyt.js, scroll down to the section of codes that are modifying the sidebar, and observe how the class name is being changed based on the screen width. Just change any instance of .addClass("btn-group-vertical"); to .addClass("btn-group-horizontal"); (PS: I apologize ahead of time if this has complicated anything.)

Custom theme? You'll need to give that sidebar room to exist horizontally across the page. I'll leave this to you, as I'm sure you've figured it out? There is a css class of "sidebar" actually attached to the sidebar contents deep in the PHP somewhere, so the sidebar will always have it, so there's no need to put {$sidebar} inside a div of it's own with class or id.

The first two things on this horizontal sidebar, the username and their cash amount, are not in the list itself, but actually rendered in paragraph elements. They exist entirely in class_sidebar.

I'd remove or comment out these from function setLinksBar():
PHP Code:

$linkTitle = new Comment("{$mysidia->user->username}'s Links:");
$linkTitle->setBold();
$this->linksBar->add($linkTitle); 

In function setMoneyBar(), modify this line to suit your needs (scrap the Welcome, remove the <br/>, etc):
PHP Code:

 $this->moneyBar->add(new Comment("Welcome, {$mysidia->user->username}. <br/> You have {$mysidia->user->money} {$mysidia->settings->cost}.")); 

*This line will automatically add in a linebreak unless you add in a comma and FALSE after the end quote. Also? I had trouble snuggling up a $ to {$mysidia->user->money}. If you have your heart set on it, I managed to make them get along by concatenating them:
PHP Code:

$this->moneyBar->add(new Comment("{$mysidia->user->username} $".$mysidia->user->money.""FALSE)); 

In the same function, you can remove or comment out this line:
PHP Code:

$donate->setText("Donate Money to Friends"); 

And finally, in function setWolBar(), you can remove or comment out this line:
PHP Code:

$this->wolBar->setText("This site has {$online} members and {$offline} guests online."); 

That should cover it, aside from getting the css spiffed up in a way you like it.

edit: I'm not as sure how the login will display, but I'm sure it's nothing some css can't spruce up.


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.