';
$top .= '
'.$anzahl.'
';
$bottom = '
';
echo $top;
$fieldlist = $t_title.' AS title, '.$t_content.' AS content';
if(!empty($t_subtitle)) $fieldlist .= ', '.$t_subtitle.' AS subtitle';
if(!empty($t_date)) $fieldlist .= ', '.$t_date.' AS date';
if(!empty($t_num)) $fieldlist .= ', '.$t_num.' AS num';
if(!empty($t_kategorie)) $fieldlist .= ', '.$t_kategorie.' AS kategorie';
if(!empty($t_image)) $fieldlist .= ', '.$t_image.' AS image';
if(!empty($t_bildunterschrift)) $fieldlist .= ', '.$t_bildunterschrift.' AS bildunterschrift';
if(!empty($t_name)) $fieldlist .= ', '.$t_name.' AS name';
if(!empty($t_firma)) $fieldlist .= ', '.$t_firma.' AS firma';
if(!empty($t_strasse)) $fieldlist .= ', '.$t_strasse.' AS strasse';
if(!empty($t_plz)) $fieldlist .= ', '.$t_plz.' AS plz';
if(!empty($t_ort)) $fieldlist .= ', '.$t_ort.' AS ort';
if(!empty($t_land)) $fieldlist .= ', '.$t_land.' AS land';
if(!empty($t_telefon)) $fieldlist .= ', '.$t_telefon.' AS telefon';
if(!empty($t_email)) $fieldlist .= ', '.$t_email.' AS email';
if(!empty($t_url)) $fieldlist .= ', '.$t_url.' AS url';
if(!empty($t_profil)) $fieldlist .= ', '.$t_profil.' AS profil';
if(!empty($t_pressekontakt)) $fieldlist .= ' ,'.$t_pressekontakt.' AS pressekontakt';
$sql = "SELECT ".$fieldlist." FROM ".$db_tab;
if(!empty($t_date) && !empty($t_num)): $sql .= " WHERE ".$t_date." <= '".$now."' ORDER BY ".$t_date." DESC , ".$t_num." DESC LIMIT 0, ".$anzahl.""; endif;
if(!empty($t_date) && empty($t_num)): $sql .= " WHERE ".$t_date." <= '".$now."' ORDER BY ".$t_date." DESC LIMIT 0, ".$anzahl.""; endif;
if(!empty($t_num) && empty($t_date)): $sql .= " ORDER BY ".$t_num." DESC LIMIT 0, ".$anzahl.""; endif;
$connection = mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
$db = mysql_select_db($db_name, $connection);
$data = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($data)) {
echo '- ';
if(!empty($row['num'])) echo ''.$row['num'].'';
if(!empty($row['title'])) echo '';
if(!empty($row['subtitle'])) echo '';
if(!empty($row['date'])) echo ''.$row['date'].'';
if(!empty($row['content'])) echo '';
if(!empty($row['kategorie'])) echo '';
if(!empty($row['name'])) echo '';
if(!empty($row['firma'])) echo '';
if(!empty($row['strasse'])) echo '';
if(!empty($row['plz'])) echo '';
if(!empty($row['ort'])) echo '';
if(!empty($row['land'])) echo '';
if(!empty($row['telefon'])) echo '';
if(!empty($row['email'])) echo '';
if(!empty($row['url'])) echo '';
if(!empty($row['pressekontakt'])) echo '';
if(!empty($row['profil'])) echo '';
if(!empty($row['image'])) echo '';
if(!empty($row['bildunterschrift'])) echo '';
echo '
';
}
echo $bottom;
?>