Haber si me entienden!!!! estube intentando con este > Muestra ultimas imagenes puestas en el galeria
http://www.4homepages.de/forum/index.php?PHPSESSID=66c195ebb3609bec59ac71e9be1ab417&topic=7893.0esta interesante y sirbe! pero no puedo MODIFICARLO para que solo MUESTRE 1 ultima imagen de una categoria especifica!!
onda solo ultima puesta en categoria 1 - 3 - 7 en diferentes lado de la WEB
intente colocar varias veces el script anterior!!! cambiandole la categoria manualmente pero me salia error de SQL y varias cosas
TRATE DE HACER ALGO ASI!!
</body>
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (http://www.4homepages.de/4images/lizenz.php) für *
* weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (http://www.4homepages.de/4images/lizenz_e.php) for further *
* information. *
* *
*************************************************************************/
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
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;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 1;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, 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 = 2
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY image_date DESC
LIMIT $num_images";
$result = $site_db->query($sql);
echo '<table align="center"><tr>';
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 '<td align="center">';
echo "<center><a href=\"4images/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" bordercolor=\"000000\" alt=\"$image_name\" style=\"border: 1px solid black;\" class=\"imagelink\"><br></center>\n";
echo "<b><center>$image_name</b><br></center>\n";
echo "<center>Komentarjev: $image_comments</center>\n";
echo '</td>';
}
echo '</tr></table>'
?>
<br<br<br>
y mas abajo la otra categoria
</body>
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (http://www.4homepages.de/4images/lizenz.php) für *
* weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (http://www.4homepages.de/4images/lizenz_e.php) for further *
* information. *
* *
*************************************************************************/
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
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;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 1;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, 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 = 6
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY image_date DESC
LIMIT $num_images";
$result = $site_db->query($sql);
echo '<table align="center"><tr>';
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 '<td align="center">';
echo "<center><a href=\"4images/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" bordercolor=\"000000\" alt=\"$image_name\" style=\"border: 1px solid black;\" class=\"imagelink\"><br></center>\n";
echo "<b><center>$image_name</b><br></center>\n";
echo "<center>Komentarjev: $image_comments</center>\n";
echo '</td>';
}
echo '</tr></table>'
?>
pero me sale eror de remote y DB en mysql.php!!
LO OTRO INTENTE SACARLE LA CONECCION SQL DEL 2 CATEGORIA Y ME MUESTRA LO MISMO
no capto mucho pero con un POKITO DE AYUDA OH GIA!!
DE MAS K LA HAGO!!!!
HELP!!!!!
ALGUIEN POR AHI
ALGUIEN SABE COMO PODER HACER ESTO?????