Hallo Kummer,
Schön, dass du da bist. Wäre toll wenn du nachschauen könntest.
Soweit ich es gesehen habe, ist es wirklich die Galerie, die den Pfad verändert. Habe gestern abend nicht mehr gesucht. Werde mich gleich dran setzten!
Hier die Galerie
Code: Alles auswählen
<?
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : w3concepts.gallery.v1
* Author : Andreas Kummer
* Copyright : mumprecht & kummer w3concepts
* Created : 30-08-2004
* Modified : 30-08-2004
************************************************/
class gallery {
function gallery() {
// initialwerte setzen
$this->setInitValues();
// aussteigen, falls initialwerte nicht sinnvoll
if (!$this->checkInitValues()) return false;
// quellverzeichnis auslesen
$this->readDir();
// zeiger für showNextPicture setzen
if (empty($_REQUEST['pos'])) {
$this->showNextPictureSeq = -1;
} else {
$this->showNextPictureSeq = $_REQUEST['pos'] - 1;
}
// datenbankzugriff initialisieren
$this->db = new DB_Contenido;
// galerie ausgeben
$this->showGallery();
// gegebenenfalls navigation ausgeben
$this->showNavigation();
}
function setInitValues() {
// konfigurationswerte aus dem input-script
// übernehmen
$this->path['pictures'] = "CMS_VALUE[0]";
$this->path['thumbs'] = "CMS_VALUE[1]";
$this->path['upload'] = $GLOBALS['cfgClient']["{$GLOBALS['client']}"]['upload'];
$this->path['html'] = $GLOBALS['cfgClient']["{$GLOBALS['client']}"]['path']['htmlpath'];
$this->abspath['pictures'] = $GLOBALS['cfgClient']["{$GLOBALS['client']}"]['path']['frontend'].$GLOBALS['cfgClient']["{$GLOBALS['client']}"]['upload'].$this->path['pictures'];
$this->abspath['thumbs'] = $GLOBALS['cfgClient']["{$GLOBALS['client']}"]['path']['frontend'].$GLOBALS['cfgClient']["{$GLOBALS['client']}"]['upload'].$this->path['thumbs'];
$this->htmlpath = $GLOBALS['cfgClient']["{$GLOBALS['client']}"]['path']['htmlpath'].$GLOBALS['cfgClient']["{$GLOBALS['client']}"]['upload'];
$this->thumbnailSize['width'] = "CMS_VALUE[2]";
$this->thumbnailSize['height'] = "CMS_VALUE[3]";
$this->tableSize['cols'] = "CMS_VALUE[4]";
$this->tableSize['rows'] = "CMS_VALUE[5]";
$this->link['previous'] = "CMS_VALUE[6]";
$this->link['next'] = "CMS_VALUE[7]";
}
function checkInitValues() {
// prüfen, ob es sich bei den übergebenen pfaden
// um tatsächlich vorhandene pfade im dateisystem
// handelt. gegebenenfalls wird eine ausgabe
// an den browser vorgenommen und false zurückgegeben.
if (!chdir($this->abspath['pictures'])) {
echo "<p>Das Verzeichnis '{$this->abspath['pictures']}' existiert im Dateisystem
des Servers nicht. Entweder müssen Sie es noch anlegen oder die
Konfiguration Ihres Modules anpassen.</p>";
return false;
}
if (!chdir($this->abspath['thumbs'])) {
echo "<p>Das Verzeichnis '{$this->abspath['thumbs']}' existiert im Dateisystem
des Servers nicht. Entweder müssen Sie es noch anlegen oder die
Konfiguration Ihres Modules anpassen.</p>";
return false;
}
if ($this->thumbnailSize['width'] == '') $this->thumbnailSize['width'] = 100;
if ($this->thumbnailSize['height'] == '') $this->thumbnailSize['height'] = 100;
if ($this->tableSize['cols'] == '') $this->tableSize['cols'] = 3;
if ($this->tableSize['rows'] == '') $this->tableSize['rows'] = 3;
if ($this->link['previous'] == '') $this->link['previous'] = '[:: rückwärts ]';
if ($this->link['next'] == '') $this->link['next'] = '[ vorwärts ::]';
// rückgabe im erfolgsfall
return true;
}
function readDir() {
$dir = opendir($this->abspath['pictures']);
while ($file = readdir($dir)) {
$bildinfo = @getimagesize($this->abspath['pictures'].$file);
if (!empty($bildinfo)) {
$picture[] = $file;
}
}
rsort($picture);
closedir($dir);
foreach ($picture as $picture2) {
if (!empty($picture2)) $this->picture[] = $picture2;
}
}
function showNextPicture() {
// zeiger um eins erhöhen
$this->showNextPictureSeq++;
// wenn keine bild mehr vorhanden ist, false zurück geben
if ($this->showNextPictureSeq >= count($this->picture)) return '';
// thumbnail generieren falls erforderlich
$size = $this->generateThumb($this->picture["{$this->showNextPictureSeq}"]);
// originalgrösse des bildes ermitteln
$originalsize = getimagesize($this->abspath['pictures'].$this->picture["{$this->showNextPictureSeq}"]);
// referenz zurück geben
//return "<a href=\"#\" onClick=\"window.open('{$this->path['html']}popupviewer.php?uri={$this->path['upload']}{$this->path['pictures']}{$this->picture[$this->showNextPictureSeq]}','bild','width={$originalsize[0]},height={$originalsize[1]},top=10,left=10,scrollbars=no,topmargin=0,leftmargin=0');bild.document.body.style.margin=0;\"><img src=\"{$this->htmlpath}{$size['filename']}\" width=\"{$size['width']}\" height=\"{$size['height']}\" /></a>";
return "<a href=\"javascript:window.open('{$this->path['html']}popupviewer.php?uri={$this->path['upload']}{$this->path['pictures']}{$this->picture[$this->showNextPictureSeq]}','bild','width={$originalsize[0]},height={$originalsize[1]},top=10,left=10,scrollbars=no,topmargin=0,leftmargin=0');bild.document.body.style.margin=0;\"><img src=\"{$this->htmlpath}{$size['filename']}\" width=\"{$size['width']}\" height=\"{$size['height']}\" /></a>";
}
function generateThumb($filename) {
$src_image_size = getimagesize($this->abspath['pictures'].$filename);
// prüfen, ob thumbnail bereits vorhanden ist
if (!file_exists("{$this->abspath['thumbs']}{$this->thumbnailSize['width']}.{$this->thumbnailSize['height']}.$filename.jpg")) {
// ermitteln ob das bild auf bestimmte höhe oder bestimmte breite zu reduzieren ist
// sowie ermitteln, um welchen faktor das bild zu verkleinern ist
if ($src_image_size[0]/$src_image_size[1] > $this->thumbnailSize['width']/$this->thumbnailSize['height']) {
$verkleinerungsfaktor = $this->thumbnailSize['width']/$src_image_size[0];
} else {
$verkleinerungsfaktor = $this->thumbnailSize['height']/$src_image_size[1];
}
// berechnen der thumbnailgrösse
$bildhoehe = round($src_image_size[1] * $verkleinerungsfaktor);
$bildbreite = round($src_image_size[0] * $verkleinerungsfaktor);
// thumbnail erstellen
$dst_im = imagecreatetruecolor($bildbreite,$bildhoehe);
if ($src_image_size[2] == 1) {
$src_im = imagecreatefromGIF("{$this->abspath['pictures']}$filename");
} elseif ($src_image_size[2] == 2) {
$src_im = @ImageCreateFromJPEG("{$this->abspath['pictures']}$filename");
} else {
$src_im = @imagecreatefromgd("{$this->abspath['pictures']}$filename");
}
imagecopyresampled ($dst_im,$src_im,0,0,0,0,$bildbreite,$bildhoehe,$src_image_size[0],$src_image_size[1]);
imagejpeg ($dst_im,"{$this->abspath['thumbs']}{$this->thumbnailSize['width']}.{$this->thumbnailSize['height']}.$filename.jpg",100);
$size['width'] = $bildbreite;
$size['height'] = $bildhoehe;
} else {
$thumbnailsize = getimagesize("{$this->abspath['thumbs']}{$this->thumbnailSize['width']}.{$this->thumbnailSize['height']}.$filename.jpg");
$size['width'] = $thumbnailsize[0];
$size['height'] = $thumbnailsize[1];
}
$size['filename'] = "{$this->path['thumbs']}{$this->thumbnailSize['width']}.{$this->thumbnailSize['height']}.$filename.jpg";
return $size;
}
function getDescription() {
$sql = "SELECT description FROM {$GLOBALS['cfg']['tab']['upl']}
WHERE
filename = '{$this->picture[$this->showNextPictureSeq]}'
AND dirname = '{$this->path['pictures']}'
";
$this->db->query($sql);
$this->db->next_record();
return $this->db->f("description");;
}
function showGallery() {
$cellwidth = floor(100/$this->tableSize['cols']);
echo "<table width=\"100%\">\n";
for ($i = 0;$i < $this->tableSize['rows'];$i++) {
$beschreibung = null;
echo "<tr>\n";
for ($j = 0;$j < $this->tableSize['cols'];$j++) {
echo "<td align=\"left\" valign=\"top\" width=\"$cellwidth%\">\n".$this->showNextPicture()."\n</td>\n";
$beschreibung[] = $this->getDescription();
}
echo "</tr>\n";
echo "<tr>\n";
for ($j = 0;$j < $this->tableSize['cols'];$j++) {
echo "<td align=\"left\" valign=\"top\" width=\"$cellwidth%\" style=\"padding-bottom:10px; font-style: italic;\">\n{$beschreibung[$j]}\n</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
}
function showNavigation() {
if ($this->tableSize['cols'] * $this->tableSize['rows'] < count($this->picture)) {
echo "<table width=\"100%\">\n<tr>\n";
if (!empty($_REQUEST['pos'])) {
$pos = ($this->showNextPictureSeq <= $this->tableSize['cols'] * $this->tableSize['rows']) ? (0) : ($this->showNextPictureSeq - (2 * $this->tableSize['cols'] * $this->tableSize['rows']) + 1);
$pos = ($pos < 0) ? (0) : ($pos);
$link = $GLOBALS['sess']->url("front_content.php?client={$GLOBALS['client']}&lang={$GLOBALS['lang']}&idcat={$GLOBALS['idcat']}&idart={$GLOBALS['idart']}&pos=$pos");
echo "<td style=\"text-align:left; width:33%\"><a href=\"$link\">{$this->link['previous']}</a></td>";
} else {
echo "<td style=\"text-align:left; width:33%\"> </td>";
}
echo "<td align=\"center\" width=\"33%\"> </td>";
if ($this->showNextPictureSeq + 1 < count($this->picture)) {
$pos = $this->showNextPictureSeq + 1;
$link = $GLOBALS['sess']->url("front_content.php?client={$GLOBALS['client']}&lang={$GLOBALS['lang']}&idcat={$GLOBALS['idcat']}&idart={$GLOBALS['idart']}&pos=$pos");
echo "<td style=\"text-align:right; width:33%\"><a href=\"$link\">{$this->link['next']}</a></td>";
} else {
echo "<td style=\"text-align:right; width:33%\"> </td>";
}
echo "</tr>\n</table>\n";
}
}
}
// Debug Infos
$aktuelpfad = getcwd();
echo "<p>Der Pfad vor".$aktuelpfad."</p>";
$gallery = new gallery();
// Debug Infos
$aktuelpfad = getcwd();
echo "<p>Der Pfad nach".$aktuelpfad."</p>";
?>
Hier den Online-Zähler: Gegeünber das originale Modul habe ich nur die Ausgabe in mehrere Sprache übersetzt.
Code: Alles auswählen
<?
// Online Besucher
# Zeit in Sekunden bis neu gezählt wird
$online = "120";
# Die Datei in der die IP und zeit gespeichert werden
// Ajour Eric 03.03.05: chemin du frontend: $cfgClient[$client]["path"]["frontend"] = /.../cms/
$datei = $cfgClient[$client]["path"]["frontend"]."useronline.dat";
//Debug Infos
$aktuelpfad = getcwd();
echo "<p>Die ".$datei."<br>Der Pfad ".$aktuelpfad."</p>";
$zeit = time();
$fp = fopen($datei, "r");
$daten = "";
$count = "1";
$online = $zeit - $online;
while($zeilen = fgets($fp, 1000)){
$zeilen = chop($zeilen);
$inhalt = explode("|", $zeilen);
if($inhalt[0] == $REMOTE_ADDR || $inhalt[1] < $online || $inhalt[0] == "")
continue;
$daten = "$inhalt[0]|$inhalt[1]\n";
$count++;
}
fclose($fp);
$daten .= "$REMOTE_ADDR|$zeit\n";
$fp = fopen($datei, "w");
flock($fp,1);
fwrite($fp, $daten);
flock($fp,3);
fclose($fp);
echo '
<table width="165" border="0" cellspacing="0" cellpadding="0">
<tr><td height="21" width="22" style="border: 0px; border-left:1px; border-top:1px; border-bottom:1px; border-color: #000000; border-style: solid; background-color: #66CCCC"><img src="upload/tools/wuerfelnews.gif" ALT="" width="22" height="21" border="0"></td>
<td width="143" style="border: 1px; border-left:0px; border-color: #000000; border-style: solid; background-color: #66CCCC; padding-left:10px" class="umfragetitel">Statistiken</td></tr>';
// Ajout Eric
$dertext["1"] = " Besucher ist online";
$dertext["5"] = " visitor is online";
$dertext["6"] = " visiteur est en ligne";
if ($count=="1") {
// Version originale
// echo "<span class=\"KleinVisiteur\"> $count Besucher ist online</span><br>";
// Ajout Eric
// echo "<p>".$count.$dertext[$lang]."</p> ";
//echo "<span class=\"KleinVisiteur\"> ".$count.$dertext[$lang]."</span><br>";
echo '<tr><td colspan="2" height="22" style="border-left:1px; border-right:1px; border-top:0px; border-bottom:0px; border-color: #000000; border-style: dashed; background-color: #E6FFFF; padding-left:10px">
<p class="umfrageartikel">'.$count.$dertext[$lang].'</p></td></tr>';
} else {
// Version originale
//echo "<span class=\"KleinVisiteur\"> $count Besucher sind online</span><br>";
// Ajout Eric
$dertext["1"] = " Besucher sind online";
$dertext["5"] = " visitors are online";
$dertext["6"] = " visiteurs sont en ligne";
// echo "<p>".$count.$dertext[$lang]."</p> ";
// echo "<span class=\"KleinVisiteur\"> ".$count.$dertext[$lang]."</span><br>";
echo '<tr><td colspan="2" height="22" style="border-left:1px; border-right:1px; border-top:0px; border-bottom:0px; border-color: #000000; border-style: dashed; background-color: #E6FFFF; padding-left:10px">
<p class="umfrageartikel">'.$count.$dertext[$lang].'</p></td></tr>';
}
//aktueller Monat
$sql2 = 'SELECT
visited
FROM
'.$cfg['tab']['cat_art'].' AS A,
'.$cfg['tab']['stat'].' AS B
WHERE
A.idcatart = B.idcatart AND
A.idcatart = '.$idcatart.' AND
B.idlang = '.$lang;
$db->query($sql2);
if ($db->next_record()) {
// Version originale
// echo '<span class="KleinVisiteur"> '.$db->f('visited').' Seitenaufrufe in diesem Monat</span><br>';
// Ajout Eric
$dertext["1"] = " Seitenaufrufe in diesem Monat";
$dertext["5"] = " hits this month";
$dertext["6"] = " appels ce mois";
// echo "<p>".$db->f('visited').$dertext[$lang]."</p> ";
//echo '<span class="KleinVisiteur"> '.$db->f('visited').$dertext[$lang].'</span><br>';
echo '<tr><td colspan="2" height="22" style="border-left:1px; border-right:1px; border-top:0px; border-bottom:0px; border-color: #000000; border-style: dashed; background-color: #E6FFFF; padding-left:10px">
<p class="umfrageartikel">'.$db->f('visited').$dertext[$lang].'</p></td></tr>';
}
//Letzter Monat
$year = date("Y");
$month = date("m");
if ($month == 1)
{
$month = 12;
$year = $year -1;
} else {
$month = $month -1;
}
$yearmonth = sprintf("%04d%02d",$year,$month);
$sql3='SELECT
C.visited AS archived
FROM
'.$cfg['tab']['cat_art'].' AS A,
'.$cfg['tab']['stat_archive'].' AS C
WHERE
A.idcatart = C.idcatart AND
C.idcatart = '.$idcatart.' AND
C.idlang = '.$lang.' AND
C.archived = '.$yearmonth;
$db->query($sql3);
if ($db->next_record()) {
// Version originale
// echo '<span class="KleinVisiteur"> '.$db->f('archived').' Seitenaufrufe im letzten Monat</span><br>';
// Ajout Eric
$dertext["1"] = " Seitenaufrufe im letzten Monat";
$dertext["5"] = " hits last month";
$dertext["6"] = " appels le mois dernier";
// echo "<p>".$db->f('archived').$dertext[$lang]."</p> ";
// echo '<span class="KleinVisiteur"> '.$db->f('archived').$dertext[$lang].'</span><br>';
echo '<tr><td colspan="2" height="22" style="border-left:1px; border-right:1px; border-top:0px; border-bottom:0px; border-color: #000000; border-style: dashed; background-color: #E6FFFF; padding-left:10px">
<p class="umfrageartikel">'.$db->f('archived').$dertext[$lang].'</p></td></tr>';
}
//Gesamtaufrufe aktuelle Seite
$sql = 'SELECT
visited
FROM
'.$cfg['tab']['cat_art'].' AS A,
'.$cfg['tab']['stat'].' AS B
WHERE
A.idcatart = B.idcatart AND
A.idcatart = '.$idcatart.' AND
B.idlang = '.$lang;
$db->query($sql);
if ($db->next_record()) {
$hits = $db->f('visited');
}
$sql4 = 'SELECT
sum(C.visited) AS archived
FROM
'.$cfg['tab']['cat_art'].' AS A,
'.$cfg['tab']['stat_archive'].' AS C
WHERE
A.idcatart = C.idcatart AND
C.idcatart = '.$idcatart.' AND
C.idlang = '.$lang;
$db->query($sql4);
if ($db->next_record()) {
$hits = $hits + $db->f('archived');
}
// Version originale
// echo '<span class="KleinVisiteur"> '.$hits.' Seitenaufrufe seit März 2005.</span><br>';
/// Ajout Eric
$dertext["1"] = " Seitenaufrufe seit März 2005";
$dertext["5"] = " hits since march 2005";
$dertext["6"] = " appels depuis mars 2005";
// echo "<p>".$hits.$dertext[$lang]."</p> ";
// echo '<span class="KleinVisiteur"> '.$hits.$dertext[$lang].'</span><br>';
echo '<tr><td colspan="2" height="22" style="border: 1px; border-top:0px; border-color: #000000; border-style: dashed; background-color: #E6FFFF; padding-left:10px">
<p class="umfrageartikel">'.$hits.$dertext[$lang].'</p></td></tr>';
echo '</table>';
?>
Vor meine kleine Anpassung von gestern abend mit dem Pfad war die Initialisierung vom Namen so.
Code: Alles auswählen
// Ajour Eric 03.03.05: chemin du frontend:
$datei = "useronline.dat";
Vielan Dank im voraus
Gruß
Eric