Hi-
Ok, as I try to integrate this with wbb 2.3.2 I have a problem-
I have created this random.php and in it stands this
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.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黵 *
* 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
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;
}
$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_media_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'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
print("
document.write('<a href=\"".SCRIPT_URL."/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>');
");
?>
my 4images directory
www.thecenterofthenet.com/4images/my wbb
www.thecenterofthenet.com/ww2/in my index template I have created this:
<SCRIPT language='JavaScript' src='
http://thecenterofthenet.com/wbb2/random.php'></SCRIPT>
The problem is that I get the link, however no image.
It seems to me somthing is wrong with the thumbnail source. However, since the paths seem to be correct why isnt it finding the thumbnail source?
I mean, if you want to see the error you can check out
www.thecenterofthenet.com/wbb2/underneath the login window you can see the correct link to the details.
Site is under heavy constriction.
Thanks-
Robert