Public paste
fsv
By: ssads | Date: Jul 14 2007 12:22 | Format: PHP | Expires: never | Size: 4.88 KB | Hits: 1328

  1. <?php
  2. include_once("functies/ubb.php");
  3.  
  4. $sql    = mysql_query("SELECT id,titel FROM cms_sale_cats ORDER by id ASC")or die(mysql_error());
  5.  
  6. If(mysql_num_rows($sql) == 0)
  7. {
  8.         echo top("Er is een fout opgetreden");
  9.         echo "<table width='100%' cellpadding='1' cellspacing='1'><td width='100%'>Er zijn geen forums gevonden.</td></table>";
  10.         echo bottom();
  11. }
  12. Else
  13. {
  14.         while($list = mysql_fetch_assoc($sql))
  15.         {
  16.                 echo top("".stripslashes(html($list['titel']))."<a name='".$list['id']."'></a>");
  17.                 echo "<table width='100%' cellpadding='0' cellspacing='3'><td width='100%' style='border: 1px solid ".$border."'>
  18.                 <table width='100%' cellpadding='0' cellspacing='0'>";
  19.  
  20.                 echo "<td height='20' width='5%'>&nbsp;</td>
  21.                 <td bgcolor='".$bg1."' height='20' style='border-left: 1px solid ".$border.";' width='46%'>&nbsp;<b>Forum & beschrijving:</b></td>
  22.                 <td height='20' style='border-left: 1px solid ".$border.";' width='10%'><center>&nbsp;<b>Topics:</b>&nbsp;</center></td>
  23.                 <td bgcolor='".$bg1."' height='20' style='border-left: 1px solid ".$border.";' width='11%'><center>&nbsp;<b>Reacties:</b>&nbsp;</center></td>
  24.                 <td height='20' style='border-left: 1px solid ".$border.";' width='30%'><center><b>Laatste post:</b></center></td><TR>";
  25.                
  26.                         $sql2 = mysql_query("SELECT id,titel,beschrijving,laatstepost FROM cms_sale WHERE cat_id='".$list['id']."' ORDER by id ASC")or die(mysql_error());
  27.  
  28.                                 If(mysql_num_rows($sql2) == 0)
  29.                                 {
  30.                                         echo "<td width='100%' colspan='5' style='border-top: 1px solid ".$border."'><table width='100%' cellpadding='1' cellspacing='1'><td width='100%'>Er is nog geen categorie toegevoegt aan dit forum.</td></table></td>";
  31.                                 }
  32.                                 Else
  33.                                 {
  34.                                         include_once("./functies/ubb.php");
  35.  
  36.                                         while($row = mysql_fetch_assoc($sql2))
  37.                                         {
  38.                                                 If($row['laatstepost'] == "N.v.t.")
  39.                                                 {
  40.                                                         $navigatie[1] = "";
  41.                                                         $row['laatstepost'] = $row['laatstepost'];
  42.                                                 }
  43.                                                 Else
  44.                                                 {
  45.                                                         $navigatie          = explode(",", $row['laatstepost']);
  46.  
  47.                                                         $s_lid              = mysql_query("SELECT status,gebruikersnaam FROM cms_leden WHERE id='".$navigatie[0]."'")or die(mysql_error());
  48.                                                         $lid                = mysql_fetch_assoc($s_lid);
  49.  
  50.                                                         $row['laatstepost'] = "Door ".status($lid['gebruikersnaam'],$lid['status']).",<BR><sub>Op ".$navigatie[1]." <a href='index.php?cfz=sale/topic.php&id=".$navigatie[2]."'><img src='template/".$gebruiker['thema']."/laatste.gif' border='0'></a></sub>";
  51.                                                 }
  52.  
  53.                                                         $reactie            = mysql_query("SELECT count(1) FROM cms_sale_reacties WHERE forum_id='".$row['id']."'")or die(mysql_error());
  54.                                                         $reacties           = mysql_result($reactie, 0);
  55.  
  56.                                                         $topic              = mysql_query("SELECT count(1) FROM cms_sale_topics WHERE forum_id='".$row['id']."'")or die(mysql_error());
  57.                                                         $topics             = mysql_result($topic, 0);
  58.  
  59.                                                         $img_actie          = explode("-", $navigatie[1]);
  60.        
  61.                                                         If($img_actie[0] == date("d"))
  62.                                                         {
  63.                                                                 $forum_actief = "<img src='template/".$gebruiker['thema']."/niet_actief.gif'>";
  64.                                                         }
  65.                                                         Else
  66.                                                         {
  67.                                                                 $forum_actief = "<img src='template/".$gebruiker['thema']."/actief.gif'>";
  68.                                                         }
  69.  
  70.                                                         echo "<td style='border-top: 1px solid ".$border."' width='5%' class='row'><center>".$forum_actief."</center></td>
  71.                                                         <td bgcolor='".$bg1."' class='row' style='border-left: 1px solid ".$border."; border-top: 1px solid ".$border."' width='46%' onclick="window.location='index.php?cfz=sale/forum.php&id=".$row['id']."'"><table cellpadding='1' cellspacing='0' width='100%'><td width='100%'><span style='float:right'><a href='index.php?cfz=sale/nieuw.php&fora=".$row['id']."'><img border='0' src='template/".$gebruiker['thema']."/nieuw.gif' alt='Open een nieuw topic in dit forum.'></span><a href='index.php?cfz=sale/forum.php&id=".$row['id']."'><b>› ".html(stripslashes($row['titel']))."</b></a><BR>".stripslashes(ubb($row['beschrijving']))."</td></table></td>
  72.                                                         <td style='border-left: 1px solid ".$border."; border-top: 1px solid ".$border."' width='10%' class='row'><center>".number_format($topics)."</center></td>
  73.                                                         <td bgcolor='".$bg1."' style='border-left: 1px solid ".$border."; border-top: 1px solid ".$border."' width='11%' class='row'><center>".number_format($reacties)."</center></td>
  74.                                                         <td style='border-left: 1px solid ".$border."; border-top: 1px solid ".$border."' width='30%' class='row'><center>".$row['laatstepost']."</center></td><TR>";
  75.                                                        
  76.                                         }
  77.                                 }
  78.                
  79.                 echo "</table></table>";
  80.                 echo bottom();
  81.         }
  82.  
  83.         echo top("Forum legenda");
  84.         echo "<table width='100%' cellpadding='1' cellspacing='1'><td width='1%'><img src='template/".$gebruiker['thema']."/niet_actief.gif'></td><td>Er is vandaag een topic of reactie geplaatst in dit forum.</td><TR><td width='1%'><img src='template/".$gebruiker['thema']."/actief.gif'></td><td>Er is vandaag geen nieuwe topic/reactie bijgekomen in dit forum.</td></table>";
  85.         echo bottom();
  86. }
  87.  
  88. ?>