Advertisement:

Why are the template files so mangled?

Aloittaja m3talc0re, kesäkuu 16, 2006, 10:47:54 IP

« edellinen - seuraava »

m3talc0re

Why is the php and the html so mangled up together in the template files? I was really wanting to use smf for me forums, but I can't get the php right in it to edit the html to do what I want.
Example:

smf:

echo '
   <div id="container">
    <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';

    echo '<td width="150" id="leftbar" valign="top">';

echo '<div class="smalltext" style="width: 100%; font-family: verdana, arial, sans-serif;">';

if (!empty($context['user']['avatar']))
echo '<div style="margin-right: 10px;margin-bottom: 10px;">' . $context['user']['avatar']['image'].'</div>';


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

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo '<br />', $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'];


phpbb:

<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>
<th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
<th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_POSTS}&nbsp;</th>
<th class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
  </tr>
  <!-- BEGIN catrow -->
  <tr>
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
<td class="rowpic" colspan="3" align="right">&nbsp;</td>
  </tr>
  <!-- BEGIN forumrow -->
  <tr>
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
  </span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
  </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
  </tr>
  <!-- END forumrow -->
  <!-- END catrow -->
</table>


Why can't smf be that easy? Ugh...  ???

Anyone wanna help me? I need my catagories and forums and all like Bloc's Mellinium template but I need the login and all that other crap at the top where it belongs instead of to the side. I need it like this because it's going to have to fit in the dark gray content section here: http://www.m3talc0re.com/temp/new4/index.php  it's a thin area but it's wide enough if it's like Bloc's theme.
The real hell is your life gone wrong.

Dannii

Speed is one issue. SMF's templates are far faster.
And also because you can completely customise SMF's templates, which you can't do with phpBB. And when we say completely, we mean absolute everything can be changed if you want.

But the php code isn't too complex, and if you need help with something this would be the board to ask in.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

m3talc0re

See: http://www.m3talc0re.com/phpbb/index.php

That's what I was wanting to do with SMF. The more I think about it though, it's seeming like a bad idea because even medium long posts will make you scroll more, and a topic with alot of posts is going to have ALOT of scrolling. So I'm probably going to scrap that idea and just make a theme for SMF to match my site (ie. same color/theme kinda).

But with the template files in SMF, there's echo's making content and then nothing special has changed and the echo ends and another starts when there doesn't need to be another, you get me? It's like you break a table up and have a new echo statement for every table row instead of just having one echo statement for the whole table.
The real hell is your life gone wrong.

Dannii

If an echo statement stops it's because it's supposed to. If you're seeing what you think is a lot of echo statements it's because of loops if/then statements etc.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Advertisement: