hey, ik heb een goed werkend fotosysteem van de 'echte' server afgehaald en wil deze lokaal draaien.. met phptriad ofzo..
maar nu doet hij het niet ! iig het uploaden werkt niet..
ik dacht eerst dat het de GD library kon zijn.. en die stond natuurlijk weer uit.. dus die is nu aan, maar het werkt nog steeds niet..
dit is de foutmelding:
.height: 0px; width: 0px} C:\WINDOWS\php5.tmp is upgeload
Screenshot is een onbekend formaat
en dat onbekendee formaat heeft volgens mij te maken met die (gd functie) imagecreatefromjpeg.. maar ik ben een te grote newbie om dat zeker te weten
is er iemand die ziet wat er fout is??
el scriptje:
<META http-equiv="refresh" content="0; url=/nieuw/fotobase/">
<html>
<body text="#133B61" link="#133B61" vlink="#133B61" alink="#133B61" bgproperties="fixed" background="/dennenbosch/images/bg_moon_blue.gif" leftmargin="5" topmargin="5">
; height: 0px; width: 0px}
</style>
<link rel="stylesheet" href="../css/orangelinks.css" type="text/css">
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
var win=null;
function NeweventaddWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
</body>
</html>
<?
include('C:/userinfo.php');
?>
<?
$path1 = dirname($PATH_TRANSLATED)."/";
$source = $file1;
$source_name = $file1_name;
if(($source <> "none")&&($source <> "")){
if($error1 <> 1){
$dest = $path1.$source_name;
if(copy($source,$dest)){
echo "$source is upgeload<br>\n";
$imagesize = getimagesize($dest);
switch($imagesize[2]) {
case 0:
echo "<br> Screenshot is een onbekend formaat <br>";
unlink($dest);
exit;
case 1:
echo "<br> Screenshot is in GIF formaat <br>";
echo "$dest is $imagesize[0] pixels breed<br>";
echo "en $dest is $imagesize[1] pixels hoog<br>";
$newname = $path1;
$newname .=time() . ".gif";
if(copy($dest,$newname)) {
echo "<br> GIF naam is succesvol veranderd van <br> $dest naar $newname";
}
else {
echo "<br> GIF naam succesvol veranderd ";
}
unlink ($dest);
break;
case 2:
//echo "<br> Screenshot is in JPG formaat <br>";
//echo "$dest is $imagesize[0] pixels breed<br>";
//echo "en $dest is $imagesize[1] pixels hoog<br>";
$basname .=time() . ".jpg";
$newname = $path1;
$newname .=time() . ".jpg";
if(copy($dest,$newname)) {
//echo "<br> JPG naam is succesvol veranderd van <br> $dest naar $newname";
}
else {
//echo "<br> JPG naam succesvol veranderd ";
}
unlink ($dest);
break;
case 3:
echo "<br> Screenshot is in PNG formaat <br>";
echo "$dest is $imagesize[0] pixels breed<br>";
echo "en $dest is $imagesize[1] pixels hoog<br>";
$newname = $path1;
$newname .=time() . ".png";
if(copy($dest,$newname)) {
echo "<br> PNG naam is succesvol veranderd van <br> $dest naar $newname";
}
else {
echo "<br> PNG naam is succesvol veranderd ";
}
unlink ($dest);
break;
}
}
else {
echo "Screenshot directory is niet gechmod naar 777 !<br>\n";
echo "Het uploaden kan niet door gaan !<br>\n";
$error1 = 1;
}
}
unlink($source);
}
?>
<?
mysql_connect("$host", "$user", "$pass");
@mysql_select_db($db) or die( "");
$zeitblock = getdate();
$zeitformat = $zeitblock[year] . "-" . $zeitblock[mon] . "-" . $zeitblock[mday] . " " . $zeitblock[hours] . ":" . $zeitblock[minutes] . ":" . $zeitblock[seconds];
if ($nicknamefield = ''){
mysql_close();}
else {
$comment = ereg_replace("'","''",$comment);
$comment = ereg_replace("\[img]", "<img src=\"", $comment); $comment = ereg_replace("\[/img]", "\">", $comment);
$comment = eregi_replace("(^|[ \n\r\t])((http(s?)://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace("(^|[ \n\r\t])((ftp://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace("([a-z_-][a-z0-9\._-]*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)","<a href=mailto:\\1>\\1</a>",$comment);
$comment = eregi_replace("(^|[ \n\r\t])(www\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace("(^|[ \n\r\t])(ftp\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"ftp://\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace(":\)","[img]\"../images/smiles/smilet.gif\">",$comment); $comment[/img]",$comment);
$comment = eregi_replace(":\(","[img]\"../images/smiles/frown.gif\">",$comment); $comment[/img]",$comment);
$comment = eregi_replace(":\D","[img]\"../images/smiles/shiny.gif\">",$comment); $comment[/img]",$comment);
$comment = nl2br($comment);
$insert="insert into dbfotobase values('','$basname','$basname','$zeitformat', '$imagesize[0]', '$imagesize[1]','$comment','$event')";
mysql_query($insert);
mysql_close();}
?>
<?
$thumb = "./thumbnails";
$sortfile = "sortfile";
function RemoveNewLines (&$item, $key) {
$item = chop($item);
}
function GetFileList( $dirname="." ) { // Finds all the JPEGs in a directory
// First check to see if there's a file called $sortfile
// that contains a sorted list of filenames, one per line
// otherwise, will default to all files in alphabetical order
global $sortfile;
$files = array();
if (file_exists($sortfile)) {
$files = file($sortfile);
array_walk($files, 'RemoveNewLines');
} else {
$dir = opendir( $dirname );
while( $file = readdir( $dir ) ) {
if (ereg("jpg$",$file) || ereg("JPG$",$file) ||
ereg("jpeg$",$file) || ereg("JPEG$",$file) ) {
$files[] = $file;
}
}
sort($files);
}
return $files;
}
$margin = '150';
if ($margin) { // Create a list of thumbnails
if (!file_exists($thumb)) {
if ( ! mkdir($thumb, 0755)) {
echo "Error: could not create thumb dir - check write permissions";
die;
}
}
$imagelist = GetFileList();
while ( list($i,$image) = each ($imagelist) ) {
// Check the thumb exists
if (!file_exists($thumb."/".$image) ) {
$im = ImageCreateFromJPEG($image);
$width = ImageSX($im);
$height = ImageSY($im);
$twidth = $margin - 20;
$theight = ($twidth / $width) * $height;
$im2 = ImageCreate($twidth,$theight);
ImageCopyResized($im2,$im,0,0,0,0,$twidth,$theight,$width,$height);
ImageJpeg($im2, $thumb."/".$image, 100);
}
}
die;
}
?>
maar nu doet hij het niet ! iig het uploaden werkt niet..
ik dacht eerst dat het de GD library kon zijn.. en die stond natuurlijk weer uit.. dus die is nu aan, maar het werkt nog steeds niet..
dit is de foutmelding:
.height: 0px; width: 0px} C:\WINDOWS\php5.tmp is upgeload
Screenshot is een onbekend formaat
en dat onbekendee formaat heeft volgens mij te maken met die (gd functie) imagecreatefromjpeg.. maar ik ben een te grote newbie om dat zeker te weten
is er iemand die ziet wat er fout is??
el scriptje:
<META http-equiv="refresh" content="0; url=/nieuw/fotobase/">
<html>
<body text="#133B61" link="#133B61" vlink="#133B61" alink="#133B61" bgproperties="fixed" background="/dennenbosch/images/bg_moon_blue.gif" leftmargin="5" topmargin="5">
; height: 0px; width: 0px}
</style>
<link rel="stylesheet" href="../css/orangelinks.css" type="text/css">
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
var win=null;
function NeweventaddWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
</body>
</html>
<?
include('C:/userinfo.php');
?>
<?
$path1 = dirname($PATH_TRANSLATED)."/";
$source = $file1;
$source_name = $file1_name;
if(($source <> "none")&&($source <> "")){
if($error1 <> 1){
$dest = $path1.$source_name;
if(copy($source,$dest)){
echo "$source is upgeload<br>\n";
$imagesize = getimagesize($dest);
switch($imagesize[2]) {
case 0:
echo "<br> Screenshot is een onbekend formaat <br>";
unlink($dest);
exit;
case 1:
echo "<br> Screenshot is in GIF formaat <br>";
echo "$dest is $imagesize[0] pixels breed<br>";
echo "en $dest is $imagesize[1] pixels hoog<br>";
$newname = $path1;
$newname .=time() . ".gif";
if(copy($dest,$newname)) {
echo "<br> GIF naam is succesvol veranderd van <br> $dest naar $newname";
}
else {
echo "<br> GIF naam succesvol veranderd ";
}
unlink ($dest);
break;
case 2:
//echo "<br> Screenshot is in JPG formaat <br>";
//echo "$dest is $imagesize[0] pixels breed<br>";
//echo "en $dest is $imagesize[1] pixels hoog<br>";
$basname .=time() . ".jpg";
$newname = $path1;
$newname .=time() . ".jpg";
if(copy($dest,$newname)) {
//echo "<br> JPG naam is succesvol veranderd van <br> $dest naar $newname";
}
else {
//echo "<br> JPG naam succesvol veranderd ";
}
unlink ($dest);
break;
case 3:
echo "<br> Screenshot is in PNG formaat <br>";
echo "$dest is $imagesize[0] pixels breed<br>";
echo "en $dest is $imagesize[1] pixels hoog<br>";
$newname = $path1;
$newname .=time() . ".png";
if(copy($dest,$newname)) {
echo "<br> PNG naam is succesvol veranderd van <br> $dest naar $newname";
}
else {
echo "<br> PNG naam is succesvol veranderd ";
}
unlink ($dest);
break;
}
}
else {
echo "Screenshot directory is niet gechmod naar 777 !<br>\n";
echo "Het uploaden kan niet door gaan !<br>\n";
$error1 = 1;
}
}
unlink($source);
}
?>
<?
mysql_connect("$host", "$user", "$pass");
@mysql_select_db($db) or die( "");
$zeitblock = getdate();
$zeitformat = $zeitblock[year] . "-" . $zeitblock[mon] . "-" . $zeitblock[mday] . " " . $zeitblock[hours] . ":" . $zeitblock[minutes] . ":" . $zeitblock[seconds];
if ($nicknamefield = ''){
mysql_close();}
else {
$comment = ereg_replace("'","''",$comment);
$comment = ereg_replace("\[img]", "<img src=\"", $comment); $comment = ereg_replace("\[/img]", "\">", $comment);
$comment = eregi_replace("(^|[ \n\r\t])((http(s?)://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace("(^|[ \n\r\t])((ftp://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace("([a-z_-][a-z0-9\._-]*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)","<a href=mailto:\\1>\\1</a>",$comment);
$comment = eregi_replace("(^|[ \n\r\t])(www\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace("(^|[ \n\r\t])(ftp\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*D*)","\\1<a href=\"ftp://\\2\" target=\"_blank\">\\2</a>",$comment);
$comment = eregi_replace(":\)","[img]\"../images/smiles/smilet.gif\">",$comment); $comment[/img]",$comment);
$comment = eregi_replace(":\(","[img]\"../images/smiles/frown.gif\">",$comment); $comment[/img]",$comment);
$comment = eregi_replace(":\D","[img]\"../images/smiles/shiny.gif\">",$comment); $comment[/img]",$comment);
$comment = nl2br($comment);
$insert="insert into dbfotobase values('','$basname','$basname','$zeitformat', '$imagesize[0]', '$imagesize[1]','$comment','$event')";
mysql_query($insert);
mysql_close();}
?>
<?
$thumb = "./thumbnails";
$sortfile = "sortfile";
function RemoveNewLines (&$item, $key) {
$item = chop($item);
}
function GetFileList( $dirname="." ) { // Finds all the JPEGs in a directory
// First check to see if there's a file called $sortfile
// that contains a sorted list of filenames, one per line
// otherwise, will default to all files in alphabetical order
global $sortfile;
$files = array();
if (file_exists($sortfile)) {
$files = file($sortfile);
array_walk($files, 'RemoveNewLines');
} else {
$dir = opendir( $dirname );
while( $file = readdir( $dir ) ) {
if (ereg("jpg$",$file) || ereg("JPG$",$file) ||
ereg("jpeg$",$file) || ereg("JPEG$",$file) ) {
$files[] = $file;
}
}
sort($files);
}
return $files;
}
$margin = '150';
if ($margin) { // Create a list of thumbnails
if (!file_exists($thumb)) {
if ( ! mkdir($thumb, 0755)) {
echo "Error: could not create thumb dir - check write permissions";
die;
}
}
$imagelist = GetFileList();
while ( list($i,$image) = each ($imagelist) ) {
// Check the thumb exists
if (!file_exists($thumb."/".$image) ) {
$im = ImageCreateFromJPEG($image);
$width = ImageSX($im);
$height = ImageSY($im);
$twidth = $margin - 20;
$theight = ($twidth / $width) * $height;
$im2 = ImageCreate($twidth,$theight);
ImageCopyResized($im2,$im,0,0,0,0,$twidth,$theight,$width,$height);
ImageJpeg($im2, $thumb."/".$image, 100);
}
}
die;
}
?>