I tried to add a link to a thread into the footer right after the credits link. Can anyone help me please?
function template_body_below()
{
global $context, $txt;
echo '
</div>
</div>';
// Show RSS link, as well as the copyright.
// Footer is full-width. Wrapper inside automatically matches admin width setting.
echo '
<div id="footer_section"><a id="bot"></a>
<div class="wrapper">
<ul>
<li class="copyright">',
theme_copyright(), '
</li>',
!empty($context['newsfeed_urls']['rss']) ? '<li>
<a id="button_rss" href="' . $context['newsfeed_urls']['rss'] . '" class="rssfeeds new_win"><i class="largetext fa fa-rss"></i></a>
</li>' : '',
'</ul>';
// Show the load time?
if ($context['show_load_time'])
echo '
<p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>';
}
I guess, a link in the footer has to be added somewhere here:
theme_copyright(), '
</li>',
That way:
theme_copyright(), '
</li><a href="http://something.de">| Text</a>',
But I am not sure O:-)
You were absolutely right, thanks! :)
It may not matter, but just to put the idea out there. The SimpleAds mod does footer ads. You can place html links as an "ad" right where you're proposing. Best of all it's hook based, so no keeping up with hardcoded mods. ;) Take a look at bbs.zuwharrie.com as an example. ;D
The correct way of doing it would be:
function template_body_below()
{
global $context, $txt;
echo '
</div>
</div>';
// Show RSS link, as well as the copyright.
// Footer is full-width. Wrapper inside automatically matches admin width setting.
echo '
<div id="footer_section"><a id="bot"></a>
<div class="wrapper">
<ul>
<li class="copyright">',
theme_copyright(), '
</li>
<li>
<a href="http://something.de">| Text</a>
</li>',
!empty($context['newsfeed_urls']['rss']) ? '<li>
<a id="button_rss" href="' . $context['newsfeed_urls']['rss'] . '" class="rssfeeds new_win"><i class="largetext fa fa-rss"></i></a>
</li>' : '',
'</ul>';
// Show the load time?
if ($context['show_load_time'])
echo '
<p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>';
}
Ruth's suggestion omits the <li> tags, which will invalidate the markup. ;)
O_O
OMG a ghost.
Okay, but the text size of my links is now bigger then the copyright link. It shouldn't be. Can you help me again please?
Give the <li> a class "copyright":
theme_copyright(), '
</li>
<li class="copyright">
<a href="http://something.de">| Text</a>
</li>',
Thank you! :)
I did it that way now, because the | were getting too small or too large, if they are anywhere else:
theme_copyright(), '
</li>
<li class="copyright"> | <a href="http://something.de">Text</a></li><li class="copyright"> | <a href="http://something2.de">Text2</a></li>',
Thanks, Ruth. Works perfect and looks good!
A little hint, thanks to
@radu81: If you are using complete URLs like https://forum-alternative-antriebe.de/index.php/index.php/topic,467.0.html guests or other not logged in users must click two times on the links to open them. The first click only leads to board index. Strange!
When you change the URL to ' . $scripturl . 'index.php/topic,7255.0.html, everything works fine even with the first click!
So my code looks like this now:
// Show RSS link, as well as the copyright.
// Footer is full-width. Wrapper inside automatically matches admin width setting.
echo '
<footer id="footer_section"><a id="bot"></a>
<div class="wrapper">
<ul>
<li class="copyright">',
theme_copyright(), '
</li>
<li class="copyright"> | <a href="' . $scripturl . 'index.php/topic,467.0.html">Nutzungsbedingungen</a></li>
<li class="copyright"> | <a href="' . $scripturl . 'index.php/topic,7773.0.html">Datenschutzerklärung</a></li>
<li class="copyright"> | <a href="' . $scripturl . 'index.php/topic,7255.0.html">Impressum</a></li>',
!empty($context['newsfeed_urls']['rss']) ? '<li>
<a id="button_rss" href="' . $context['newsfeed_urls']['rss'] . '" class="rssfeeds new_win"><i class="icon icon-margin i-rss icon-big"><s>' . $txt['rss'] . '</s></i></a>
</li>' : '',
'</ul>';
Have you tried to change those links with something like index.php?topic=xx?
Without leading "scripturl"?
Probably $scripturl includes already index.php. :P
<a href="' . $scripturl . '?topic=467.0"
would do.
Also, try to always use the above schema, because it is rewritten into the "html" form before being sent to the user and is more "future-proof" (i.e. if something will change in the future, the ?topic form will be for sure properly handled, the "topic,123.0.html" may or may not).
Thank you. I changed the code. :)
Hello, I like the way you did it.
Can someone give me a tip in which file I have to do the changes?
Thank you. You will find the code in themes/yourtheme/index.template.php. If your theme doesn't have a special index.template.php file in his folder, the file from themes/default is used.
Thank you for this information.