MyBB Community Forums

Full Version: Edit Header Properly?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone. After attempting to edit header a few times to accomplish what I want for few days, I failed and would like to get some help in order to understand how to properly edit header. So, what I want to do first is, that I don't want "lower panel" to disappear if someone is not logged in, I want lower panel to stay visible at all time. I just want "menu panel links" and "menu user links" to disappear and maybe replace them with another text. The second thing is that I want to transport "welcome text" from "upper panel" to "menu top links".

Lastly, how can I make header (and footer) stay at the same size with "wrapper" whilst zooming in and out?

Any help is hugely appreciated. Thanks a lot already!

(I'm editing the default MyBB theme)
(2019-07-07, 12:26 PM)timelord Wrote: [ -> ]Hello everyone. After attempting to edit header a few times to accomplish what I want for few days, I failed and would like to get some help in order to understand how to properly edit header. So, what I want to do first is, that I don't want "lower panel" to disappear if someone is not logged in, I want lower panel to stay visible at all time. I just want "menu panel links" and "menu user links" to disappear and maybe replace them with another text. The second thing is that I want to transport "welcome text" from "upper panel" to "menu top links".

Lastly, how can I make header (and footer) stay at the same size with "wrapper" whilst zooming in and out?

Any help is hugely appreciated. Thanks a lot already!

(I'm editing the default MyBB theme)

header_welcomeblock_guest template:

put this:

<div class="lower">
	<div class="wrapper">
		<ul class="menu panel_links">
			{$usercplink}
			{$modcplink}
			{$admincplink}
		</ul>
		<ul class="menu user_links">
			{$buddylink}
			{$searchlink}
			{$pmslink}
		</ul>
	</div>
	<br class="clear" />
</div>

below

						<!-- Continuation of div(class="upper") as opened in the header template -->
						<span class="welcome">{$lang->welcome_guest} <a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;" class="login">{$lang->welcome_login}</a> <a href="{$mybb->settings['bburl']}/member.php?action=register" class="register">{$lang->welcome_register}</a></span>
					</div>
				</div>

the links i gave won't work, but you can put what you want into the bar now.

"Lastly, how can I make header (and footer) stay at the same size with "wrapper" whilst zooming in and out?"

what does this mean ?
(2019-07-07, 12:34 PM)Ashley1 Wrote: [ -> ]
(2019-07-07, 12:26 PM)timelord Wrote: [ -> ]Hello everyone. After attempting to edit header a few times to accomplish what I want for few days, I failed and would like to get some help in order to understand how to properly edit header. So, what I want to do first is, that I don't want "lower panel" to disappear if someone is not logged in, I want lower panel to stay visible at all time. I just want "menu panel links" and "menu user links" to disappear and maybe replace them with another text. The second thing is that I want to transport "welcome text" from "upper panel" to "menu top links".

Lastly, how can I make header (and footer) stay at the same size with "wrapper" whilst zooming in and out?

Any help is hugely appreciated. Thanks a lot already!

(I'm editing the default MyBB theme)

header_welcomeblock_guest template:

put this:

<div class="lower">
	<div class="wrapper">
		<ul class="menu panel_links">
			{$usercplink}
			{$modcplink}
			{$admincplink}
		</ul>
		<ul class="menu user_links">
			{$buddylink}
			{$searchlink}
			{$pmslink}
		</ul>
	</div>
	<br class="clear" />
</div>

below

						<!-- Continuation of div(class="upper") as opened in the header template -->
						<span class="welcome">{$lang->welcome_guest} <a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;" class="login">{$lang->welcome_login}</a> <a href="{$mybb->settings['bburl']}/member.php?action=register" class="register">{$lang->welcome_register}</a></span>
					</div>
				</div>

the links i gave won't work, but you can put what you want into the bar now.

"Lastly, how can I make header (and footer) stay at the same size with "wrapper" whilst zooming in and out?"

what does this mean ?


Thanks for the quick reply, it works like a charm! Any idea how to put welcome text on menu top links?

And, what I mean by that, let's say I zoom out from 100% to 50%. Whole wrapper stays at the same size all together. If wrapper is 1000px when the page is at 100%, it adjusts its size to 1500px when the page is at 50%, but in the meanwhile header and footer always stay at the same size, if their width is 1000px, it's always 1000px after zooming out (zooming in is not a problem). I'd like header and footer to always keep up with the wrappers size no matter what. I believe it doesn't really mean "responsive" so I didn't want to use that word.
The welcome text may not be possible because you need to move {$welcomeblock}. However you can achieve what you want with php in templates (plugin) and build the text you want.

I answered the same question regarding the header and footer here:
https://community.mybb.com/thread-223761.html
It'd be amazing if I could just "simply" move welcome text few pixels up (from .upper panel to menu.top_links). Isn't there an easy way to do this?
Install this plugin:
http://mybbhacks.zingaburga.com/showthread.php?tid=464

Then you can put:
<if $mybb->user['uid'] then>{$lang->welcome_back}<else>{$lang->welcome_guest}</if>

in the header template wherever you want it.
(2019-07-07, 01:46 PM)Ashley1 Wrote: [ -> ]Install this plugin:
http://mybbhacks.zingaburga.com/showthread.php?tid=464

Then you can put:
<if $mybb->user['uid'] then>{$lang->welcome_back}<else>{$lang->welcome_guest}</if>

in the header template wherever you want it.

If not logged in, instead of showing "Hello There, Guest! Login Register", it only shows "Welcome back, {1}. You last visited: {2}Hello There, Guest!"
If logged in, it shows "Welcome back, timelord. You last visited: Today, 02:44 PMHello There, Guest!"
It won't work if you don't install the plugin! And activate it.
(2019-07-07, 02:52 PM)Ashley1 Wrote: [ -> ]It won't work if you don't install the plugin! And activate it.

I thought I uploaded it on my FTP but it did give me an error, just noticed. Uploaded, activeted, works amazing right now. But lastly, is it possible to add a CSS style just to welcome text, such as style="color: #B99C74; margin-left:75px;"
<if $mybb->user['uid'] then><span class="welcome_back">{$lang->welcome_back}</span><else><span class="welcome_guest">{$lang->welcome_guest}</span></if>

add your style to global.css

.welcome_back {

}

.welcome_guest {

}
Pages: 1 2