TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 500
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 89
  • Total: 89

Joining up menu buttons

Started by Paulie, December 13, 2005, 02:03:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paulie

Yeah, sorry lol forgot that bit.

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
        global $context, $settings, $options, $scripturl, $txt;

     // Show the [home] and [help] buttons.
       echo '
                  <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0px;" border="0" />' : $txt[103]), '</a>';
       echo '<a href="', $scripturl, '?action=forum">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/forum.gif" alt="Forum Index" style="margin: 2px 0px;" border="0" />' : 'Forum Index'), '</a>';
       echo '<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0px;" border="0" />' : $txt[119]), '</a>';

        // How about the [search] button?
        if ($context['allow_search'])
                echo '<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>';

      // Is the user allowed to administrate at all? ([admin])
        if ($context['allow_admin']){
                echo '<a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.gif" alt="' . $txt[2] . '" style="margin: 2px 0;" border="0" />' : $txt[2]), '</a>';
                echo '<a href="', $scripturl, '?action=tpadmin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/tpadmin.gif" alt="Tiny Portal Admin" style="margin: 2px 0;" border="0" />' : 'TPadmin'), '</a>';

        }

        // Edit Profile... [profile]
        if ($context['allow_edit_profile'])
                echo '<a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 2px 0;" border="0" />' : $txt[467]), '</a>';

        // The [calendar]!
        if ($context['allow_calendar'])
                echo '<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>';

        // If the user is a guest, show [login] and [register] buttons.
        if ($context['user']['is_guest'])
        {
                echo '<a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0" />' : $txt[34]), '</a>
                     <a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0" />' : $txt[97]), '</a>';
        }
        // Otherwise, they might want to [logout]...
        else
                echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
}

?

Paulie

Got it. I had a double up on the top lines. Thanks IchBin ;)

IchBin

Lmao! I was just typing what your error was. :)

Paulie

Lol, that`s me all over. Still if ya don`t try these things eh ;)

Paulie

I know i`ll have to redo the buttons , but i like it.

This website is proudly hosted on Crocweb Cloud Website Hosting.