Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: Thebestthere - tammikuu 18, 2012, 12:24:30 AP

Otsikko: Where to place this code?
Kirjoitti: Thebestthere - tammikuu 18, 2012, 12:24:30 AP
<a style="width:400px;height:100px;vertical-align:middle;text-align:center;background-color:#000;position:absolute;z-index:5555;top:50px;left:50px;background-image:url(http://americancensorship.org/images/stop-censorship-small.png);background-position:center center;background-repeat:no-repeat;" href="http://americancensorship.org"></a>
Otsikko: Re: Where to place this code?
Kirjoitti: Ricky. - tammikuu 18, 2012, 12:33:49 AP
Depends upon whre you want to place it.

Most probably in your index.template.php after
// Custom banners and shoutboxes should be placed here, before the linktree.

Make sure to enclose your code in echo like..

echo 'your whole code' ;
Otsikko: Re: Where to place this code?
Kirjoitti: Thebestthere - tammikuu 18, 2012, 12:38:23 AP
It's to censor my logo! like this
Otsikko: Re: Where to place this code?
Kirjoitti: Ricky. - tammikuu 18, 2012, 12:53:23 AP
I guess then you need to place your logo between it, in your theme's index.template.php
Find :

<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>';

Replace with :

<h1 class="forumtitle">
<a style="width:400px;height:100px;vertical-align:middle;text-align:center;background-color:#000;position:absolute;z-index:5555;top:50px;left:50px;background-image:url(http://americancensorship.org/images/stop-censorship-small.png);background-position:center center;background-repeat:no-repeat;" href="http://americancensorship.org">
', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '
</a>
</h1>';


It is not tested however, should work. Don't forget to make backup of file before modifying it.
Otsikko: Re: Where to place this code?
Kirjoitti: ARG01 - tammikuu 18, 2012, 02:22:57 AP
Nice work Ricky. Worked for me on a test.  ;)