Moin moin
also leutz ich habe folgendes prob.
ich habe folgenden code im netz gefunden der auch funtz nun habe ich bloß noch das prob. das ich eine seite habe mit Frames und zwar möchte ich wenn ich dann mit diesem script meine bilder seiten anwählen das sie alle in dem selben frame geöffnet werden.
mit der ersten seite funtz das ja aber so bald ich die seiten weiter gehe also oben ist so ein pulldown menü dann öffnet er die seiten immer als _blank
so und nun denn code....
PHP
<?php
////////////////////////////////////////
//
// 35mm Slide Gallery
//
// by
//
// [url]www.andymack.com/freescripts/[/url]
////////////////////////////////////////
$imgdir = $_GET['imgdir'] ;
$page = $_GET['page'];
$a_img = array();
include("header.inc");
require('config.php');
///// for captioning
function caption($filename) {
$is_captioned = check_perms($filename);
if ($is_captioned) {
print"
<font face='Arial, Helvetica, sans-serif' size=2 color='#000000'>";
include($filename);
print"</font>";
}
}
///// for album description
function album($filename) {
$is_captioned = check_perms($filename);
if ($is_captioned) {
print"<font face='Arial, Helvetica, sans-serif' size=3 color='#333333'>";
include($filename);
print"</font>
";
}
}
////check file permission
function check_perms($filename) {
if (! file_exists($filename)) return false;
$fileperms = fileperms($filename);
$isreadable = $fileperms & 4;
if ( is_file($filename) ) {
// pictures, thumbnails, config files and comments only need to be readable
if (! $isreadable) {
if (MODE_WARNING) print "$filename: wrong permission
";
}
return $isreadable;
}
else if ( is_dir($filename) ) {
// galleries need to be both readable and executable
$isexecutable = $fileperms & 1;
if (! $isreadable || ! $isexecutable)
if (MODE_WARNING) print "$filename: wrong permission
";
return ( $isreadable && $isexecutable); // ($dirperms & 5) == 5 ?
}
// default behavior: the filename does not exist
return false;
}
$dh = opendir($dir);
while($file = readdir($dh))
{
if ($file != "." && $file != ".." && is_dir($file))
{$dname[] = $file;
sort($dname);
reset ($dname);
}
}
print "<script language=\"JavaScript\">";
print "function MM_jumpMenu(targ,selObj,restore){eval(targ+\".location='\"+selObj.options[selObj.selectedIndex].value+\"'\");";
print " if (restore) selObj.selectedIndex=0;}";
print "</script>";
print "<form name=\"form1\">";
print "<select name=\"menu1\" onChange=\"MM_jumpMenu('parent',this,0)\">";
print "<option value=\"#\">Bilder...</option>
\n";
$u=0;
foreach($dname as $key=>$val)
{ if($dname[$u])
{ print "<option value=\"index.php?imgdir=$dname[$u]\">$dname[$u]</option>\n";
$u++;
}
}
print "</select>";
if ($imgdir =="")
{$imgdir = $dname[0];
}
$dimg = opendir($imgdir);
while($imgfile = readdir($dimg))
{
if( (substr($imgfile,-3)=="gif") || (substr($imgfile,-3)=="jpg") || (substr($imgfile,-3)=="JPG") || (substr($imgfile,-3)=="GIF") )
{
$a_img[count($a_img)] = $imgfile;
sort($a_img);
reset ($a_img);
}
}
print "<h2>$imgdir</h2>";
$totimg = count($a_img); // total images number
$totxpage = $col*$maxrow; // images x page
$totpages = ($totimg%$totxpage==0)?((int)$totimg/$totxpage):((int)($totimg/$totxpage)+1); // number of total pages
if($totimg == false)
print "<h3>
Hier befinden sich noch keine Bilder
</h3>";
else
{
print "</form>";
///print album description
$album_name = "$imgdir/album.txt";
album($album_name);
print "<center><table width=700 bgcolor=#ffffff border=0 bordercolor=#ffffff cellpadding=2 cellspacing=3>\n";
// start page
if($page=="" || $page==1)
{
$x=0;
$page = 1;
}
else
$x = (($page-1)*($totxpage));
$r=0;
// print of table
foreach($a_img as $key=>$val)
{
$caption_name = "$imgdir/$a_img[$x].txt";
if(($x%$col)==0)
print "<tr>\n";
if($a_img[$x])
{
$size = getimagesize ("$imgdir/$a_img[$x]");
$halfw = round($size[0]/2);
$halfh = round($size[1]/2);
$quarterw = round($size[0]/4);
$quarterh = round($size[1]/4);
if($size[1] < $size[0])
{
$height = 86;
$width = 130;
$imgnumber = ($x+1);
if("$imgdir/$a_img[$x]" !="")
if ($thumb){
$thumbnail = "thumbs.php?image=$imgdir/$a_img[$x]&newheight=86&newwidth=130&width=$size[0]&height=$size[1]";
}
else
{
$thumbnail = "$imgdir/$a_img[$x]";
}
print "<td align=center valign=top>";
print "<TABLE WIDTH=198 BORDER=0 CELLPADDING=0 CELLSPACING=0>";
print "<TR><TD COLSPAN=3></TD></TR>";
print "<TR><TD></TD>";
print "<TD>[url='#']<img src=\"$thumbnail\" height=$height width=$width border=0 alt='$a_img[$x]'>[/url]</TD>";
print "<TD></TD></TR><TR>";
print "<TD COLSPAN=3>
<font size=\"1\">[url='#']$size[0] x $size[1][/url] | [url='#']1/2[/url] | [url='#']1/4 size[/url]</font>";
caption($caption_name);
print "</TD></TR>";
print "</TABLE></center>";
print "</td>\n";
}
else
{ $height = 130;
$width = 86;
if ($thumb){
$thumbnail = "thumbs.php?image=$imgdir/$a_img[$x]&newheight=130&newwidth=86&width=$size[0]&height=$size[1]";
}
else
{
$thumbnail = "$imgdir/$a_img[$x]";
}
$imgnumber = ($x+1);
if("$imgdir/$a_img[$x]" !="")
print "<td align=center valign=top>";
print "<TABLE WIDTH=198 BORDER=0 CELLPADDING=0 CELLSPACING=0>";
print "<TR><TD COLSPAN=3></TD></TR>";
print "<TR><TD></TD>";
print "<TD>[url='#']<img src=\"$thumbnail\" height=$height width=$width border=0 alt='$a_img[$x]'>[/url]</TD>";
print "<TD></TD></TR><TR>";
print "<TD COLSPAN=3>
<font size=\"1\">[url='#']$size[0] x $size[1][/url] | [url='#']1/2[/url] | [url='#']1/4 size[/url]</font>";
caption($caption_name);
print "</TD></TR>";
print "</TABLE>";
print "</td>\n";
}
}
if(($x%$col) == ($col-1))
{
print "</tr>\n";
$r++;
}
// print "r=$r - maxrow=$maxrow
";
if($r==$maxrow)
{
break;
}
else
$x++;
}
print "</table>\n";
}
// page break
$imgdir = str_replace(" ", "%20", $imgdir);
//page number
print "
<font size=2 face=verdana>";
if($totimg>$totxpage)
{
if($totpages>$page)
{
$next = $page+1;
$back = ($page>1)?($page-1):"1";
if($page>1)
{
$back = $page-1;
print "[url='index.php?imgdir=$imgdir&page=1>Seite'] | <a href=index.php?imgdir=$imgdir&page=$back><< zurück [/url]";
}
print " [b]Seite $page von $totpages[/b] [url='index.php?imgdir=$imgdir&page=$next>'] | <a href=index.php?imgdir=$imgdir&page=$totpages>auf die letzte Seite[/url]";
}
else
{
$next = (($page-1)==0)?"1":($page-1);
print "[url='index.php?imgdir=$imgdir&page=1>Seite'] | <a href=index.php?imgdir=$imgdir&page=$next> zurück [/url] [b]Seite $page von $totpages[/b] ";
print "</center>";
}
}
include("footer.inc");
?>
Alles anzeigen
ich habe das script schon eingebaut... wer sich von meiner beschreibung kein bild machen kann soll mal bitte schauen
unter http://www.zimmerei-wiegandt.de und dort unter Fotos...
also dann schon mal danke für eure hilfe...
cya noobie