1

Topic: How to make the actual post look different from replies?

I'm trying to change the class of the first post...

<div class="postright">

I'd like it to a different style (both the user info and the post itself) from the replies which follow.

where can i set this css class in the code for punbb?

Re: How to make the actual post look different from replies?

i'm not sure what you'd have to change, you'd probably have to duplicate a few things, but its firstpost, not postright

3

Re: How to make the actual post look different from replies?

It would have to be either an if equasion, saying something like if it's post number one, then new class.

i guess my question was more about where this information is generated in the script... been searching, and it doesn't seem to be a template issue... to change it there changes it everywhere.

frustrating...

Re: How to make the actual post look different from replies?

you don't need to edit the code, the first post HAS the class firstpost, sorry i read your first post slightly wrong

5

Re: How to make the actual post look different from replies?

Intersting...

Ok, i see the equasion already there in viewtopic.php:

<?php if (($post_count + $start_from) == 1) echo ' firstpost'; ?>

dunnoe how i missed this before (well, yeah i do...)

The classes involved are:
firstpost

blockpost
h2
conr
box
inbox
postleft
usertitle
postavatar
postright
h3
postmsg
postsignature
hr
clearer
postfootleft
postfootright

div
dl
dt
dd

a simple change to the tags i want to change (adding .firstpost) should do it?

could it really be as simple as that?

Re: How to make the actual post look different from replies?

yes/no, i just realised, thats the first post on the page not the first post in the topic hmm

7

Re: How to make the actual post look different from replies?

No, its only the first post in the topic i.e. the starter post.

If you want the first post on each page as well then you would need to add this
<?php if ($post_count == 1) echo ' toppost'; ?>

8

Re: How to make the actual post look different from replies?

I'm having some luck with the .firstpost class

http://imperialdub.com/dubmessages/viewtopic.php?id=836

however, there's a grey box that simply won't go away...

despit this overly dramatic css:

/* For the first post */

.firstpost,
.firstpost DT, .firstpost DL, .firstpost DD, .firstpost TD, .firstpost TR, .firstpost table,
.firstpost p,
.firstpost .linkst,
.firstpost .postmsg,
.firstpost .postsignature,
.firstpost DIV,
.firstpost .rowodd,
.firstpost .roweven,
.blockpost .rowodd .firstpost,
.firstpost .conr, 
.firstpost .box,
.firstpost .inbox,
.firstpost DIV.postleft,
.firstpost DIV.postright, 
.firstpost DIV.postfootleft, 
.firstpost DIV.postfootright {
    background: #FFF;
}

.firstpost .postright {
padding-top: 10px;
padding-bottom: 40px;
padding-left: 25px;
padding-right: 25px;
}

where is that box coming from?

9

Re: How to make the actual post look different from replies?

To change the background colour of the first post all you need to do is add this to the end of section 2 of the stylesheet

div.firstpost h2, div.firstpost div.box, div.firstpost div.postright, div.firstpost div.postfootright {background-color: #fff}
div.firstpost div.postright, div.firstpost div.postfootright {border-left-color: #fff}

You can scrap the rest of it.

10

Re: How to make the actual post look different from replies?

awesome!

thank you.

here's the final css i used (jicai)

/* For the first post */

div.firstpost h2, 
div.firstpost div.box, div.firstpost div.postright, 
div.firstpost div.postfootright, 
div.firstpost div.postleft, div.firstpost div.postfootleft {
    background-color: #fff
}
div.firstpost div.postright, 
div.firstpost div.postfootright, 
div.firstpost div.postfootleft {
    border-left-color: #fff
}

div.firstpost div.postright {
padding-top: 10px;
padding-bottom: 40px;
padding-left: 25px;
padding-right: 25px;
}

div.firstpost div.postfootleft, 
div.firstpost div.postfootright {
padding-bottom: 10px;
}

/* End first post style */