Habe meine Template-Datei und das passende Skript (einschließlich Datenbank) erweitert:
$design = new design ( $title , $hmenu );
$design->header();
$limit = $img_per_site;
$page = ($menu->getA(2) == 'p' ? escape($menu->getE(2), 'integer') : 1 );
$MPL = db_make_sites ($page , '' , $limit , '?gallery-'.$cid , "gallery_imgs LEFT JOIN prefix_downloads_maps_css ON prefix_gallery_imgs.cat = prefix_downloads_maps_css.gallery WHERE prefix_gallery_imgs.cat = ".$cid );
$anfang = ($page - 1) * $limit;
$erg = db_query("SELECT prefix_gallery_imgs.id,prefix_gallery_imgs.cat,datei_name,endung,prefix_gallery_imgs.`besch`,klicks,prefix_gallery_imgs.vote_wertung as vote_wertung,prefix_gallery_imgs.vote_klicks as vote_klicks FROM prefix_gallery_imgs LEFT JOIN prefix_downloads_maps_css ON prefix_gallery_imgs.cat = prefix_downloads_maps_css.gallery WHERE prefix_gallery_imgs.cat = ".$cid." AND (recht >= ".$_SESSION['authright']." OR recht IS NULL) ORDER BY id ASC LIMIT ".$anfang.",".$limit);
//$erg = db_query("SELECT prefix_gallery_imgs.id,prefix_gallery_imgs.cat,datei_name,endung,prefix_gallery_imgs.`besch`,klicks,prefix_gallery_imgs.vote_wertung as vote_wertung,prefix_gallery_imgs.vote_klicks as vote_klicks FROM prefix_gallery_imgs LEFT JOIN prefix_downloads_maps_css ON prefix_gallery_imgs.cat = prefix_downloads_maps_css.gallery ORDER BY id ASC LIMIT");
if ( db_num_rows($erg) > 0 ) {
$tpl->set('imgperline', $allgAr['gallery_imgs_per_line']);
$tpl->set('cname', $cname);
$tpl->set('breite', $allgAr['gallery_normal_width']+30);
$tpl->set('MPL',$MPL);
$tpl->out(1); $class = 'Cnorm';
$i = 0;
while($row = db_fetch_assoc($erg) ) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
$row['anz_koms'] = db_result(db_query("SELECT COUNT(*) FROM prefix_koms WHERE uid = ".$row['id']." AND cat = 'GALLERYIMG'"),0);
$row['besch'] = unescape($row['besch']);
$row['width'] = round( 100 / $img_per_line );
$row['bildr'] = $i + (($page-1) * $img_per_site);
if ( $i <> 0 AND ($i % $img_per_line ) == 0 ) { echo '</tr><tr>'; }
$tpl->set_ar_out($row,2);
$i++;
}
if ( $i % $img_per_line <> 0 ) {
$anzahl = $img_per_line - ($i % $img_per_line);
for($x=1;$x<=$anzahl;$x++){
echo '<td class="'.$class.'"></td>';
}
}
$tpl->out(3);
}
$design->footer();
Bekomme jedoch ständig diesen Fehler:
Zitat
Warning: Division by zero in /home/web336/kevi19/ftproot/www.wiskyjim.de/include/includes/func/db/mysql.php on line 107
MySQL Error:
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
in Query:
SELECT ic1_gallery_imgs.id,ic1_gallery_imgs.cat,datei_name,endung,ic1_gallery_imgs.`besch`,klicks,ic1_gallery_imgs.vote_wertung as vote_wertung,ic1_gallery_imgs.vote_klicks as vote_klicks FROM ic1_gallery_imgs LEFT JOIN ic1_downloads_maps_css ON ic1_gallery_imgs.cat = ic1_downloads_maps_css.gallery WHERE ic1_gallery_imgs.cat = 14 AND (recht >= -9 OR recht IS NULL) ORDER BY id ASC LIMIT 0,
Debug backtrace:
@ mysql.php:32 -- debug_bt()
@ mysql.php:50 -- db_check_error(...)
@ dwn_map_css.php:383 -- db_query(...)
@ index.php:37 -- require_once(...)
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/web336/kevi19/ftproot/www.wiskyjim.de/include/includes/func/db/mysql.php on line 71
Such jetzt schon seit 3 Stunden wie ein Bekloppter und komm nicht dahinter.