Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/01/2004, 12:03
xema
 
Fecha de Ingreso: febrero-2002
Ubicación: Valencia - España
Mensajes: 488
Antigüedad: 23 años, 2 meses
Puntos: 0
problema al mostrar en pagina exterior imagen 4images

Bueno tengo funcionando perfectamente en
http://www.xematuning.com/index.php

un script que encontré para las galerias de 4images q tengo instaladas
que es este:

Código PHP:
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: random.php                                           *
 *    Scriptversion: 1.0 for 4images 1.6.1                                *
 *                                                                        *
*************************************************************************/

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH''./galeria/');

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)) ? 0;
}

$sql "SELECT COUNT(*) as total_images
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        "
;
$row $site_db->query_firstrow($sql);
$total_images $row['total_images'];

mt_srand((double)microtime() * 1000000);
$number = ($total_images 1) ? mt_rand(0$total_images 1) : 0;

$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 = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL.
        LIMIT $number, 1"
;
$row $site_db->query_firstrow($sql);
$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 
"<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Comments: $image_comments<br>\n";
?>
bueno pues ahora quiero cambiar el index de la página y estoy haciendo pruebas, y realizando el mismo código exactamente el mismo para este script me da un error en la base de datos

mirarlo: http://www.xematuning.com/index9.php

no se porque és lo e mirado todo, e intentado poner directamente el codigo en el archivo, utilizando un include, poniendo nada más que ese código para que me muestre la imagen,sustituir el index.php y sólo me funciona en el archivo que tengo ahora en index.php a ver si se os ocurre xq puede ser
__________________
webmaster de xematuning el mejor tuning español con más de 25000 fotos sobre el mundo del tuning, videos, salvapantallas, fondos y mucho más no lo dudes más y visítala!!!