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>";
}
}
?> |