Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: adm073 on November 21, 2006, 02:43:26 PM

Title: Help with new table?
Post by: adm073 on November 21, 2006, 02:43:26 PM
Hi, I'm currently working on making a new board and am having a hard time getting the template to work. I had a theme set up how I want this one, back on my old board, but I forgot to save the theme file before removing that site...  ::) It's been a while since I've used SMF and I forgot how I did it, and instead of doing any more trial-and-error testing, I figured I might as well ask on here to see if anyone already knows how.

I'm basing this theme off of the Classic YaBB SE theme, but I keep getting validation errors when trying to make a new table row. This is the current way it's set up:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.dct-3.exofire.net%2Fexample1.jpg&hash=6f8a0acf23c5f29d71c3173bc21ad828ea50f761)

But I want it to look like this:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.dct-3.exofire.net%2Fexample2.jpg&hash=a6c8954cd95f5e931496dcc6af7be93dcbeaac69)

Here is the code from the unmodified theme:
   // The logo, user information, news, and menu.
   echo '
   <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
      <tr style="background-color: #ffffff;">
         <td valign="middle" align="left"><img src="', $settings['images_url'], '/smflogo.gif" alt="" /></td>
         <td valign="middle">';

   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      echo '
            ', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>', $context['allow_pm'] ? ', ' . $txt[152] . ' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' . ($context['user']['messages'] != 1 ? $txt[153] : $txt[471]) . '</a>' . $txt['newmessages4'] . ' ' . $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1']) : '', '.';

      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '<br />
            ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=regcenter">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];

      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '<br />
            <b>', $txt[616], '</b>';
   }
   // Otherwise they're a guest - so politely ask them to register or login.
   else
      echo '
            ', $txt['welcome_guest'];

   echo '
            <br />', $context['current_time'], '
         </td>
      </tr>
      <tr class="windowbg2">
         <td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">';

   // Show the menu here, according to the menu sub template.
   template_menu();

   echo '
         </td>
      </tr>';

   // Show a random news item? (or you could pick one from news_lines...)
   if (!empty($settings['enable_news']))
      echo '
      <tr class="windowbg2">
         <td colspan="2" height="24" class="tborder" style="border-width: 1px 0 0 0; padding-left: 1ex;">
            <b>', $txt[102], ':</b> ', $context['random_news_line'], '
         </td>
      </tr>';

   echo '
   </table>

   <br />
   <table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
      <tr><td valign="top" bgcolor="#ffffff">';
}



I'm using 1.09. Any help would be very much appreciated...   :)
Title: Re: Help with new table?
Post by: sawz on November 23, 2006, 12:05:40 AM
i have something similar but without the top table
http://www.sawz.com/smf/index.php
Title: Re: Help with new table?
Post by: adm073 on November 24, 2006, 04:59:37 PM
Quote from: sawz on November 23, 2006, 12:05:40 AM
i have something similar but without the top table
http://www.sawz.com/smf/index.php
That might work, but I don't really like the side bars...  :)

I've upgraded to RC3, and right now this is the error message I'm getting:
Quotesyntax error, unexpected T_ECHO

Here is the modified code that I'm trying to use:
   // The logo, user information, news, and menu.
   echo '
   <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
      <tr style="background-color: #ffffff;">
         <td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
</tr>
</table>'/

   echo '
   <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
      <tr style="background-color: #ffffff;">
         <td valign="middle">';
   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      echo '
            ', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>', $context['allow_pm'] ? ', ' . $txt[152] . ' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' . ($context['user']['messages'] != 1 ? $txt[153] : $txt[471]) . '</a>' . $txt['newmessages4'] . ' ' . $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1']) : '', '.';

      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '<br />
            ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];

      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '<br />
            <b>', $txt[616], '</b>';
   }
   // Otherwise they're a guest - so politely ask them to register or login.
   else
      echo '
            ', $txt['welcome_guest'];

   echo '
            <br />', $context['current_time'], '
         </td>
      </tr>
      <tr class="windowbg2">
         <td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">';

   // Show the menu here, according to the menu sub template.
   template_menu();

   echo '
         </td>
      </tr>';

   // Show a random news item? (or you could pick one from news_lines...)
   if (!empty($settings['enable_news']))
      echo '
      <tr class="windowbg2">
         <td colspan="2" height="24" class="tborder" style="border-width: 1px 0 0 0; padding-left: 1ex;">
            <b>', $txt[102], ':</b> ', $context['random_news_line'], '
         </td>
      </tr>';

   echo '
   </table>

   <br />
   <table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
      <tr><td valign="top" style="background-color: #ffffff;">';
}


What am I doing wrong?  :(
Title: Re: Help with new table?
Post by: adm073 on November 25, 2006, 06:50:15 PM
I figured out something that works. :D

   // The logo, user information, news, and menu.
   echo '
   <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
      <tr style="background-color: #171717;">
         <td valign="middle" align="center"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td></tr>
   </table>

         <table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
      <tr style="background-color: #171717;">
         <td valign="middle" align="center">';