Hallo ich wusste nicht ob ich ein neuen Thread aufmachen sollte.
Hier ist eine fertige version von der random_more_pics.txt für das IPB 1.1.1 MOD Portal Beta 2 von Dragoran
hier zu finden (Achtung um das zu sehen muss man da eingeloggt sein)
Ein paar ergänzungen hab ich vorgenommen.
Angezeigt wird ...
- Name
- Hits
- Downloads
- Bewertung (gesamt)
- Beschreibung
- Kommentare
<?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('/homepages/11/XXXXXXXXXX/4images/config.php');
include('/homepages/11/XXXXXXXXXX/4images/includes/db_mysql.php');
include('/homepages/11/XXXXXXXXXX/4images/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 = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_rating, a.image_votes, a.image_hits, a.image_downloads, a.image_description
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 RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_votes = $row['image_votes'];
$image_hits = $row['image_hits'];
$image_downloads = $row['image_downloads'];
$image_name = $row['image_name'];
$image_rating = $row['image_rating'];
$image_description = $row['image_description'];
$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 "<table width=\"100%\" border=\"0\"><tr>";
echo "<td width=\"41%\"><div align=\"center\"><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></div></td>";
echo "<td width=\"59%\"><p><strong>Name:</strong> $image_name<strong><br>";
echo "Hits: </strong>$image_hits<strong><br>";
echo "Downloads: </strong>$image_downloads<strong><br>";
echo "Bewertungen: </strong>$image_rating (von $image_votes)<br>";
echo "<strong>Beschreibung: </strong>$image_description<strong></strong> </p>";
echo "<p><strong>Kommentare:</strong> $image_comments<br>";
echo "[<a href=\"".ROOT_PATH."details.php?image_id=$image_id\">Vergrössern</a>]";
echo "</p></td></tr><tr><td colspan=\"2\"><hr color=\"#465584\" width=\"90%\" size=\"1\"></td></tr></table>\n";
}
?>
Anleitung:
1. Kompletten Code Kopieren und als Random.php speichern!
2. den PFAD zur 4images Gallerie eintragen.
3. Die anzahl der Bilder eingeben die Angezeigt werden sollen.
4. Speichern und ins Hauptverzeichnis 4images hochladen
5. ACP -> Portal PHP Box erstellen.
Das eintragen...
include("http://www.deine_url.de/4images/random.php");
Fertig!
Achtung: es passt nur in die Mitte da der Text rechts neben dem Bild angezeigt wird. Falls jemand was nicht möchtest muss er einfach im echo Teil unten endfernen.
@Jan
Is das ok wenn ich das auch in die IPB Foren als MOD poste?
Nein ich will es nicht als meins ausgeben... dazu fehlt mir PHP verständnis
