News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF 1.1 RC2 BoardIndex Template

Started by draker, January 07, 2006, 03:49:40 PM

Previous topic - Next topic

draker

Hi,

I've just updated to SMF 1.1 RC2 on my website and have come across a small problem regarding the BoardIndex Template.

If I am logged in as the admin, the template looks correct and fine.  Have no problems with it.  All of the columns line up correctly, etc.

However, if I log in as a normal user, the column which contains the number of posts and topics gets expanded within one of my categories only (I have 4 total).  It is not a case of different monitor, screen size, etc.  I have tested this on three different monitors and screensizes, and it occurs on all three of them.   The only difference I can see between this category (and the boards within) and the other categories on my forum is that this category contains child boards. 

I have included a screenshot to help elaborate the problem.



Can anyone suggest a fix so that the column in question lines up with the other columns?  I know its not a big problem, everythign else works great, but it bugs me all the same.

dtm.exe

That's odd that a membergroup would affect the widths.  Would you mind creating an administrator account on your forum and PM me the login details?  Also, create a normal accound and send me the login details for that.

dtm.exe

I tested your website as a guest, normal user, and as an administrator.  All columns were aligned just fine.

draker

Well, the boards in question can't be seen as a guest, but I appreciate your help.

Any possibility why it would be striking me and not you?  I am trying to confirm with some of my members if it is happening to them as well.

Harzem

Can you give me a link? You may temporarily allow guests.

And what browser are you using? Which version?

Puchu


draker

#6
Link: http://www.startrekpbem.net/Interactive/smf/index.php

I have tried this out on both IE 6.0.2 and FF1.0.4.  In FF everything lines up just fine.  Apparently it is only an IE issue.

As a note, the boards in question are not viewable as a guest, but as a registered member in one of the membergroups.

motumbo

#7
I had a problem with this bug and posted about it earlier. 

http://www.simplemachines.org/community/index.php?topic=63525.0

It apparently affects only IE.  The solution:

Go into BoardIndex.template.php and add a CSS class name to each of the columns, get RID of the percentage widths already in some (but not all) of the column TDs and put corresponding statements in the style.css file.  The problem arises because IE screws up the widths assigned to the columns because the category column is not assigned a width but allowed to "float".

You will ALSO have to make the same changes in MessageIndex.template.php because child boards are displayed there and you can have the same problem.

For example, in BoardIndex.template.php find:


foreach ($category['boards'] as $board)
{
echo '
<tr>
<td ' , !empty($board['children']) ? 'rowspan="2"' : '' , ' class="windowbg" width="6%" align="center" valign="top"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';


Change to (additions in CAPS--don't use CAPS in your file): 


foreach ($category['boards'] as $board)
{
echo '
<tr>
<td ' , !empty($board['children']) ? 'rowspan="2"' : '' , ' class="windowbg ICONCOL"  align="center" valign="top"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';



Find:

<td class="windowbg2">
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];



Add "bicat"


<td class="windowbg2 BICAT">
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];



FIND:

<td class="windowbg" valign="middle" align="center" style="width: 12ex;"><span class="smalltext">
', $board['posts'], ' ', $txt[21], ' <br />
', $board['topics'],' ', $txt[330], '
</span></td>


Take out width and ADD CSS class:


<td class="windowbg POSTCOUNT" valign="middle" align="center"><span class="smalltext">
', $board['posts'], ' ', $txt[21], ' <br />
', $board['topics'],' ', $txt[330], '
</span></td>


Find: 

<td class="windowbg2" valign="middle" width="22%">
<span class="smalltext">';


Replace by deleting width and putting in CSS class:


<td class="windowbg2 LASTPOST" valign="middle">
<span class="smalltext">';


Additions to CSS file:

/* CSS File */
.iconcol {
width: 6%;
}

.bicat {
width: 49%;
}

.postcount {
width: 20%;
}

.lastpost {
width: 25%;
}


This method is preferable to the original because it takes the presentational aspects out of the HTML and puts them in the CSS enabling you complete control over the widths of your columns.



Puchu

Quote from: draker on January 07, 2006, 05:43:48 PM
Link: http://www.startrekpbem.net/Interactive/smf/index.php

I have tried this out on both IE 6.0.2 and FF1.0.4.  In FF everything lines up just fine.  Apparently it is only an IE issue.

As a note, the boards in question are not viewable as a guest, but as a registered member in one of the membergroups.


If that link is the board in question then guests can see it...

I could make a topic if I wanted in Gen Discussion,
could reply to news stuff...

either your permissions are messed or you are talking about a different link than what you gave...

draker

The link in question is the forum in question.  But the category which has the messed up alignment is not a general view/use category.  Only a certain membergroup can see this category.  The permissions are set the way we need to have them, it just is confusing trying to ask for help when those responding to the call can't see the set of boards in play.

Motumbo has posted a possible solution that I have not had a chance to implement yet.  After trying it out, I will post whether it worked or not, for me.

motumbo

#10
Quote from: draker on January 09, 2006, 11:38:17 AM
Motumbo has posted a possible solution that I have not had a chance to implement yet.  After trying it out, I will post whether it worked or not, for me.

The cause of the "IE column width" bug for me was the presence of child boards.  There were two solutions:  assign widths to all the columns using CSS (as I described) or remove the code to display the names of the childboards.  I chose to apply widths to all the columns.

You didn't provide much of a picture, but it looks like there is a child board under the category?

draker

Correct, as I stated in my original post, one of my theories as to the cause of this were the childboards I had in the category.  That was the only thing I could see that was different between the category of boards I have the problem and the other remaining categories on my forum.

RBH

#12
motumbo, excellent work! that fixed it on the first try. i love having the adjustments in the css file now too. adjusting those columns is cakewalk now. i had been searching how to adjust the widths of the boxes as well as fix this little error and you nailed  em both in one shot. 8)

thanks to jaybachatero for pointing me to this post.

btw, i have now seen this same problem mentioned many times. why i couldn't find it with the search i haven't a clue but maybe this topic should be stickied and given a better name so people would know its what they are looking for, something like "fix for stretched topic/post columns".

AngelSL

#13
Oh..dear. this wercked..it..at least my text editor makes auto0backups.
also its not just ie, its also a opera issue

motumbo

Quote from: RBH on January 22, 2006, 01:58:24 AM
btw, i have now seen this same problem mentioned many times. why i couldn't find it with the search i haven't a clue but maybe this topic should be stickied and given a better name so people would know its what they are looking for, something like "fix for stretched topic/post columns".

There have been many cases where I could not find an answer to my problem using the search function.  Often it is that I search using different keywords than previous posters used.  I usually try different keywords, but that doesn't always help.

I'd like to see a "hot topics" sticky for common problems or something.  If an issue generates a number of "help me" posts it goes in the hot topics post.  This "stretched column" IE bug is going to generate more "help me" posts, I'm sure.

I suppose using different keywords in our posts could help, too.

I usually feel a little foolish after finding out that my "problem" has been addressed many times before and I just couldn't find it. 

Advertisement: