// START NEW PIC MOD /************************************************************************** * * * 4images - A Web Based Image Gallery Management System * * ---------------------------------------------------------------- * * * * File: none * * Copyright: (C) 2002 Jan Sorgalla * * Email: jan@4homepages.de * * Web: http://www.4homepages.de * * MOD for 4images 1.7 & phpBB 2.0.2 * * * * Never released without support from: Nicky (http://www.nicky.net) * * * ************************************************************************** * * * 4images ist KEINE Freeware. Bitte lesen Sie die Lizenz- * * bedingungen (http://www.4homepages.de/4images/lizenz.php) für * * weitere Informationen. * * --------------------------------------------------------------- * * 4images is NOT freeware! Please read the Copyright Notice * * (http://www.4homepages.de/4images/lizenz_e.php) for further * * information. * * * *************************************************************************/ // Set here the URL to your 4images Gallery. WITH trailing slash! define('SCRIPT_URL', 'http://YOUR-URL-TO/4images/'); // Set here your THUMBNAIL directory. Normally no need to change. WITHOUT trailing slash! define('THUMB_DIR', 'data/thumbnails'); function is_remote($file_name) { return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0; } // Set thumbnails to show $new_thumbs = 4; // In following query CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")! $sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file FROM 4images_images a, 4images_categories b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=0 AND b.auth_viewimage=0 ORDER BY a.image_id DESC LIMIT $new_thumbs"; $result = $db->sql_query($sql); $newpics = "\n\n"; if ($db->sql_numrows($result) > 0) { while ($row = $db->sql_fetchrow($result)) { $image_id = $row['image_id']; $cat_id = $row['cat_id']; $image_name = $row['image_name']; $thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']; $newpics .= "\n"; } } else { $newpics .= "\n"; } $newpics .= "
\"$image_name\"nothing here
\n"; // HAVE FUN // END NEW PIC MOD