Willkommen bei PS-Evolution: Board.
Wenn dies dein erster Besuch hier ist, lies bitte zuerst die Hilfe - Häufig gestellte Fragen durch.
Du musst dich vermutlich registrieren, bevor du Beiträge verfassen kannst. Klicke oben auf 'Registrieren', um den Registrierungsprozess zu starten.
Du kannst auch jetzt schon Beiträge lesen. Suche dir einfach das Forum aus, das dich am meisten interessiert.
|
Webentwicklung HTML, PHP, CSS, Javascript und alles was zum Programmieren im WWW dazu gehört. |
24.05.2010, 17:01
|
#1 (permalink)
|
PS-Evolution Aushilfskraft
Registriert seit: 13.11.2009
Alter: 16
Beiträge: 878
|
Brauche Hilfe Bei PHP
Hallo,
ich habe hier ein Gallerie Script.
der PHP-Quelltext
PHP-Code:
<?php
class dyngall {
//Public Variablen welche bei Klassenaufruf mitgegeben werden können
public $droot = "/www/onlineforum"; //document root - rootpfad der website ohne / am schluss
public $httppath = "/gallery/images/"; //httppath - muss mit / beginnen
public $anzRows = 4;
public $anzCols = 4;
public $maxheight = 160;
public $maxwidth = 120;
public $sortby = "name"; //lastmod | create | name
public $sortorder = "asc"; //asc | desc
public $fullwidth = "100%";
public $direxclusions = array(".", "..");
public $tfn = "thumbs"; //thumbs folder name
//Private Variablen
//Erlaubte Grafikformate (NICHT ÄNDERN)
private $types = array("jpg", "gif", "jpeg", "png");
private $dirs = array();
private $imgs = array();
private $sF = "";
function __construct() {
$this->sF = (isset($_GET['sF']) && strpos(' '.$_GET['sF'], "..") == false) ? "/".$_GET['sF']."/" : "/";
}
//Endung (Zeichen nach Punkt) auslesen
function getFileExt($file) {
$len_end = strlen(strrchr($file, "."));
$len = strlen($file)-$len_end+1;
return substr(strtolower($file), $len);
}
//URL Parameters ändern
function changeURL($params) {
$urlstring = "";
$url_param = $_GET;
foreach($params as $param => $value) {
if(isset($url_param[$param])) { $url_param[$param] = $value; }
else {$url_param[$param] = $value;}
}
foreach($url_param as $urlparam => $urlvalue) {
if($urlvalue != '') { $urlstring .= $urlparam."=".$urlvalue."&"; }
}
return substr($urlstring,0,strlen($urlstring)-1);
}
//Alle Elemente (Ordner & Dateien auslesen und in einem Array speichern)
function getElements($handler) {
$fh = opendir($this->droot.$this->httppath.$this->sF);
$count = 0;
while($curelement = readdir($fh)) {
if(!strpos($curelement, '\'')) {
if($handler == 'dir') {
if(is_dir($this->droot.$this->httppath.$this->sF.$curelement) && !in_array($curelement, $this->direxclusions) && $curelement <> $this->tfn) {
$this->dirs[] = $curelement;
}
} else if($handler == 'img') {
if(is_file($this->droot.$this->httppath.$this->sF.$curelement) && $curelement <> "_preloadimg.gif") {
$extension = $this->getFileExt($curelement);
if(in_array($extension, $this->types)) {
$this->imgs[$count][0] = $curelement; //[x][0] - Name
//Original Grösse auslesen
$sizeoimg = getimagesize($this->droot.$this->httppath.$this->sF.$curelement); //size of image
$this->imgs[$count][1] = $sizeoimg[0]; //[x][1] - Width
$this->imgs[$count][2] = $sizeoimg[1]; //[x][2] - Height
$this->imgs[$count][3] = $sizeoimg[2]; //[x][3] - Grafiktyp 1-4(gif, jpg, png, swf)
//Bearbeitungsdatum auslesen
$this->imgs[$count][4] = filemtime($this->droot.$this->httppath.$this->sF.$curelement);
$this->imgs[$count++][5] = filectime($this->droot.$this->httppath.$this->sF.$curelement);
} } } } } }
//Ausgabe aller Ordner welche im angegebenen Pfad sind
function showDirs() {
$tmp = "";
$bcrumbs = "";
$subpath = explode("/", $this->sF);
foreach($subpath as $curpath) {
if(!empty($curpath)) {
$tmp .= '/'.$curpath;
$bcrumbs .= '<a href="?'. $this->changeURL(array("sF" => substr($tmp, 1), "curi" => "")) .'">'. $curpath .'</a> /';
}
}
echo '<p><a href="?'. $this->changeURL(array("sF" => "")) .'">Home</a> /'. $bcrumbs .'</p>';
$this->getElements('dir');
if(!empty($this->dirs)) {
for($i=0; $i<count($this->dirs); $i++) {
echo '<a href="?'. $this->changeURL(array("sF" => substr($this->sF,1).$this->dirs[$i], "curi" => "")) .'">-> '.$this->dirs[$i].'</a><br />';
} } }
//Ausgabe aller Images welche im angegebenen Pfad sind
function sortArr($a, $b) { //Sortierfunktion (usort) für das Image-Array
switch($this->sortby) {
case "lastmod":
$sorti = 5;
break;
case "create":
$sorti = 4;
break;
case "name":
$sorti = 0;
break;
default:
$sorti = 0;
break;
}
return ($this->sortorder == "desc") ? strcmp($a[$sorti], $b[$sorti]) * -1 : strcmp($a[$sorti], $b[$sorti]);
}
function showImgs() {
ini_set("memory_limit", "32M");
$imgsos = $this->anzRows * $this->anzCols; //images on site
$fios = isset($_GET['curi']) ? floor($_GET['curi']/$imgsos)*$imgsos : 0; //first image on site
$j=$fios;
$tmp = $j+$this->anzCols;
$this->getElements('img');
//Sortieren nach Name OR Lastmod
usort($this->imgs, array("dyngall", "sortArr"));
if(!empty($this->imgs)) {
//Div Element welches das Bild anzeigt src wird bei onclick übergeben ?>
<script>
function showdiv4img() {
document.onkeydown = showDown;
imgnr = (imgnr < 0) ? 0 : imgnr;
imgnr = (imgnr > nav.length-1) ? nav.length-1 : imgnr;
var docwidth,docheight;
if (self.innerHeight) { // all except Explorer
docwidth = self.innerWidth;
docheight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
docwidth = document.documentElement.clientWidth;
docheight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
docwidth = document.body.clientWidth;
docheight = document.body.clientHeight;
}
divwidth = docwidth / 100 * 90 - 20;
divheight = docheight / 100 * 90 - 20;
width = nav[imgnr][1];
height = nav[imgnr][2];
newwidth = (divwidth < width) ? divwidth - 50 : width
height = height / width * newwidth;
if(divheight < height) {
newheight = divheight - 50;
newwidth = newwidth / height * newheight;
} else {
newheight = height;
}
document.getElementById('lay_img').style.width = divwidth + 20;
document.getElementById('imgolay').src = '<?php echo $this->httppath."/_preloadimg.gif"; ?>';
document.getElementById('imgolay').src = '<?php echo $this->httppath.$this->sF; ?>'+ nav[imgnr][0];
document.getElementById('lay_img').style.display = 'block';
document.getElementById('imgolay').width = newwidth;
document.getElementById('imgolay').height = newheight;
}
function hidediv4img() {
document.onkeydown = "";
document.getElementById('lay_img').style.display = 'none';
document.getElementById('imgolay').src = '<?php echo $this->httppath."/_preloadimg.gif"; ?>';
}
</script>
<style type="text/css">
<!--
#lay_img {
position:fixed;
left:5%;
top:5%;
width:90%;
height:90%;
z-index:1;
display:none;
background:#F5F5F5;
border:#000000 1px solid;
padding:5px;
/* für IE */
position: expression("absolute");
top: expression(document.body.scrollTop - this.offsetHeight + this.offsetHeight + 10);
}
-->
</style>
<div id="lay_img">
<script>
var imgnr;
var nav = new Array();
<?php for($js=0; $js<count($this->imgs); $js++) { ?>
nav[<?php echo $js; ?>] = new Array();
nav[<?php echo $js; ?>][0] = '<?php echo $this->imgs[$js][0]; ?>';
nav[<?php echo $js; ?>][1] = '<?php echo $this->imgs[$js][1]; ?>';
nav[<?php echo $js; ?>][2] = '<?php echo $this->imgs[$js][2]; ?>';
<?php } ?>
//Script um Tastatureingaben abzufangen (left - rigth - space)
function showDown(evt) {
evt = (evt) ? evt : ((event) ? event : null);
switch(evt.keyCode) {
case 37:
imgnr=imgnr-1;
showdiv4img();
break;
case 39:
imgnr=imgnr+1;
showdiv4img();
break;
case 32:
hidediv4img();
break;
} }
</script>
<?php if(!is_file($this->droot.$this->httppath."/_preloadimg.gif")) {
$im = imagecreate(5, 5);
$col = imagecolorallocate($im, 245, 245 , 245);
imagefill($im, 0, 0, $col);
imagegif($im, $this->droot.$this->httppath."/_preloadimg.gif");
} ?>
<table width="100%" height="100%">
<tr>
<td>
<a href="#f" onclick="javascript:imgnr=imgnr-1; showdiv4img();"><</a>
<a href="#f" onclick="javascript:imgnr=0; showdiv4img();"><<</a>
</td>
<td align="center"><a href="#f" onclick="javascript:hidediv4img();">close</a></td>
<td align="right">
<a href="#f" onclick="javascript:imgnr=nav.length-1;showdiv4img();">>></a>
<a href="#f" onclick="javascript:imgnr=imgnr+1; showdiv4img();">></a>
</td>
</tr>
<tr><td colspan="3" align="center" valign="middle">
<img id="imgolay" src="<?php echo $this->httppath."/_preloadimg.gif"; ?>" alt="" border="0" />
</td></tr></table>
</div>
<?php
if(!is_dir($this->droot.$this->httppath.$this->sF.$this->tfn)) {
mkdir($this->droot.$this->httppath.$this->sF.$this->tfn, 777);
}
echo '<table width="'. $this->fullwidth .'" cellpadding=10 cellspacing=0 border=0>';
for($i=0; $i<$this->anzRows; $i++) {
echo '<tr>';
for($j; $j<$tmp; $j++) {
echo '<td width="'. floor(100/$this->anzCols) .'%" valign="bottom" align="center">';
if(isset($this->imgs[$j][0])) {
//Img verkleiner und im thumbs-Ordner speichern START
$bimg = $this->droot.$this->httppath.$this->sF.$this->imgs[$j][0]; //big image
$simg = $this->droot.$this->httppath.$this->sF.$this->tfn."/".$this->imgs[$j][0]; //small image
$org_width = $this->imgs[$j][1];
$org_height = $this->imgs[$j][2];
if(!is_file($simg)) {
//Maxwidth/height berechnen
$width=round($this->maxheight / $org_height * $org_width);
$height=$this->maxheight;
if($width > $this->maxwidth) {
$width=$this->maxwidth;
$height=round($this->maxwidth / $org_width * $org_height);
}
$ih=imagecreatetruecolor($width, $height); //image handler
$img = call_user_func("imagecreatefrom".$this->types[$this->imgs[$j][3]], $bimg);
imagecopyresampled($ih,$img,0,0,0,0,$width,$height,$org_width,$org_height);
call_user_func("image".$this->types[$this->imgs[$j][3]], $ih, $simg);
imagedestroy($ih);
}
//Img verkleiner und im thumbs-Ordner speichern END
echo '<a href="#f" onClick="javascript:imgnr= '. $j .'; showdiv4img();"><img src="'. $this->httppath.$this->sF.$this->tfn."/".$this->imgs[$j][0] .'" alt="" border=0 /></a>';
} else {
echo ' '; $i=$this->anzRows;
}
echo '</td>';
}
$tmp = $tmp + $this->anzCols;
echo '</tr>';
}
echo '</table>';
//Navigation vor/zurück
$alli = count($this->imgs); //all images
$allp = ceil($alli/$imgsos); //all pages
$curp = $fios/$imgsos; //current page
$next = $this->changeURL(array("curi" => $j));
$previous = $this->changeURL(array("curi" => $fios - $imgsos));
$last = $this->changeURL(array("curi" => ($allp-1) * $imgsos));
$first = $this->changeURL(array("curi" => ""));
?>
<br />
<table width="100%"><tr>
<td width="33%">
<?php if($fios > 0) { ?>
<a href="?<?php echo $previous; ?>"><</a>
<a href="?<?php echo $first; ?>"><<</a>
<?php } ?>
</td>
<td width="33%" align="middle">Page <?php echo ($curp+1) ." / ". $allp; ?></td>
<td width="33%" align="right">
<?php if($alli > $imgsos && $fios + $imgsos < $alli) { ?>
<a href="?<?php echo $last; ?>">>></a>
<a href="?<?php echo $next; ?>">></a>
<?php } ?>
</td>
</tr></table>
<?php
}
}
}
?>
Und Hier der Link zu der Test-Homepage:
http://www.onlineforum.square7.ch/di...t/gallerie.php
Made by Cl0wn_
|
|
|
24.05.2010, 20:07
|
#2 (permalink)
|
technischer Admin + DevTeam Leiter
Registriert seit: 19.12.2007
Beiträge: 7.260
|
AW: Brauche Hilfe Bei PHP
witzbold, der Ordner aus dem du lesen willst existiert nicht.. 
|
|
|
25.05.2010, 09:06
|
#3 (permalink)
|
PS-Evolution Aushilfskraft
Registriert seit: 13.11.2009
Alter: 16
Beiträge: 878
|
AW: Brauche Hilfe Bei PHP
Jetzt echt nit?
Cool,
Also die Bilder Die Angezeigt werden sollen sind in root/disconnect/images/gallery
und wo muss ich den Ordner Dan eintragen oder erstellen ?
PHP-Code:
<?php
class dyngall {
//Public Variablen welche bei Klassenaufruf mitgegeben werden können
public $droot = "/www/onlineforum"; //document root - rootpfad der website ohne / am schluss
public $httppath = "/gallery/images/"; //httppath - muss mit / beginnen
muss das so?
PHP-Code:
<?php
class dyngall {
//Public Variablen welche bei Klassenaufruf mitgegeben werden können
public $droot = "/www/onlineforum"; //document root - rootpfad der website ohne / am schluss
public $httppath = "/images/gallery/"; //httppath - muss mit / beginnen
da kommt aber der Fehler  (Behoben) "Der Fehler war in der galerie.php
PHP-Code:
$gall->httppath = "/images/gallery"; //(hier war der Fehler mit / am Ende) //httppath zum Bilder Ordner in welchem die Bilder gespeichert sind
Jetzt Kommt Dieser Fehler  Behoben
PHP-Code:
Warning: imagejpeg() [function.imagejpeg]: Unable to open '/users/onlineforum/www/disconnect/images/gallery/thumbs/simpletext.jpg' for writing: Permission denied in /users/onlineforum/www/disconnect/dyngall.class.php on line 288
Der Code von zeile 288 behoben
PHP-Code:
Zeile 288: call_user_func("image".$this->types[$this->imgs[$j][3]], $ih, $simg);
Made by Cl0wn_
Geändert von Evolutio (25.05.2010 um 11:08 Uhr).
|
|
|
25.05.2010, 09:57
|
#4 (permalink)
|
PS-Evolution Aushilfskraft
Registriert seit: 13.11.2009
Alter: 16
Beiträge: 878
|
AW: Brauche Hilfe Bei PHP
Okay,
Alle Fehler Behoben,
nu jetzt der Nächste, die Bilder werden nicht angezeigt ; (
Disconnect
Muss da In Die Kalmmern AUch was Rein?
Bei den showDirs und showimgs
Code:
$gall->showDirs(); //Verzeichnise ausgeben
$gall->showImgs(); //Bilder ausgeben
http://tools.nexsystems.ch/?s=gallery/aleitung (Anleitung)
galerie.php
PHP-Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Disconnect</title>
<link type="text/css" href="style.css" rel="stylesheet" />
</head>
<body>
<style>
<!--A{text-decoration:none}-->
</style>
<div id="header">
<h1></h1>
</div>
<div id="navigation">
</div>
<div style="position: absolute; filter: alpha(opacity:60); BACKGROUND-COLOR: #FFFFFF; width: 1024px; height: 768px; left: 64px; top: 48px; khtmlopacity: 0.75; mozopacity: 0.75; opacity: 0.75;"/>
<a href="index.php"><img src="images/header.jpg" width="1024" height="60"></a>
<a href="index.php"><img src="images/startseite.jpg" width="120" height="30"></a>
<a href="members.php"><img src="images/mitglieder.jpg" width="120" height="30"></a>
<a href="galerie.php"><img src="images/gallerie.jpg" width="120" height="30"></a>
<a href="teamspeak.php"><img src="images/teamspeak.jpg" width="120" height="30"></a>
<a href="aboutus.php"><img src="images/ueberuns.jpg" width="120" height="30"></a>
<?php
include("dyngall.class.php"); //Datei includieren
$gall = new dyngall;
$gall->droot = "/users/onlineforum/www/disconnect"; //document root ohne / am schluss
$gall->httppath = "/images/gallery"; //httppath zum Bilder Ordner in welchem die Bilder gespeichert sind
//muss mit / beginnen
//Wichtig: Man benötigt Schreibrechte in diesem Ordner
$gall->anzRows = 4; //Anzahl Reihen pro Seite
$gall->anzCols = 4; //Anzahl Bilder pro Reihe
$gall->maxheight = 250; //Maximale Höhe des Vorschau Bildes
$gall->maxwidth = 200; //Maximale Breite des Vorschau Bildes
$gall->sortby = "name"; //lastmod | create | name
$gall->sortorder = "asc"; //asc | desc
$gall->fullwidth = "100%"; //Die Breite der Gallery
$gall->direxclusions = array(".", ".."); //Ordner welche nicht angezeigt werden sollen
$gall->tfn = "thumbs"; //Name des thumbs Ordners
$gall->showDirs(); //Verzeichnise ausgeben
$gall->showImgs(); //Bilder ausgeben
?>
</div>
</body>
</html>
Und noch die dyngal.class.php
PHP-Code:
<?php
class dyngall {
//Public Variablen welche bei Klassenaufruf mitgegeben werden können
public $droot = "/users/onlineforum/www/disconnect"; //document root - rootpfad der website ohne / am schluss
public $httppath = "/images/gallery"; //httppath - muss mit / beginnen
public $anzRows = 4;
public $anzCols = 4;
public $maxheight = 160;
public $maxwidth = 120;
public $sortby = "name"; //lastmod | create | name
public $sortorder = "asc"; //asc | desc
public $fullwidth = "100%";
public $direxclusions = array(".", "..");
public $tfn = "thumbs"; //thumbs folder name
//Private Variablen
//Erlaubte Grafikformate (NICHT ÄNDERN)
private $types = array("jpg", "gif", "jpeg", "png");
private $dirs = array();
private $imgs = array();
private $sF = "";
function __construct() {
$this->sF = (isset($_GET['sF']) && strpos(' '.$_GET['sF'], "..") == false) ? "/".$_GET['sF']."/" : "/";
}
//Endung (Zeichen nach Punkt) auslesen
function getFileExt($file) {
$len_end = strlen(strrchr($file, "."));
$len = strlen($file)-$len_end+1;
return substr(strtolower($file), $len);
}
//URL Parameters ändern
function changeURL($params) {
$urlstring = "";
$url_param = $_GET;
foreach($params as $param => $value) {
if(isset($url_param[$param])) { $url_param[$param] = $value; }
else {$url_param[$param] = $value;}
}
foreach($url_param as $urlparam => $urlvalue) {
if($urlvalue != '') { $urlstring .= $urlparam."=".$urlvalue."&"; }
}
return substr($urlstring,0,strlen($urlstring)-1);
}
//Alle Elemente (Ordner & Dateien auslesen und in einem Array speichern)
function getElements($handler) {
$fh = opendir($this->droot.$this->httppath.$this->sF);
$count = 0;
while($curelement = readdir($fh)) {
if(!strpos($curelement, '\'')) {
if($handler == 'dir') {
if(is_dir($this->droot.$this->httppath.$this->sF.$curelement) && !in_array($curelement, $this->direxclusions) && $curelement <> $this->tfn) {
$this->dirs[] = $curelement;
}
} else if($handler == 'img') {
if(is_file($this->droot.$this->httppath.$this->sF.$curelement) && $curelement <> "_preloadimg.gif") {
$extension = $this->getFileExt($curelement);
if(in_array($extension, $this->types)) {
$this->imgs[$count][0] = $curelement; //[x][0] - Name
//Original Grösse auslesen
$sizeoimg = getimagesize($this->droot.$this->httppath.$this->sF.$curelement); //size of image
$this->imgs[$count][1] = $sizeoimg[0]; //[x][1] - Width
$this->imgs[$count][2] = $sizeoimg[1]; //[x][2] - Height
$this->imgs[$count][3] = $sizeoimg[2]; //[x][3] - Grafiktyp 1-4(gif, jpg, png, swf)
//Bearbeitungsdatum auslesen
$this->imgs[$count][4] = filemtime($this->droot.$this->httppath.$this->sF.$curelement);
$this->imgs[$count++][5] = filectime($this->droot.$this->httppath.$this->sF.$curelement);
} } } } } }
//Ausgabe aller Ordner welche im angegebenen Pfad sind
function showDirs() {
$tmp = "";
$bcrumbs = "";
$subpath = explode("/", $this->sF);
foreach($subpath as $curpath) {
if(!empty($curpath)) {
$tmp .= '/'.$curpath;
$bcrumbs .= '<a href="?'. $this->changeURL(array("sF" => substr($tmp, 1), "curi" => "")) .'">'. $curpath .'</a> /';
}
}
echo '<p><a href="?'. $this->changeURL(array("sF" => "")) .'">Home</a> /'. $bcrumbs .'</p>';
$this->getElements('dir');
if(!empty($this->dirs)) {
for($i=0; $i<count($this->dirs); $i++) {
echo '<a href="?'. $this->changeURL(array("sF" => substr($this->sF,1).$this->dirs[$i], "curi" => "")) .'">-> '.$this->dirs[$i].'</a><br />';
} } }
//Ausgabe aller Images welche im angegebenen Pfad sind
function sortArr($a, $b) { //Sortierfunktion (usort) für das Image-Array
switch($this->sortby) {
case "lastmod":
$sorti = 5;
break;
case "create":
$sorti = 4;
break;
case "name":
$sorti = 0;
break;
default:
$sorti = 0;
break;
}
return ($this->sortorder == "desc") ? strcmp($a[$sorti], $b[$sorti]) * -1 : strcmp($a[$sorti], $b[$sorti]);
}
function showImgs() {
ini_set("memory_limit", "32M");
$imgsos = $this->anzRows * $this->anzCols; //images on site
$fios = isset($_GET['curi']) ? floor($_GET['curi']/$imgsos)*$imgsos : 0; //first image on site
$j=$fios;
$tmp = $j+$this->anzCols;
$this->getElements('img');
//Sortieren nach Name OR Lastmod
usort($this->imgs, array("dyngall", "sortArr"));
if(!empty($this->imgs)) {
//Div Element welches das Bild anzeigt src wird bei onclick übergeben ?>
<script>
function showdiv4img() {
document.onkeydown = showDown;
imgnr = (imgnr < 0) ? 0 : imgnr;
imgnr = (imgnr > nav.length-1) ? nav.length-1 : imgnr;
var docwidth,docheight;
if (self.innerHeight) { // all except Explorer
docwidth = self.innerWidth;
docheight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
docwidth = document.documentElement.clientWidth;
docheight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
docwidth = document.body.clientWidth;
docheight = document.body.clientHeight;
}
divwidth = docwidth / 100 * 90 - 20;
divheight = docheight / 100 * 90 - 20;
width = nav[imgnr][1];
height = nav[imgnr][2];
newwidth = (divwidth < width) ? divwidth - 50 : width
height = height / width * newwidth;
if(divheight < height) {
newheight = divheight - 50;
newwidth = newwidth / height * newheight;
} else {
newheight = height;
}
document.getElementById('lay_img').style.width = divwidth + 20;
document.getElementById('imgolay').src = '<?php echo $this->httppath."/_preloadimg.gif"; ?>';
document.getElementById('imgolay').src = '<?php echo $this->httppath.$this->sF; ?>'+ nav[imgnr][0];
document.getElementById('lay_img').style.display = 'block';
document.getElementById('imgolay').width = newwidth;
document.getElementById('imgolay').height = newheight;
}
function hidediv4img() {
document.onkeydown = "";
document.getElementById('lay_img').style.display = 'none';
document.getElementById('imgolay').src = '<?php echo $this->httppath."/_preloadimg.gif"; ?>';
}
</script>
<style type="text/css">
<!--
#lay_img {
position:fixed;
left:5%;
top:5%;
width:90%;
height:90%;
z-index:1;
display:none;
background:#F5F5F5;
border:#000000 1px solid;
padding:5px;
/* für IE */
position: expression("absolute");
top: expression(document.body.scrollTop - this.offsetHeight + this.offsetHeight + 10);
}
-->
</style>
<div id="lay_img">
<script>
var imgnr;
var nav = new Array();
<?php for($js=0; $js<count($this->imgs); $js++) { ?>
nav[<?php echo $js; ?>] = new Array();
nav[<?php echo $js; ?>][0] = '<?php echo $this->imgs[$js][0]; ?>';
nav[<?php echo $js; ?>][1] = '<?php echo $this->imgs[$js][1]; ?>';
nav[<?php echo $js; ?>][2] = '<?php echo $this->imgs[$js][2]; ?>';
<?php } ?>
//Script um Tastatureingaben abzufangen (left - rigth - space)
function showDown(evt) {
evt = (evt) ? evt : ((event) ? event : null);
switch(evt.keyCode) {
case 37:
imgnr=imgnr-1;
showdiv4img();
break;
case 39:
imgnr=imgnr+1;
showdiv4img();
break;
case 32:
hidediv4img();
break;
} }
</script>
<?php if(!is_file($this->droot.$this->httppath."/_preloadimg.gif")) {
$im = imagecreate(5, 5);
$col = imagecolorallocate($im, 245, 245 , 245);
imagefill($im, 0, 0, $col);
imagegif($im, $this->droot.$this->httppath."/_preloadimg.gif");
} ?>
<table width="100%" height="100%">
<tr>
<td>
<a href="#f" onclick="javascript:imgnr=imgnr-1; showdiv4img();"><</a>
<a href="#f" onclick="javascript:imgnr=0; showdiv4img();"><<</a>
</td>
<td align="center"><a href="#f" onclick="javascript:hidediv4img();">close</a></td>
<td align="right">
<a href="#f" onclick="javascript:imgnr=nav.length-1;showdiv4img();">>></a>
<a href="#f" onclick="javascript:imgnr=imgnr+1; showdiv4img();">></a>
</td>
</tr>
<tr><td colspan="3" align="center" valign="middle">
<img id="imgolay" src="<?php echo $this->httppath."/_preloadimg.gif"; ?>" alt="" border="0" />
</td></tr></table>
</div>
<?php
if(!is_dir($this->droot.$this->httppath.$this->sF.$this->tfn)) {
mkdir($this->droot.$this->httppath.$this->sF.$this->tfn, 777);
}
echo '<table width="'. $this->fullwidth .'" cellpadding=10 cellspacing=0 border=0>';
for($i=0; $i<$this->anzRows; $i++) {
echo '<tr>';
for($j; $j<$tmp; $j++) {
echo '<td width="'. floor(100/$this->anzCols) .'%" valign="bottom" align="center">';
if(isset($this->imgs[$j][0])) {
//Img verkleiner und im thumbs-Ordner speichern START
$bimg = $this->droot.$this->httppath.$this->sF.$this->imgs[$j][0]; //big image
$simg = $this->droot.$this->httppath.$this->sF.$this->tfn."/".$this->imgs[$j][0]; //small image
$org_width = $this->imgs[$j][1];
$org_height = $this->imgs[$j][2];
if(!is_file($simg)) {
//Maxwidth/height berechnen
$width=round($this->maxheight / $org_height * $org_width);
$height=$this->maxheight;
if($width > $this->maxwidth) {
$width=$this->maxwidth;
$height=round($this->maxwidth / $org_width * $org_height);
}
$ih=imagecreatetruecolor($width, $height); //image handler
$img = call_user_func("imagecreatefrom".$this->types[$this->imgs[$j][3]], $bimg);
imagecopyresampled($ih,$img,0,0,0,0,$width,$height,$org_width,$org_height);
call_user_func("image".$this->types[$this->imgs[$j][3]], $ih, $simg);
imagedestroy($ih);
}
//Img verkleiner und im thumbs-Ordner speichern END
echo '<a href="#f" onClick="javascript:imgnr= '. $j .'; showdiv4img();"><img src="'. $this->httppath.$this->sF.$this->tfn."/".$this->imgs[$j][0] .'" alt="" border=0 /></a>';
} else {
echo ' '; $i=$this->anzRows;
}
echo '</td>';
}
$tmp = $tmp + $this->anzCols;
echo '</tr>';
}
echo '</table>';
//Navigation vor/zurück
$alli = count($this->imgs); //all images
$allp = ceil($alli/$imgsos); //all pages
$curp = $fios/$imgsos; //current page
$next = $this->changeURL(array("curi" => $j));
$previous = $this->changeURL(array("curi" => $fios - $imgsos));
$last = $this->changeURL(array("curi" => ($allp-1) * $imgsos));
$first = $this->changeURL(array("curi" => ""));
?>
<br />
<table width="100%"><tr>
<td width="33%">
<?php if($fios > 0) { ?>
<a href="?<?php echo $previous; ?>"><</a>
<a href="?<?php echo $first; ?>"><<</a>
<?php } ?>
</td>
<td width="33%" align="middle">Page <?php echo ($curp+1) ." / ". $allp; ?></td>
<td width="33%" align="right">
<?php if($alli > $imgsos && $fios + $imgsos < $alli) { ?>
<a href="?<?php echo $last; ?>">>></a>
<a href="?<?php echo $next; ?>">></a>
<?php } ?>
</td>
</tr></table>
<?php
}
}
}
?>
Naja Ich glaube der Fehler liegt in der gallerie.php
Und Die Bilder liegen in root/disconnect/images/gallery
Naja Ich Wünsche euch Noch Einen Schönen Abend Mit freundlichen grüßen Evo
Made by Cl0wn_
Geändert von Evolutio (25.05.2010 um 19:36 Uhr).
|
|
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:49 Uhr.
|