Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Adding something to a Header

Aloittaja Surf3rDud3, marraskuu 14, 2011, 06:23:49 AP

« edellinen - seuraava »

Surf3rDud3

Hello... I was wondering if anyone can help me out with something small?

Id like to have a button in the header... Of course id make the button and stuff but i need some help on where to edit this and how difficult it would be to do so.

What I am wanting to create is a Join Server Button for my bf3 server and id like it up there so when other join they can click it and it sends them to the battlelog page...

Version: 2.0.1
Theme: Modified DarkBreak 2.0



I thought maybe had something to do with this in the index.css
#logo {
position: absolute;
top: 0;
left: 0;
display: block;
width: 320px;
height: 85px;
background: url(../images/custom/logo.gif) no-repeat;
cursor: pointer;
}


I thought maybe to add under it to recreate one by it but it didn't work... :p
#logo2 {
position: absolute;
top: 0;
center: 0;
display: block;
width: 320px;
height: 85px;
background: url(../images/custom/logo.gif) no-repeat;
cursor: pointer;
}


Surf3rDud3

Can you please move this to Graphics And Templates? Just realized that was there. Thx :)

Sir Osis of Liver


You can do that in index.template.php in the header template.

When in Emor, do as the Snamors.
                              - D. Lister

Surf3rDud3

#3
How so? Can you show me the piece of code so i know where to look?

Sir Osis of Liver

Don't have this theme, but just roughly, you have to add the button next to this div -



<div id="top_section">
', empty($context['header_logo_url_html_safe']) ? '
<h1 class="forumtitle2">' . $context['forum_name'] . '</h1>' : '', '
<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';

template_user_menu();

echo '
</div>


When in Emor, do as the Snamors.
                              - D. Lister

Surf3rDud3

#5
The above code isn't in there...

Can you make a example code for me... I know some but i havent done anything like this.

Sir Osis of Liver

Ok, in index.template.php, find this -



<div class="wrapper">
<div id="hdr-l">
<div id="hdr-r">
<div id="header">
<div id="time">
', $context['current_time'],'
</div>



and change it to this -



<div class="wrapper">
<div id="hdr-l">
<div id="hdr-r">
<div id="header">

<div>
<a href="http://www.google.com" title=""><span id="new_button"> </span></a>
</div>

<div id="time">
', $context['current_time'],'
</div>




In /css/index.css find this -



#logo {
position: absolute;
top: 0;
left: 0;
display: block;
width: 320px;
height: 85px;
background: url(../images/custom/logo.gif) no-repeat;
cursor: pointer;
}



and change it to this -



#logo {
position: absolute;
top: 0;
left: 0;
display: block;
width: 320px;
height: 85px;
background: url(../images/custom/logo.gif) no-repeat;
cursor: pointer;
}

#new_button {
position: absolute;
top: 25px;
left: 450px;
background: url(../images/on.png) no-repeat;
width: 43px;
height: 43px;
border: 2px white groove;
cursor: pointer;
}




Add your own url and image, tinker with the formatting, and you should be all set.

When in Emor, do as the Snamors.
                              - D. Lister

Surf3rDud3


Advertisement: