Correct. Which is why, you must
replace :
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('GET_CACHES', 1);
define('SCRIPT_URL', 'http://www.gpaed.de/bildergalerie/');
define('ROOT_PATH', '/www/htdocs/******/bildergalerie/');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
with :
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('GET_CACHES', 1);
define('ROOT_PATH', '/www/htdocs/******/bildergalerie/');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
and use the SCRIPT_URL from your includes/constants.php file since the definition is already detected from your global.php file since global.php is included in this file as well.
That did not work.
I changed in the path to details php the ROOT_PATH with the SCRIPT_PATH
so my php-file Newest Image outside 4images looks like this
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('GET_CACHES', 1);
define('SCRIPT_URL', 'http://www.gpaed.de/bildergalerie/');
define('ROOT_PATH', '/www/htdocs/v030672/bildergalerie/');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_hits
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."
ORDER BY image_date DESC
LIMIT 3";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = multilang($row['image_name']);
$image_hits = $row['image_hits'];
$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=\"".$site_sess->url(SCRIPT_URL."details.php?".URL_IMAGE_ID."=".$image_id)."\"><img src=\"".$thumb_src."\" border=\"0\"></a>\n";
echo "<br><b>".$image_name."</b><br>\n";
echo $lang['hits'] . REPLACE_EMPTY . $image_hits."<br><br>\n";
}
?>
Again, Thank you very much for your help, TheOracleNow I'm trying your code suggestion for random image
Matthias