(Alternation) How to do this?

Started on the old forum in November 2010 · view the original in the archive · old links redirect here

13 replies · 654 views · started 16 years ago · 1 min read

5 participants
Jervy Senior · 250 posts #1

How to this thing an alternate color in posting?

For example: in chat room or in forum topics.


This post have black background

This post have white background

This post have black background

This post have white background

How to do that? Does anyone can help me out? When my members post a message in chat they all have same bg, i just want it alternate.

kei_ki7 Senior · 431 posts #2

Put this into your css

div.whitebg{
background-color:#FFFFFF;
color:#000000;
}
div.blackbg{
background-color:#000000;
color:#FFFFFF;
}

Usage:

-----------
<div class="blackbg">This post have black background</div>
-----------
<div class="whitebg">This post have white background</div>
-----------
<div class="blackbg">This post have black background</div>
-----------
<div class="whitebg">This post have white background</div>
-----------

Did I help you? You can help me too Your donations will help me finance my studies.

Jervy Senior · 250 posts #3

But in chat or shoutbox even in autoindex you cant do it like that when s0mebody post or reply a message.Anyway thanx 4 your reply.

Does anyone have a way?

ionutvmi Junior · 45 posts #4

i think you need this

<?php // wap-landz.tk for($i=0;$i<5;$i++) { $post_bg = ($bg++%2 == 0) ? "black" : "white"; echo "TexT"; } ?>

PIMP-WAP.NET - PIMP YOUR MOBILE

MASTER-LAND.NET - WAPMASTERS LAND

wapxtech Developer · 189 posts #5

kei_ki7 wrote: Put this into your css

div.whitebg{
background-color:#FFFFFF;
color:#000000;
}
div.blackbg{
background-color:#000000;
color:#FFFFFF;
}

Usage:

-----------
<div class="blackbg">This post have black background</div>
-----------
<div class="whitebg">This post have white background</div>
-----------
<div class="blackbg">This post have black background</div>
-----------
<div class="whitebg">This post have white background</div>
-----------

this one will work.. 😀

External image (may be gone) http://wapx.amob.com Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

Jervy Senior · 250 posts #8

wapxtech i appreciate ur input but try to use it in chat it wont work for an alternate color 🙂

ionutvmi script is w0rking fine

this is what im trying to say

No Alternation With alternation

That's it 🙂 anyway thanx

wapxtech Developer · 189 posts #9

Jervy wrote: wapxtech i appreciate ur input but try to use it in chat it wont work for an alternate color 🙂

ionutvmi script is w0rking fine

this is what im trying to say

No Alternation With alternation

That's it 🙂 anyway thanx

its because you dont include your .css file..

<?
  echo "<link rel='stylesheet' type='text/css' href='your_css_file.css'>";
?>

External image (may be gone) http://wapx.amob.com Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

Jervy Senior · 250 posts #10

I already included my .css file the same way you posted it.

Take a look at this bro..

echo '$autopostmessage';

it work like this..


autopostmessage with black bg

and when someone post an autopostmessage again it will display like this...


autopostmessage with black bg

autopostmessage with black bg

and so on...

No alternate color 🙂

wapxtech Developer · 189 posts #11

Jervy wrote: I already included my .css file the same way you posted it.

Take a look at this bro..

echo '$autopostmessage';

it work like this..


autopostmessage with black bg

and when someone post an autopostmessage again it will display like this...


autopostmessage with black bg

autopostmessage with black bg

and so on...

No alternate color :)

wrong html tag.. it must be

echo "<div class='black'>$autopostmessage</div>";

or

echo "<div class=\"black\"/>$autopostmessage</div>";

External image (may be gone) http://wapx.amob.com Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

Jervy Senior · 250 posts #12

I just f0rgot to write "=" sign.But it function the same way right 🙂

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close