Nieuw lid |
|
Als ik een 2e pagina wil openen van mijn fotoalbum krijg ik een fatal error.
er zit denk ik iets fout in een lus, maar wat? Anderen hebben het over classes,array's maar ik heb geen idee hoe dat werkt en of het in te passen in het script.
Kan iemand mij daarmee helpen? Ik ziet het niet, maar ben gelukkig niet de enige:-) Misschien weet iemand van jullie het?!
De foutmelding is:
Fatal error: Call to a member function on a non-object in /home/sites/site4233/web/upload/gallery.php on line 67
HET SCRIPT:
<?PHP
$aantalpp = "15";
$woord= "gallery";
$event = $_POST['event'];
$path = $event;
$title = "<small>Page </small>";
// $header = "<br><br><B>Foto's</B>";
$clm = "5"; // Aantal kolommen
$rows = "3"; // aantal rijen
$t_w = "120";
$t_h = "90";
?>
<HTML>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<BODY bgcolor='#990000' leftmargin='0' topmargin='0' onLoad="MM_preloadImages('/Buttons/Back-rollover.jpg')">
<div align="center"> <font face='Verdana' size='2' color='#FFFFFF'>
<img src="/images/Pictures.jpg">
<?PHP
echo $header;
if (isset($_GET['page'])) {
$page = $_GET['page'];
}
else {
$page = 0;
}
$up = strtoupper($path);
$enaam= str_replace("_"," ", $up);
echo "<br><br><center><h3><b>$enaam</b></h3>";
$min = 1 + ( $page * $aantalpp );
$max = ( $page +1 ) * $aantalpp;
$number = $clm * $rows;
$break = ( $page * $aantalpp ) + $clm;
echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\"><tr>";
$d = dir( $path );
$count = -2;
while( false !== ( $entry = $d->read() ) ) // LINE 67
{
if ( ($count >= $min) AND ($count <= $max) ){
if( eregi(".jpg|.jpeg|.gif|.bmp|.png", $entry )){
clearstatcache();
$size = getimagesize( $path . "/" . $entry );
$size[0] = $size[0] + 20;
$size[1] = $size[1] + 25;
$file_size = filesize( $path . "/" . $entry );
$file_size = round($file_size / 1000) . "k";
echo "<td><center><a href=\"#\" onmouseover=\"window.status='Vergroten';return true;\" onmouseout=\"window.status=''; return true\" onclick=\"window.open('" . $path . "/" . $entry . "','pix" . $count . "','width=" . $size[0] . ",height=" . $size[1] . ",innerwidth=" . $size[0] . ",innerheight=" . $size[1] . ",directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,top=0,left=0,leftmargin=0,topmargin=0,marginwidth=0,marginheight=0,screenX=0,screenY=0');return false\"><img src=" . $path . "/";
echo $entry." style='border:3px solid #fc5;' alt=" . $count . " height=" . $t_h . "></a></center></td>\n"; // width=$t_w
}
if ($count == $break){
echo "</tr>\n<tr>\n";
$break = $count + $clm ;
}
}
$count++;
}
$d->close();
echo "</tr></table>";
$pages = $count / $aantalpp;
$pageplus = $page + 1;
$pagemin = $page - 1;
if (($page + 1) < $pages){
$volgende = "<a href=" . $woord . ".php?page=" . $pageplus . "><img src='../Buttons/Forward.jpg' border='0'></a>";
}
if (($page + 1) > 1 ){
$vorige = "<a href=" . $woord . ".php?page=" . $pagemin . "><img src='../Buttons/Backward.jpg' border='0'></a>";
}
echo "<table border='0'>";
echo "<tr>";
echo "<td width='50'><center>$vorige</center></td>";
echo "<td width='50'><center><img src='../images/Circle.jpg'></center></td>";
echo "<td width='50'><center>$volgende</center></td>";
echo "</tr>";
echo "</table>";
?>
<br>
<a href="pregallery.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','/Buttons/Picturesmenu-rollover.jpg',1)"><img name="Image1" border="0" src="/Buttons/Picturesmenu.jpg"></a>
</font> </div>
</BODY>
</HTML>
?>
<?PHP $aantalpp = "15"; $woord= "gallery"; $event = $_POST['event']; $path = $event; $title = "<small>Page </small>"; // $header = "<br><br><B>Foto's</B>"; $clm = "5"; // Aantal kolommen $rows = "3"; // aantal rijen $t_w = "120"; $t_h = "90"; ?> <HTML> <script language="JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <BODY bgcolor='#990000' leftmargin='0' topmargin='0' onLoad="MM_preloadImages('/Buttons/Back-rollover.jpg')"> <div align="center"> <font face='Verdana' size='2' color='#FFFFFF'> <img src="/images/Pictures.jpg"> <?PHP if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 0; } echo "<br><br><center><h3><b>$enaam</b></h3>"; $min = 1 + ( $page * $aantalpp ); $max = ( $page +1 ) * $aantalpp; $number = $clm * $rows; $break = ( $page * $aantalpp ) + $clm; echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\"><tr>"; $count = -2; while( false !== ( $entry = $d->read() ) ) // LINE 67 { if ( ($count >= $min) AND ($count <= $max) ){ if( eregi(".jpg|.jpeg|.gif|.bmp|.png", $entry )){ $size[0] = $size[0] + 20; $size[1] = $size[1] + 25; $file_size = filesize( $path . "/" . $entry ); $file_size = round($file_size / 1000) . "k"; echo "<td><center><a href=\"#\" onmouseover=\"window.status='Vergroten';return true;\" onmouseout=\"window.status=''; return true\" onclick=\"window.open('" . $path . "/" . $entry . "','pix" . $count . "','width=" . $size[0] . ",height=" . $size[1] . ",innerwidth=" . $size[0] . ",innerheight=" . $size[1] . ",directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,top=0,left=0,leftmargin=0,topmargin=0,marginwidth=0,marginheight=0,screenX=0,screenY=0');return false\"><img src=" . $path . "/"; echo $entry." style='border:3px solid #fc5;' alt=" . $count . " height=" . $t_h . "></a></center></td>\n"; // width=$t_w } if ($count == $break){ $break = $count + $clm ; } } $count++; } $d->close(); $pages = $count / $aantalpp; $pageplus = $page + 1; $pagemin = $page - 1; if (($page + 1) < $pages){ $volgende = "<a href=" . $woord . ".php?page=" . $pageplus . "><img src='../Buttons/Forward.jpg' border='0'></a>"; } if (($page + 1) > 1 ){ $vorige = "<a href=" . $woord . ".php?page=" . $pagemin . "><img src='../Buttons/Backward.jpg' border='0'></a>"; } echo "<table border='0'>"; echo "<td width='50'><center>$vorige</center></td>"; echo "<td width='50'><center><img src='../images/Circle.jpg'></center></td>"; echo "<td width='50'><center>$volgende</center></td>"; ?> <br> <a href="pregallery.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','/Buttons/Picturesmenu-rollover.jpg',1)"><img name="Image1" border="0" src="/Buttons/Picturesmenu.jpg"></a> </font> </div> </BODY> </HTML> ?>
|