Hey Pro-Coders 
Ich brauch eure hilfe. Und zwar moechte ich das meine Kategorien Titel einen Hintergrund haben und das meine Subkategorien zwei Spalten anstatt eine haben plus hintergrund. Ich hab das mal bei PS gemacht:
So schauts gerade aus:

Und so haette ich es gerne:

Hier ist der code:
Alles anzeigen
Schoene Gruese!
Van

Ich brauch eure hilfe. Und zwar moechte ich das meine Kategorien Titel einen Hintergrund haben und das meine Subkategorien zwei Spalten anstatt eine haben plus hintergrund. Ich hab das mal bei PS gemacht:
So schauts gerade aus:
Und so haette ich es gerne:
Hier ist der code:
Quellcode
- ?>
- <h2><img src="images/category.gif" align="absmiddle"> <?php echo $xcatname; ?></h2>
- <table border="0" cellspacing="1" cellpadding="2" width="100%" class="dir_cat">
- <?php
- // Directory
- if($dir_sort)
- {
- $sortsubcatsql = "ORDER BY subcatname";
- }
- else
- {
- $sortsubcatsql = "ORDER BY pos";
- }
- // First get ads per subcat
- $subcatadcounts = array();
- $sql = "SELECT scat.subcatid, COUNT(*) as adcnt
- FROM $t_ads a
- INNER JOIN $t_subcats scat ON scat.subcatid = a.subcatid AND ($visibility_condn)
- INNER JOIN $t_cities ct ON a.cityid = ct.cityid
- WHERE scat.enabled = '1'
- #$loc_condn
- GROUP BY a.subcatid";
- $res = mysql_query($sql) or die(mysql_error().$sql);
- while($row=mysql_fetch_array($res))
- {
- $subcatadcounts[$row['subcatid']] = $row['adcnt'];
- }
- // Subcategories
- $sql = "SELECT scat.subcatid, scat.subcatname AS subcatname
- FROM $t_subcats scat
- WHERE scat.catid = $xcatid
- AND scat.enabled = '1'
- $sortsubcatsql";
- $res= mysql_query($sql) or die(mysql_error());
- $i = 0;
- while($row=mysql_fetch_array($res))
- {
- $i++;
- if ($i%$dir_cols == 1 || $dir_cols == 1) echo "<tr>";
- $adcount = 0+$subcatadcounts[$row['subcatid']];
- if($sef_urls) $subcat_url = "{$vbasedir}$xcityid/posts/$xcatid/$row[subcatid]_" . RemoveBadURLChars($row['subcatname']) . "/";
- else $subcat_url = "?view=ads&catid=$xcatid&subcatid=$row[subcatid]&cityid=$xcityid〈=$xlang";
- ?>
- <td width="<?php echo $cell_width; ?>%">
- <a href="<?php echo $subcat_url; ?>">
- <?php echo $row['subcatname']; ?></a>
- <span class="count">(<?php echo $adcount; ?>)</span><br>
- </td>
- <?php
- if ($i%$dir_cols == 0) echo "</tr>";
- }
- ?>
- </table>
Schoene Gruese!
Van