Die neusten Bilder der 4images Galerie in Contenido einbinden
Funktionen:
Anzahl anzuzeigende Bilder einstellbar
Anzahl Bilder in einer Reihe einstellbar
Kommentare werden angezeigt
Link auf Orginalbild in der Galerie
Bildname wird angezeigt
INPUT:
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : 4images Schnittstelle - neuste Bilder
* Author(s) : Markus Grampp
* Copyright : DJ W. Event- & IT-Service
* Created : 30.01.2006
************************************************/
?>
<table border="0">
<tr>
<td><?php echo mi18n("Anzahl der Bilder");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[0]";?>" value="<?php echo "CMS_VALUE[0]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("Anzahl Bilder in einer Zeile");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[3]";?>" value="<?php echo "CMS_VALUE[3]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("Url der Galerie");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[1]";?>" value="<?php echo "CMS_VALUE[1]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("ROOTH PATH der Galerie");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[2]";?>" value="<?php echo "CMS_VALUE[2]"; ?>"></td>
</tr>
</table>
<?php
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : 4images Schnittstelle - neuste Bilder
* Author(s) : Markus Grampp
* Copyright : DJ W. Event- & IT-Service
* Created : 30.01.2006
************************************************/
////////////////////////////////////////////////////////////////////////////////////////////
// Einstellungen Start
$PicLimit ="CMS_VALUE[0]";//Menge der anzuzeigenden Bilder
//define('SCRIPT_URL', 'http://www.url.de/galerie/'); // URL der Galerie (http://www.meineseite.de/galerie/)
define('SCRIPT_URL', "CMS_VALUE[1]"); // URL der Galerie (http://www.meineseite.de/galerie/)
//define('ROOT_PATH', '/opt/htdocs/galerie/'); // Absolutes Verzeichniss der Galerie(opt/htdocs/galerie,....)
define('ROOT_PATH', "CMS_VALUE[2]"); // Absolutes Verzeichniss der Galerie(opt/htdocs/galerie,....)
// $PicInRow = "4"; // Anzahl Bilder in einer Zeile
$PicInRow = "CMS_VALUE[3]"; // Anzahl Bilder in einer Zeile
// Einstellungen Ende
////////////////////////////////////////////////////////////////////////////////////////////
if ("CMS_VALUE[0]" != "" && "CMS_VALUE[1]" != "" && "CMS_VALUE[2]" != "") {
$Path = pathinfo($_SERVER["SCRIPT_FILENAME"]);
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 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."
AND a.image_thumb_file LIKE '%jpg'
ORDER BY image_date DESC
LIMIT ".$PicLimit;
$result = $site_db->query($sql);
echo "<center><table border=\"0\" cellspacing=\"3\" cellpadding=\"4\"><tr>";
$iPicIndex = 0;
while ($row = $site_db->fetch_array($result)) {
$iPicIndex++;
if ($iPicIndex == $PicInRow) {
$iPicIndex = 0;
echo "</tr></table></center>";
echo "<center><table border=\"0\" cellspacing=\"3\" cellpadding=\"4\"><tr>";
}
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
if (($pos = strrpos($thumb_src, ".")) === FALSE)
continue;
else {
$extension = substr($thumb_src, $pos + 1);
if ($extension == "JPG" ||$extension == "jpg" ||$extension == "jpeg" ) {
$image_comments = $row['image_comments'];
echo "<td width=\"125\" align=\"center\" valign=\"bottom\">";
echo "<font face=\"tahoma\" size=\"1\"><b>$image_name</b><br>";
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=_blank><img src=\"".$thumb_src."\" border=\"0\" vspace=\"3\" hspace=\"3\" alt=\"Bild: $image_name vergrößern !\"></a><br>\n";
echo "Kommentare: $image_comments</font>";
echo "</td>";
}
}
}
echo "</tr></table></center>";
}
?>
Galerie: http://www.eventbasar.de/galerie/