Toon posts:

[php] kleur van tabelen

Pagina: 1
Acties:
  • 65 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb een script, dat script wordt gebruik om de laatste 10 topics van en forum te laten zien. Nu heb ik het helemaal werkend enzo, maar ik wil graag dat om en om de kleur van de tabel donker blauw en lichtblauw is. Nu zijn alle tabelen #22538c maar ik wil ook #336699. Kan iemand vertellen hoe? hieronder vind je de code van het script.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
$ServerPath = "config.php"; 
$URLPath = "http://www.jesite.com";
$PostNumber = "10";
$type = "topics";
include_once("$ServerPath");
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection");
@mysql_select_db("$dbname",$db) or die("here we die");

if($type == "posts")
    $sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM topics t, forums f, posts p WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id ORDER BY post_id DESC LIMIT $PostNumber";
else
    $sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM topics t, forums f WHERE f.forum_id = t.forum_id ORDER BY topic_time DESC LIMIT $PostNumber";

if($r = mysql_query($sql, $db)) {
while($m = mysql_fetch_array($r)) {
$j = stripslashes($m[topic_title]);
$k = substr($j, 0, 15) . "...";
        echo "<tr><td bgColor="#22538c" height="18">
                [img]"menu_arrow.gif"[/img]
                </font><a onmouseover="window.status='$j';return true" title="$j" onmouseout="window.status='';return true" href="$URLPath/viewtopic.php?topic=$m[topic_id]&forum=$m[forum_id]" target="_blank">
                <font face="Arial" color="#ffffff" size="2">$k</font></a></td></tr>";
    }
}
?>

  • chem
  • Registratie: Oktober 2000
  • Laatst online: 27-08 13:53

chem

Reist de wereld rond

dit is al vele malen behandeld
zoek maar eens op ++$x % 2 == 1 bv.

Klaar voor een nieuwe uitdaging.


Dit topic is gesloten.