tippmaster needs help with his theme

Started by 1MileCrash, July 20, 2005, 05:30:48 PM

Previous topic - Next topic

1MileCrash

okay, i said the hell with it and installed another smf board. Now, im creating a new theme, and i have run into a few problems...

#1. I want the nav. bar buttons to be centered and in a table. It works....when i am logged in. When i am logged out, THE WHOLE FORUM is in that same table, and EVERYTHING is centered. Why?

teh code:
// Show the [home] and [help] buttons.
   echo '
            <center><table style="border:1px solid #99cc00"><td><a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
            <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 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

   // 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>', $context['menu_separator'];

   // 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>', $context['menu_separator'];

   // 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>', $context['menu_separator'];

   // 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>', $context['menu_separator'];

   // 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>', $context['menu_separator'], '
            <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></td></table></center>';


#2. I want to center the categorie headings, but cannot figure out how, (unless i log out, because of problem #1). How can i go about doing this?

The only thing php can't do is tell you how much milk is left in the fridge.



codenaught

Where the else statement is at the bottom of that code, you need to close the menu part before the else statement with </td</tr></table>

Like this:

// 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>', $context['menu_separator'], '
            <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></td></tr></table>';
   }

Dev Consultant
Former SMF Doc Coordinator

1MileCrash

sweet. That worked. But....im assuming i should do the same with <center>? :P

Thanks akabugeyes.

Now, i just need to center the categorie name.
The only thing php can't do is tell you how much milk is left in the fridge.



codenaught

Yes your right. The </center> would also go to the end of that.

To center a category name you could open BoardIndex.template.php and find:

', $category['link'], '
and make it: <center>', $category['link'], '</center>
Dev Consultant
Former SMF Doc Coordinator

1MileCrash

done. I have been looking everywhere for that. Thanks alot for all of your help.

Im working on an alien/space/whatever theme. You can view it here. Keep in mind it isnt near done.

And, this isnt a priorety question, but i looked everywhere to find the pre-determined size of catbg. Anybody know the size of catbg?
The only thing php can't do is tell you how much milk is left in the fridge.



codenaught

Catbg's size is defined in the html of the templates.

For example you can edit the height of catbg (used for the categories) here in BoardIndex.template.php:


<td colspan="5" class="catbg', $category['new'] ? '2' : '', '" height="18">';


Where you can adjust "18" whatever you would like.

Dev Consultant
Former SMF Doc Coordinator

1MileCrash

#6
i dont really want to resize it, i just want to edit it in photoshop as it's displayed size. The whole process would be tons easier.

Does anyone know its displayed size in pixels? the "18"....that wouldnt be pixels...right? That sounds like about 3/4 the hieght in pixels.
The only thing php can't do is tell you how much milk is left in the fridge.



codenaught

Well if it is an image, perhaps you could just remove the height attribute of what I showed you? I think then it would take the size of your image.
Dev Consultant
Former SMF Doc Coordinator

1MileCrash

word. That is true. But i dont want to end up having my catbg longer or shorted that the board-table width. Perhaps ill just print-screen, resize the image to the size of my monitor, then crop out catbg, and look at it's attributes. Teh Gett0 way. :)
The only thing php can't do is tell you how much milk is left in the fridge.



1MileCrash

last thing, i need to center the info center titles too, "Members", "Forum Stats", and "Users Online". I looked in boardindex.template.php. I found a section for "Info Center", but never found where to edit the displayed text.
The only thing php can't do is tell you how much milk is left in the fridge.



Advertisement: