Author Topic: Como insertar imagenes?  (Read 10459 times)

0 Members and 1 Guest are viewing this topic.

Offline krawler

  • Pre-Newbie
  • Posts: 8
    • View Profile
    • http://www.freedonkey.com
Como insertar imagenes?
« on: September 02, 2002, 11:37:13 PM »
Hola soy yo de new,mi pregunta es la sigiente,resulta que me gustaria insertar las imagenes aleatorias en una web diferente,osea todo esta en el mismo dominio,pero son webs con directorios diferentes en el ftp,entonces lo que me gustaria es insertar las imagenes aleatorias en otra web que no sea la de 4imagenes,,,espero que se me entienda,y gracias....



www.freedonkey.com
www.freedonkey.com/desing

Offline dcarrero

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://www.ferca.com
Como insertar imagenes?
« Reply #1 on: September 09, 2002, 09:00:13 AM »
Hay otro articulo en el foro general sobre este tema con informacion y algun ejemplo de como hacerlo, lo tienes en

http://www.4homepages.de/forum/viewtopic.php?t=1020

Offline dcarrero

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://www.ferca.com
Como insertar imagenes?
« Reply #2 on: September 09, 2002, 09:05:01 AM »
El codigo para el random.php, no he podido probarlo, pero dicen q funciona en los foros en ingles.

Code: [Select]
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');

define('SCRIPT_URL', 'http://www.joeemre.de/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;
}

$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'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo "<a href=\"".SCRIPT_URL."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";
?>

Offline krawler

  • Pre-Newbie
  • Posts: 8
    • View Profile
    • http://www.freedonkey.com
lo probare
« Reply #3 on: September 12, 2002, 03:18:52 AM »
aver si rula :lol: