phpbar.de logo

Mailinglisten-Archive

[php] =?iso-8859-1?Q?R:_=5Bphp=5D_Bild_soll_in_extra_Browser-Fenster_ge=F6ffnet?= =?iso-8859-1?Q?_werden_-Fenstergr=F6=DFe_=3D_Bildgr=F6=DFeFenstergr?= =?iso-8859-1?Q?=F6=DFe_=3D_Bildgr=F6=DFe?= =?iso-8859-1?Q?_werden_-Fenstergr=F6=DFe_=3D_Bildgr=F6=DFeFenstergr?= =?iso-8859-1?Q?=F6=DFe_=3D_Bildgr=F6=DFe?=

[php] =?iso-8859-1?Q?R:_=5Bphp=5D_Bild_soll_in_extra_Browser-Fenster_ge=F6ffnet?= =?iso-8859-1?Q?_werden_-Fenstergr=F6=DFe_=3D_Bildgr=F6=DFeFenstergr?= =?iso-8859-1?Q?=F6=DFe_=3D_Bildgr=F6=DFe?= =?iso-8859-1?Q?_werden_-Fenstergr=F6=DFe_=3D_Bildgr=F6=DFeFenstergr?= =?iso-8859-1?Q?=F6=DFe_=3D_Bildgr=F6=DFe?=

TICINONLINE info_(at)_ticinonline.to
Sat, 25 Mar 2000 09:42:07 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0000_01BF963E.62A3BD60
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit


die anlage studieren
SCNR


Gibt es eine Apache Mailingliste?


Wo? wie .De?

Ciao

Patrik





========================================
www.info-ticino.ch
info_(at)_ticinonline.to
PPK ScreenDesign Web-Programm
tel 091 753 20 66
java php3 html asp dhtml CGI Perl
Banche dati Mysql - Webserver Apache UNIX
========================================

-----Messaggio originale-----
Da: php-admin_(at)_infosoc.uni-koeln.de
[mailto:php-admin_(at)_infosoc.uni-koeln.de]Per conto di Ralf Semroch
Inviato: sabato 25 marzo 2000 0.14
A: PHP Mailingliste
Oggetto: [php] Bild soll in extra Browser-Fenster geöffnet werden
-Fenstergröße = BildgrößeFenstergröße = Bildgröße


Hallo Liste,

beim Anklicken eines Thumbnails soll das große Bild in einem neuen
Browserfenster geöffnet werden, wobei das Fenster nicht (wesentlich)
größer sein sollte, als das Bild...
Ich weiß, daß ich hier Javascript benutzen muß, jedoch sind alle meine
Versuche mit onClick usw. vom Parser verweigert worden...
Hier der Teil des Skripts, der zwar ein schon ein Fenster öffnet, aber
leider nur in Vollbild.

...
$size = GetImageSize($bildgross);
echo "<td class=\"n\" valign=\"top\"><a
href=showpicture.php3?gross=".$bildgross."&bg=".$bildback."
target=\"_blank\"><img src=".$bildklein." border=0 alt=\"\"></a></td>";


Kann mir bitte jemand von Euch auf die Sprünge helfen?

Vielen Dank,

Ralf

--
mit freundlichen gruessen

ralf semroch
semroch_(at)_designofsites.de

visit http://www.flash4-center.de




--
** Durchgehend geöffnet: http://www.php-center.de **
Die PHP-Liste: mailto:php_(at)_infosoc.uni-koeln.de
http://infosoc.uni-koeln.de/mailman/listinfo/php

------=_NextPart_000_0000_01BF963E.62A3BD60
Content-Type: application/octet-stream;
	name="index.php3"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="index.php3"

<?php=20

// THE PHP PHOTO GALLERY - DECEMBER 1999=20
// CODED BY=20
// ALEXANDRE MEYER LANA - JAU - BRASIL=20
// webmaster_(at)_lanavision.com or nagual_(at)_peyote.com=20

/* This is a script that list all image files on a given directory, and =
displays the thumbnails nicely formated within an HTML table. It also =
make use of JavScript to open pop up windows when the users want to see =
the full photo */=20

/* You can use one document per image subdirectory you want to display, =
or you may change the code and access the gallery.php3 using a FORM, =
where you can parse the $path variable or any other Anyway, it was a =
coffe break coding, I'll be glad to receive any improvements. */=20

/* I'll also be posting a CGI/PHP/mySQL eletronic postcard system pretty =
soon */=20

// Comments: webmaster_(at)_lanavision.com or nagual_(at)_peyote.com=20

// P.S.: Sorry for my english, it's not so good=20

//***********************************************************//=20
//******** STARTOF VARIABLES CONFIGURATION SECTION **********//=20
//***********************************************************//=20

// DON'T FORGET TO INCLUDE THE CLASS.FILE=20
// You can download it from:=20
// http://www.thewebmasters.net/php/File-1_0.tar.gz=20
include( "class.File.php3");=20

// RELATIVE PATH TO IMAGES DIRECTORY (Other than gallery.php3's)=20
$path =3D  ".";=20

// NUMBER OF COLUMNS TO BE DISPLAYED=20
$colunas =3D 6;=20

// THUMBNAIL WIDTH=20
$thumb_width =3D  "100";=20

// THUMBNAIL HEIGHT=20
$thumb_height =3D  "";=20

/* COORDINATES FOR THE FULL SIZE PHOTO POP-UP WINDOW =20
YOU CAN USE (MINUS) TO INVERT THE REFERENCES =20
(RIGHTMARGIN AND BOTTOMMARGIN). PREETY COOL, ISN'T IT? */=20

// LEFTMARGIN OFFSET (RIGTHMARGIN IF YOU USE NEGATIVE VALUES)=20
$pop_leftmargin =3D  "1";=20

// TOPMARGIN OFFSET (BOTTOMMARGIN IF YOU USE NEGATIVE VALUES)=20
$pop_topmargin =3D  "1";=20

//***********************************************************//=20
//******** ENDOF VARIABLES CONFIGURATION SECTION ************//=20
//***********************************************************//=20

$file =3D new File(); =20
$images =3D array();=20
$jpgs =3D $file->get_files( "$path", "jpg");=20
if( !empty($jpgs) ) {=20
    while ( list( $key, $filename ) =3D each( $jpgs ) ) {=20
    $images[] =3D $filename;=20
    }=20
}=20
$gifs =3D $file->get_files( "$path", "gif");=20
if( !empty($gifs) ) {=20
    while ( list( $key, $filename ) =3D each( $gifs ) ) {=20
    $images[] =3D $filename;=20
    }=20
}=20
$pngs =3D $file->get_files( "$path", "png");=20
if( !empty($pngs) ) {=20
    while ( list( $key, $filename ) =3D each( $pngs ) ) {=20
    $images[] =3D $filename;=20
    }=20
}=20
$bmps =3D $file->get_files( "$path", "bmp");=20
if( !empty($bmps) ) {=20
    while ( list( $key, $filename ) =3D each( $bmps ) ) {=20
    $images[] =3D $filename;=20
    }=20
}=20
$count =3D 1;=20
$break =3D $colunas;=20
?>=20
<!-- STARTOF HTML CODE - CUSTOMIZE AS YOU WISH -->=20
<!-- JUST DON'T TOUCH THE JAVA CODE -->=20
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">=20
<HTML>=20
<HEAD>=20
    <TITLE>The PHP Photo Gallery</TITLE>=20
<SCRIPT Language=3D"JavaScript"> =20
<!--  =20
var popWin =3D null   =20
var winCount =3D 0=20
var winName =3D "popWin"=20
function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, =
winTop){=20
  var d_winLeft =3D 20 =20
  var d_winTop =3D 20  =20
  winName =3D "popWin" + winCount++ =20
  closePopWin()          =20
  if (openPopWin.arguments.length >=3D 4)   =20
    winFeatures =3D "," + winFeatures=20
  else =20
    winFeatures =3D "" =20
  if (openPopWin.arguments.length =3D=3D 6)  =20
    winFeatures +=3D getLocation(winWidth, winHeight, winLeft, winTop)=20
  else=20
    winFeatures +=3D getLocation(winWidth, winHeight, d_winLeft, =
d_winTop)=20
  popWin =3D window.open(winURL, winName, "width=3D" + winWidth =20
           + ",height=3D" + winHeight + winFeatures)=20
  }=20
function closePopWin(){    =20
  if (navigator.appName !=3D "Microsoft Internet Explorer" =20
      || parseInt(navigator.appVersion) >=3D4) =20
    if(popWin !=3D null) if(!popWin.closed) popWin.close() =20
  }=20
function getLocation(winWidth, winHeight, winLeft, winTop){=20
  return ""=20
  }=20
//-->=20
</SCRIPT>=20
<SCRIPT Language=3D"JavaScript1.2">=20
<!--=20
function getLocation(winWidth, winHeight, winLeft, winTop){=20
  var winLocation =3D ""=20
  if (winLeft < 0)=20
    winLeft =3D screen.width - winWidth + winLeft=20
  if (winTop < 0)=20
    winTop =3D screen.height - winHeight + winTop=20
  if (winTop =3D=3D "cen")=20
    winTop =3D (screen.height - winHeight)/2 - 20=20
  if (winLeft =3D=3D "cen")=20
    winLeft =3D (screen.width - winWidth)/2=20
  if (winLeft>0 & winTop>0)=20
    winLocation =3D  ",screenX=3D" + winLeft + ",left=3D" + winLeft    =20
                + ",screenY=3D" + winTop + ",top=3D" + winTop=20
  else=20
    winLocation =3D ""=20
  return winLocation=20
  }=20
//-->=20
</SCRIPT>=20
<style>=20
<!--=20
BODY {=20
        font-family: Verdana,Arial;=20
        font-style: none;=20
        font-size: 16px;=20
}=20
BIG {=20
        font-size: 28px;=20
        font-weight: bold;=20
}=20
TABLE {=20
        font-size: 16px;=20
}=20
SMALL {=20
        font-size: 12px;=20
}=20

A:LINK {=20
        text-decoration: none;=20
        font-weight: bold;=20
}=20
-->=20
</style>    =20
</HEAD>=20
<BODY onUnload=3D"closePopWin()">=20

<div align=3D"CENTER">=20
<b>Foto Libri Armando Dad&ograve; Editore presenti 12.99</b><br>=20
<small>PPK ScrenDesign Gordevio</b> &reg; 1999<br>=20
<a href=3D"mailto:info_(at)_ticinonline.to">info_(at)_ticinonline.to</a></small>=20
</div>=20
<div align=3D"center"><b>(Click the thumbnails to enlarge &shy; Total in =
this page: =20
<?php echo count($images); ?> images)</b></small> </div>


<table border=3D"5" cellspacing=3D"0" cellpadding=3D"6">=20
<tr>=20
<!-- STARTOF TABLE CELL DISPLAY PHP CODE -->=20
<!-- DO NOT ALTER IT -->=20
<?php=20
while ( list( $key, $fileName ) =3D each( $images ) )=20
{ =20
    if( !empty($fileName) ) =20
    { =20
    $tamanho =3D GetImageSize( "$fileName");=20
    $largura =3D $tamanho[0] + 18;=20
    $altura =3D $tamanho[1] + 28;=20
    echo  "  <td align=3D\"CENTER\" valign=3D\"TOP\"><a =
href=3D'javascript:openPopWin(\"$fileName\", $largura, $altura, \"\", =
$pop_leftmargin, $pop_topmargin)'><IMG SRC=3D\"$fileName\" border=3D0 =
alt=3D\"$count\"";=20
    if (!empty($thumb_width)) {echo  " width=3D\"$thumb_width\"";}=20
    if (!empty($thumb_height)) {echo  " height=3D\"$thumb_height\"";}=20
    echo  "></a><br><small>$count</small>";=20

        if ($count =3D=3D $break) {  =20
            echo  "\n  </td>\n</tr>\n<tr>\n";=20
            $break =3D $count + $colunas; =20
            }=20
        else { echo  "</td>\n"; }=20
    }=20
    $count++;=20
} =20
?>=20
<!-- ENDOF TABLE CELL CODE PHP-->=20
</tr>=20
</table>=20
</div>=20
<hr>=20
<div align=3D"CENTER">=20
<b>Foto Libri Armando Dad&ograve; Editore presenti 12.99</b><br>=20
<small>PPK ScrenDesign Gordevio</b> &reg; 1999<br>=20
<a href=3D"mailto:info_(at)_ticinonline.to">info_(at)_ticinonline.to</a></small>=20
</div>=20
</BODY>=20
</HTML>=20

------=_NextPart_000_0000_01BF963E.62A3BD60
Content-Type: application/octet-stream;
	name="class.File.php3"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="class.File.php3"

<?
/*

	File 1.0 - A wrapper class to common PHP file operations
	Copyright (c) 1999 CDI, cdi_(at)_thewebmasters.net
	All Rights Reserved

*/

Class File
{
	var $ERROR =3D "";
	var $BUFFER =3D -1;
	var $STATCACHE =3D array();
	var $TEMPDIR =3D '/tmp';
	var $REALUID =3D -1;
	var $REALGID =3D -1;

	function File ()
	{
		global $php_errormsg;
		return;
	}

	function clear_cache()
	{
		unset($this->STATCACHE);
		$this->STATCACHE =3D array();
		return true;
	}

	function is_sane($fileName =3D "", $must_exist =3D 0, $noSymLinks =3D =
0, $noDirs =3D 0)
	{
		$exists =3D false;

		if(empty($fileName)) {	return false; }
		if($must_exist !=3D 0)
		{
			if(!file_exists($fileName))
			{
				$this->ERROR =3D "is_sane: [$fileName] does not exist";
				return false;
			}
			$exists =3D true;
		}
		if($exists)
		{
			if(!is_readable($fileName))
			{
				$this->ERROR =3D "is_sane: [$fileName] not readable";
				return false;
			}

			if($noDirs !=3D 0)
			{
				if(is_dir($fileName))
				{
					$this->ERROR =3D "is_sane: [$fileName] is a directory";
					return false;
				}
			}

			if($noSymLinks !=3D 0)
			{
				if(is_link($fileName))
				{
					$this->ERROR =3D "is_sane: [$fileName] is a symlink";
					return false;
				}
			}

		} // end if exists

		return true;	=09
	}


//	**************************************************************

	function read_file ($fileName =3D "" )
	{
		$contents =3D "";

		if(empty($fileName))
		{
			$this->ERROR =3D "read_file: No file specified";=20
			return false;
		}
		if(!$this->is_sane($fileName,1,0,1))
		{
			// Preserve the is_sane() error msg
			return false;
		}
		$fd =3D _(at)_fopen($fileName,"r");

		if( (!$fd) || (empty($fd)) )
		{
			$this->ERROR =3D "read_file: File error: [$php_errormsg]";
			return false;
		}

		$contents =3D fread($fd, filesize($fileName) );

		fclose($fd);

        return $contents;
	}

//	**************************************************************
//	Read a file via fgetss(), which strips all php/html
//	from the file.

	function strip_read ($fileName =3D "", $strip_cr =3D 0)
	{
		if(empty($fileName))
		{
			$this->ERROR =3D "strip_read: No file specified";=20
			return false;
		}
		if(!$this->is_sane($fileName,1,0,1))
		{
			// Preserve the error
			return false;
		}
		if($this->BUFFER > 0)
		{
			$buffer =3D $this->BUFFER;
		} else {
			$buffer =3D filesize($fileName);
		}

		$contents =3D "";

		$fd =3D _(at)_fopen($fileName,"r");

		if( (!$fd) || (empty($fd)) )
		{
			$this->ERROR =3D "strip_read: File error: [$php_errormsg]";
			return false;
		}
		while(!feof($fd))
		{
			$contents .=3D fgetss($fd,$buffer);
		}
		fclose($fd);
        return $contents;
	}

//	**************************************************************
	function write_file ($fileName,$Data)
	{
		$tempDir =3D $this->TEMPDIR;
		$tempfile   =3D tempnam( $tempDir, "cdi" );

		if(!$this->is_sane($fileName,0,1,1))
		{
			return false;
		}

		if (file_exists($fileName))
		{
			if (!copy($fileName, $tempfile))
			{
				$this->ERROR =3D "write_file: cannot create backup file [$tempfile] =
:  [$php_errormsg]";
				return false;
			}
		}

		$fd =3D _(at)_fopen( $tempfile, "a" );

		if( (!$fd) or (empty($fd)) )
		{
			$myerror =3D $php_errormsg;
			unlink($tempfile);
			$this->ERROR =3D "write_file: [$tempfile] access error [$myerror]";
			return false;
		}

		fwrite($fd, $Data);

		fclose($fd);

		if (!copy($tempfile, $fileName))
		{
			$myerror =3D $php_errormsg;   // Stash the error, see above
			unlink($tempfile);
			$this->ERROR =3D "write_file: Cannot copy file [$fileName] =
[$myerror]";
			return false;
		}

		unlink($tempfile);

		if(file_exists($tempfile))
		{
			// Not fatal but it should be noted
			$this->ERROR =3D "write_file: Could not unlink [$tempfile] : =
[$php_errormsg]";
		}
		return true;
	}

//	**************************************************************
	function copy_file ($oldFile =3D "", $newFile =3D "")
	{
		if(empty($oldFile))
		{
			$this->ERROR =3D "copy_file: oldFile not specified";
			return false;
		}
		if(empty($newFile))
		{
			$this->ERROR =3D "copy_file: newFile not specified";
			return false;
		}
		if(!$this->is_sane($oldFile,1,0,1))
		{
			// preserve the error
			return false;
		}
		if(!$this->is_sane($newFile,0,1,1))
		{
			// preserve it
			return false;
		}

		if (! (_(at)_copy($oldFile, $newFile)))
		{
			$this->ERROR =3D "copy_file: cannot copy file [$oldFile] =
[$php_errormsg]";
			return false;
		}

		return true;
	}

//	**********************************************

	function get_files ($root_dir, $fileExt =3D 'ALL_FILES')
	{
		$fileList =3D array();

		if(!is_dir($root_dir))
		{
			$this->ERROR =3D "get_files: Sorry, [$root_dir] is not a directory";
			return false;
		}

		if(empty($fileExt))
		{
			$this->ERROR =3D "get_files: No file extensions specified";
			return false;
		}

		$open_dir =3D _(at)_opendir($root_dir);

		if( (!$open_dir) or (empty($open_dir)) )
		{
			$this->ERROR =3D "get_files: Failed to open dir [$root_dir] : =
$php_errormsg";
			return false;
		}

		$fileCount =3D 0;

		while ( $file =3D readdir($open_dir))
		{
			if( (!is_dir($file)) and (!empty($file)) )
			{
				if($fileExt =3D=3D 'ALL_FILES')
				{
					$fileList[$fileCount] =3D $file;
					$fileCount++;
				}
				else
				{
					if(eregi(".\.($fileExt)$",$file))
					{
						$fileList[$fileCount] =3D $file;
						$fileCount++;
					}
				}
			}
		}

		closedir($open_dir);
		return $fileList;

	}	// end get_files

	function is_owner($fileName, $uid =3D "")
	{
		if(empty($uid))
		{
			if($this->REALUID < 0)
			{
				$tempDir =3D $this->TEMPDIR;
				$tempFile =3D tempnam($tempDir,"cdi");
				if(!touch($tempFile))
				{
					$this->ERROR =3D "is_owner: Unable to create [$tempFile]";
					return false;
				}
				$stats =3D stat($tempFile);
				unlink($tempFile);
				$uid =3D $stats[4];
			}
			else
			{
				$uid =3D $this->REALUID;
			}
		}
		$fileStats =3D stat($fileName);
		if( (empty($fileStats)) or (!$fileStats) )
		{
			$this->ERROR =3D "is_owner: Unable to stat [$fileName]";
			return false;
		}

		$this->STATCACHE =3D $fileStats;

		$owner =3D $fileStats[4];
		if($owner =3D=3D $uid)
		{
			return true;
		}

		$this->ERROR =3D "is_owner: Owner [$owner] Uid [$uid] FAILED";
		return false;
	}

	function is_inGroup($fileName, $gid =3D "")
	{
		if(empty($gid))
		{
			if($this->REALGID < 0)
			{
				$tempDir =3D $this->TEMPDIR;
				$tempFile =3D tempnam($tempDir,"cdi");
				if(!touch($tempFile))
				{
					$this->ERROR =3D "is_inGroup: Unable to create [$tempFile]";
					return false;
				}
				$stats =3D stat($tempFile);
				unlink($tempFile);
				$gid =3D $stats[5];
			}
			else
			{
				$gid =3D $this->REALGID;
			}
		}
		$fileStats =3D stat($fileName);
		if( (empty($fileStats)) or (!$fileStats) )
		{
			$this->ERROR =3D "is_inGroup: Unable to stat [$fileName]";
			return false;
		}

		$this->STATCACHE =3D $fileStats;

		$group =3D $fileStats[5];
		if($group =3D=3D $gid)
		{
			return true;
		}

		$this->ERROR =3D "is_inGroup: Group [$group] Gid [$gid] FAILED";
		return false;
	}

	function get_real_uid()
	{
		$tempDir =3D $this->TEMPDIR;
		$tempFile =3D tempnam($tempDir,"cdi");
		if(!touch($tempFile))
		{
			$this->ERROR =3D "is_owner: Unable to create [$tempFile]";
			return false;
		}
		$stats =3D stat($tempFile);
		unlink($tempFile);
		$uid =3D $stats[4];
		$gid =3D $stats[5];
		$this->REALUID =3D $uid;
		$this->REALGID =3D $gid;
		return $uid;
	}

	function get_real_gid()
	{
		$uid =3D $this->get_real_uid();
		if( (!$uid) or (empty($uid)) )
		{
			return false;
		}
		return $this->REALGID;
	}

}	// end class File

?>
------=_NextPart_000_0000_01BF963E.62A3BD60--



php::bar PHP Wiki   -   Listenarchive