1 (edited by okparanoid 2005-02-11 00:31)

Topic: switch the background color of the post in the topic

Hello !

I'm using punbb 1.2 and would like to switch the background color of the posts

i see that it is a variable to do this in the code

// Switch the background color for every message.
$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';

After that it call the class blockpost + vtbg to display a message

but in the .css i don't know how to activate it with the blockpost class. How can i do this ?

Re: switch the background color of the post in the topic

any ideas ?

sorry for my bad english, perhaps i'm not been understood...

i want to alternate the color of the background to te right party of a post then the color will be switch alternately in two colour

in the viewtopic.php it call the display of a post with :

<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo $vtbg ?>

so i think that the blockpost class can be separate in two herited class but i dont know to specify the background color of each class in the _cs.css file  (i don't know how to name it)

there is a section to specify the color of the blockpost class

DIV.blockpost DIV.box, DIV.postright, DIV.postfootright {BACKGROUND-COLOR: #DEDFDF}
DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #f1f1f1}*/
DIV.postleft, DIV.postfootleft, DIV.blockpost LABEL {BACKGROUND-COLOR: #B33}

i'm newb in the manipulation of css and i don't know manipulate class correctly...

So what the syntax i have to use to specify the background color of blockpost roweven and blockpost rowodd ?

Thanks a lot for yours answers...

3

Re: switch the background color of the post in the topic

Try replacing this

DIV.blockpost DIV.box, DIV.postright, DIV.postfootright {BACKGROUND-COLOR: #DEDFDF}

with this

DIV.rowodd DIV.box, DIV.rowodd DIV.postright, DIV.rowodd DIV.postfootright {BACKGROUND-COLOR: whatever}
DIV.roweven DIV.box, DIV.roweven DIV.postright, DIV.roweven DIV.postfootright {BACKGROUND-COLOR: whatever}

4 (edited by okparanoid 2005-02-11 01:01)

Re: switch the background color of the post in the topic

thanks for your answer !

But sad it does not work tongue yet

http://okparanoid.free.fr/punbb-1.2.1/v … php?id=502

here is some lines of my  _cs.css :

/* 1.1 Default background colour and text colour */

BODY {BACKGROUND-COLOR: #000}

.pun {COLOR: #FFF}

/*DIV.box, .pun BLOCKQUOTE, DIV.codebox, #adminconsole FIELDSET TH{BACKGROUND-COLOR: #A22}*/
#adminconsole TD, #adminconsole TH {BORDER-COLOR: #F1F1F1}

/* 1. 2 Darker background colours */

TD.tc2, TD.tc3, TD.tcmod, #postpreview, #viewprofile DD, DIV.forminfo,
#adminconsole FIELDSET TD, DIV.blockmenu DIV.box, #adstats DD {BACKGROUND-COLOR: #B22}

/* 1.3 Main headers and navigation bar background and text colour */

.pun H2, #brdmenu {BACKGROUND-COLOR: #000; COLOR: #FFF}

/* 1.4 Table header rows */

.pun TH {BACKGROUND-COLOR: #B33}

/* 1.5 Fieldset legend text colour */

.pun LEGEND {COLOR: #0F0}

/* 1.6 Highlighted text for various items */

.pun DIV.blockmenu LI.isactive A, #posterror LI STRONG {COLOR: #0F0}

/****************************************************************/
/* 2. POST BACKGROUNDS AND TEXT */
/****************************************************************/

/* 2.1 This is the setup for posts. */

/*DIV.blockpost DIV.box, DIV.postright, DIV.postfootright {BACKGROUND-COLOR: #DEDFDF}
DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #f1f1f1}*/
/*DIV.postleft, DIV.postfootleft, DIV.blockpost LABEL {BACKGROUND-COLOR: #B33}*/
DIV.rowodd DIV.box, DIV.rowodd DIV.postright, DIV.rowodd DIV.postfootright {BACKGROUND-COLOR: 0F0}
DIV.roweven DIV.box, DIV.roweven DIV.postright, DIV.roweven DIV.postfootright  {BACKGROUND-COLOR: 00F}

don't worry about the bad color the forum is in test mod smile, and i have modified some display too...

any alternative big_smile ?

5

Re: switch the background color of the post in the topic

#0F0
#00F

Re: switch the background color of the post in the topic

in french : "oh la boulette !"

Thanks a lot ! it's work smile