<?php // PATH to your 4images Gallery / PFAD zu Ihrer 4images Galleriedefine('ROOT_PATH', '../'); global $site_db, $cat_cache, $total_images; // NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS$num_images = 5;$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_date, a.image_active, a.image_thumb_file, a.image_comments FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND a.cat_id != 23 AND b.auth_viewcat=".AUTH_ALL." AND b.auth_viewimage=".AUTH_ALL." ORDER BY a.image_date DESC LIMIT $num_images";$result = $site_db->query($sql);if ($result) {while ($row = $site_db->fetch_array($result)) { $image_id = $row['image_id']; $cat_id = $row['cat_id']; $image_name = $row['image_name']; $image_comments = $row['image_comments']; $thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']; echo "<div style='float:left;width:66px;height:68px;margin:3px;padding-bottom:4px;'><div style='border:2px solid #ffffff;width:64px;height:64px;'><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\" width=\"64\" height=\"64\"></div>\n"; echo ShortenText($image_name)."\n"; echo "</div>\n";}}?>
<?php // PATH to your 4images Gallery / PFAD zu Ihrer 4images Galleriedefine('ROOT_PATH', '../'); global $site_db, $cat_cache, $total_images;// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS$num_images = 12;$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_hits, a.image_active, a.image_thumb_file, a.image_comments FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND a.cat_id != '23' AND b.auth_viewcat=".AUTH_ALL." AND b.auth_viewimage=".AUTH_ALL." ORDER BY a.image_hits DESC LIMIT $num_images";$result = $site_db->query($sql);if ($result) {while ($row = $site_db->fetch_array($result)) { $image_id = $row['image_id']; $cat_id = $row['cat_id']; $image_name = $row['image_name']; $image_comments = $row['image_comments']; $thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']; echo "<div style='float:left;width:66px;height:68px;margin:3px;'><div style='border:2px solid #f2f2f2;width:64px;height:64px;'><a href=\"".ROOT_PATH."details.php?image_id=$image_id\" title=\"$image_name\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\" width='64' height='64'><br>\n"; echo "</div></div>\n";}}?>
<?php // PATH to your 4images Gallery / PFAD zu Ihrer 4images Galleriedefine('ROOT_PATH', '../'); global $site_db, $cat_cache, $total_images;// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS$num_images = 8;$sql = "SELECT DISTINCT a.image_id, a.cat_id, a.image_name, a.image_votes, a.image_active, a.image_thumb_file, a.image_comments, a.image_description, a.image_date FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b WHERE a.image_active=1 AND a.cat_id = '23' ORDER BY a.image_date DESC LIMIT $num_images";$result = $site_db->query($sql);if ($result) {while ($row = $site_db->fetch_array($result)) { $image_id = $row['image_id']; $cat_id = $row['cat_id']; $image_description = $row['image_description']; $image_name = $row['image_name']; $image_comments = $row['image_comments']; $thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']; echo "<div style='float:left;width:66px;height:68px;margin:3px;'><div style='border:2px solid #f2f2f2;width:64px;height:64px;'><a href=\"$image_description\" title=\"$image_name\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\" width='64' height='64'><br>\n"; echo "</div></div>\n";}}?>
function ShortenText($text) { // Change to the number of characters you want to display $chars = 10; $text = $text." "; $text = substr($text,0,$chars); $text = substr($text,0,strrpos($text,' ')); $text = $text.""; return $text; }
define('ROOT_PATH', '../');
define('ROOT_PATH', './');include(ROOT_PATH.'config.php');include(ROOT_PATH.'includes/db_mysql.php');include(ROOT_PATH.'includes/constants.php');$site_db = new Db($db_host, $db_user, $db_password, $db_name);function is_remote($file_name) { return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;}