Topic: Class Definition Missing In viewtopic.php

The following line in viewtopic.php is missing the class attribute on the TD tag...

<td><?php echo $lang_common['Pages'].': '.$pages ?></td>

and should be...

<td class="punhead"><?php echo $lang_common['Pages'].': '.$pages ?></td>

I noticed this when I was modifying the stylesheet to my taste and it didn't change.

Thanks...

2

Re: Class Definition Missing In viewtopic.php

There is an error on that page but I don't think thats quite it. From what I can see class="punhead" needs to be added to the <td>tag at line 189 and removed from the <td> tag at line 192.

Rickard. If you want to see what the problem is, trying setting a background colour for punhead and see what happens on the viewtopic page. The reason I need it changed is I am trying to replace cellspacing="1" with borders set through the stylesheet. As it is at the moment punhead has been set on the inner nested table rather than the outer table which screws everything up.

Re: Class Definition Missing In viewtopic.php

schmoboy: The text "Pages: 1 2 3" etc is supposed to look differently from the text "Message".

Paul: I see what you mean. I'll have a look at it tomorrow. I'm a bit too drunk to touch the code right now :D

"Programming is like sex: one mistake and you have to support it for the rest of your life."

4 (edited by schmoboy 2004-02-29 06:32)

Re: Class Definition Missing In viewtopic.php

Thanks guys...

The issue is that if you try and set a dark header background with a light header text color, then the "Pages: " text is not visible because it maintains a dark text color.

BTW:  Don't bite on all the "slick" feature requests.  The reason I like this forum software is the fact that it is lean and mean.  Quick little bugger.  If people want "feature bloat", then there's plenty of choices out there.

Thanks for everything....

5

Re: Class Definition Missing In viewtopic.php

Rickard wrote:

I'll have a look at it tomorrow. I'm a bit too drunk to touch the code right now :D

First sleep, now alcohol. What kind of developer are you? :x

Re: Class Definition Missing In viewtopic.php

Joey wrote:
Rickard wrote:

I'll have a look at it tomorrow. I'm a bit too drunk to touch the code right now big_smile

First sleep, now alcohol. What kind of developer are you? :x

The human kind? smile

"Real programmers are those that can sleep in front of terminals ... with their eyes opened."

"Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."

Re: Class Definition Missing In viewtopic.php

I'm stuck on this. If I do what Paul suggested and move the class="punhead" to the outer td, the text "Message" is displayed in the wrong color. The only simple solution I can come up with is adding the class="punhead" to both the inner and the outer td. Am I wrong?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8 (edited by Paul 2004-03-03 00:47)

Re: Class Definition Missing In viewtopic.php

No. You are right. Stay tuned I think I may have the answer.

[EDIT]

Tried and failed. The only way to do it with no extra styles is to put punhead in both.

If it were upto me I would have "Pages" the same colour as "Message" in which case the inner table could be eliminated altogether. Incidentally, "Pages" is virtually invisible in the sulfar style, at least to my old eyes.

Re: Class Definition Missing In viewtopic.php

Yes, I agree. I'll change it for PunBB 1.2.

Edit. Hmm. I ran into a problem. You can't just put the three texts (Author, Message and Pages:) in one table cell each, because the cellpadding will screw it up. Here's what I mean:
http://w1.421.telia.com/~u42121130/problem.png

"Programming is like sex: one mistake and you have to support it for the rest of your life."

10 (edited by Paul 2004-03-04 02:04)

Re: Class Definition Missing In viewtopic.php

One table, two columns and the inner table gone.

<table class="punmain" cellspacing="1" cellpadding="4">
    <tr class="punhead">
        <td class="punhead" style="width: 185px; white-space: nowrap"><?php echo $lang_common['Author'] ?></td>
        <td class="punhead" style="white-space: nowrap">
            <div style="width: 20%; float:left"><?php echo $lang_common['Message'] ?></div>
            <div style="float:left"><?php echo $lang_common['Pages'].': '.$pages ?></div>
        </td>
    </tr>
</table>

I don't run into this problem too often because I tend to use an altered version of PunBB which doesn't use cellpadding or cellspacing for borders. It also doesn't use styling on the <tr> tags which are mostly redundant and has only 1 nested table. It does however use a lot of multiple classes on the same element though that is actaully supported by all modern browsers.

In this case if you put the background colour on TD.punhead you can eliminate TR.punhead alltogether. Or, if you realy want to start optimizing things then there are always descendant selectors. Put an id on the TR tag of puntableheader, remover all references to punhead, declare a selector TR#puntableheader td {} with the background and colour settings to suit. You can now remove all references to punhead from the table header <tr> and <td> tags on all pages, replace punheadcent with puncent and delete class TD.punheadcent.

11

Re: Class Definition Missing In viewtopic.php

Slightly off topic but related, heres the table structure for footer.php minus the nested table (php removed)

<table class="punmain" cellspacing="1" cellpadding="4">
    <tr>
        <td class="puncon2 puntop">
            (dropdown forum jump)
        </td>
        <td class="puncon2 puntopright">
            Powered by <a target="_blank" href="http://punbb.org/">PunBB</a><br>
            Version: <?php echo $pun_config['o_cur_version'] ?><br>
            © Copyright 2002-2004 Rickard Andersson
        </td>
    </tr>
</table>

Exactly the same thing can be done with the user options box at the bottom of index.php.

Re: Class Definition Missing In viewtopic.php

Two question. Is it valid XHTML/CSS to use more than one class like that? Also, what browsers don't support that syntax?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

13 (edited by Paul 2004-03-05 20:49)

Re: Class Definition Missing In viewtopic.php

It is valid. Multiple classes are part of the specification. Infact the "class" attribute is defined as containing a space separated list. As for browser support, everything except NS4 and Omniweb and maybe ancient versions of Opera and IE. It certainly works with the following

IE5+ (Win)
IE5 (Mac)
Safari
Opera 5+
Mozilla 1+
NS5+
Firefox/bird
All current Linux browsers.

Basically, in any browser where this is not supported such as NS4 then PunBB is going to break anyway.

[EDIT]
The order of precedence in which the classes are applied are the order the appear in the style sheet not the order they are written in the tag.

Re: Class Definition Missing In viewtopic.php

Ok, cool. Then I'm fine with it. I'm gonna send you an e-mail. I have a suggestion :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

15

Re: Class Definition Missing In viewtopic.php

Got it. I emailed you back smile