Problemer med billed galleri i php!

Tags:    php

<< < 12 > >>
Heysa!

Jeg har et spørgsmål!!(sjovt nok!)

Jeg har været inde på webmonkey og fuldt en tutorial, der gik ud på at lave et billed galleri i php.. Men jeg kan ikke få det til at virke.. Eller på sin vis... Den viser formen men i stedet for billederne viser den bare nogle felter med en firkant, en trekant og en cirkel... Ja ja dem kender jeg godt men hvorfor kan den ikke finde billederne!?!?

Koden er som følger:

<html>
<head>
<title>Photo gallery test</title>
<script language="JavaScript">
<!--
function photo_open(link, width, height)
{
var photoWindow = window.open(link,"photo",
'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height);


}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table cellpadding="2" align="center" width="80%" border="0">
<center><script language="JavaScript" scr="Menu.js"></script></center>
</table>
<table cellpadding="2" align="center" width="80%" border="0">
<?
$data_file = "list.photos.txt";
$thumbnail_dir = "Thumbs/";
$num_rows = 4;
$photos_per_row = 5;
$photos = file($data_file);
$total_photos = sizeof($photos);
$photos_per_page = $num_rows * $photos_per_row;
if(! isSet($start)) {
$start = 0;
}
$i = $start;
$prev_start = $start - $photos_per_page;
$next_start = $start + $photos_per_page;
for ($row=0; $row < $num_rows; $row++) {
Print("<tr>\\n");
for ($col=0; $col < $photos_per_row; $col++) {
if($i < $total_photos){
$thumbnail = $thumbnail_dir.trim($photos[$i]);
$thumb_image_size = getimagesize($thumbnail);
$image_size = getimagesize(trim($photos[$i]));
print("<td align=\\"center\\"><a href=\\"javascript:photo_open('photo_display.php?photo=
".trim($photos[$i])."','".$image_size[0]."','
".$image_size[1]."');\\"><img scr=\\"".$thumbnail.
"\\" ".$thumb_image_size[3]."></a></td>\\n");
} else {
print("<td></td>\\n");
}
$i++;
}
print("</tr>\\n");
}
?>
</table>
</body>
</html>

Please hjælp!! Jeg synes selv jeg har tjekket alt!?

P.S. Jeg ved godt der mangler navigation og nogle småting.. Men man burde da kunne se billederne nu!?

*VB newbie*- Jo mere man lærer, jo mere lærer man... øøhh..ja.



14 svar postet i denne tråd vises herunder
2 indlæg har modtaget i alt 3 karma
Sorter efter stemmer Sorter efter dato

Rettelse din komplette sti er /Images/Job1/Thumbs/PIC1.jpg
- det er dårlig stil at blande store og små bogstaver sammen...

Prøv at sætte "./" foran i img-src, altså <img src="./Thumbs/PIC1.jpg"...



Er du sikker på, at du har endelsen, dvs. fx PIC1.jpg eller PIC1. gif osv. med i filen? For det tilføjes jo ikke i scriptet....

/*
Mikl

ICQ: 159096501
MSN: mikl@mikl.dk
*/



Hvordan ser din list.photos.txt fil ud???



Hvordan ser din list.photos.txt fil ud???



Den har alle billed-fil navnene stående ét for hver linie. f.eks.

PIC1
PIC2
PIC3
osv.

Help!?

*VB newbie*- Jo mere man lærer, jo mere lærer man... øøhh..ja.



Hvordan ser det "oversatte" HTML-dokument ud?



Hvordan ser det "oversatte" HTML-dokument ud?



Det "oversatte" html ser således ud:



<html>
<head>
<title>Photo gallery test</title>
<script language="JavaScript">
<!--
function photo_open(link, width, height)
{
var photoWindow = window.open(link,"photo",
'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height);


}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table cellpadding="2" align="center" width="80%" border="0">
<center><script language="JavaScript" scr="Menu.js"></script></center>
</table>
<table cellpadding="2" align="center" width="80%" border="0">
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC1.jpg','1280','
960');"><img scr="Thumbs/PIC1.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC2.jpg','1280','
960');"><img scr="Thumbs/PIC2.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC3.jpg','1280','
960');"><img scr="Thumbs/PIC3.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC4.jpg','1280','
960');"><img scr="Thumbs/PIC4.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC5.jpg','1280','
960');"><img scr="Thumbs/PIC5.jpg" width="100" height="75"></a></td>
</tr>
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC6.jpg','960','
1280');"><img scr="Thumbs/PIC6.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC7.jpg','960','
1280');"><img scr="Thumbs/PIC7.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC8.jpg','1280','
960');"><img scr="Thumbs/PIC8.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC9.jpg','1280','
960');"><img scr="Thumbs/PIC9.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC10.jpg','1280','
960');"><img scr="Thumbs/PIC10.jpg" width="100" height="75"></a></td>
</tr>
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC11.jpg','1280','
960');"><img scr="Thumbs/PIC11.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC12.jpg','960','
1280');"><img scr="Thumbs/PIC12.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC13.jpg','960','
1280');"><img scr="Thumbs/PIC13.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC16.jpg','1280','
960');"><img scr="Thumbs/PIC16.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC17.jpg','960','
1280');"><img scr="Thumbs/PIC17.jpg" width="75" height="100"></a></td>
</tr>
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC18.jpg','960','
1280');"><img scr="Thumbs/PIC18.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC19.jpg','960','
1280');"><img scr="Thumbs/PIC19.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC20.jpg','960','
1280');"><img scr="Thumbs/PIC20.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC21.jpg','960','
1280');"><img scr="Thumbs/PIC21.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC22.jpg','960','
1280');"><img scr="Thumbs/PIC22.jpg" width="75" height="100"></a></td>
</tr>
</table>
</body>
</html>


Og ja... Jeg har husket alle "efternavnene" på filerne!

*VB newbie*- Jo mere man lærer, jo mere lærer man... øøhh..ja.



Hvordan ser det "oversatte" HTML-dokument ud?



Det "oversatte" html ser således ud:



<html>
<head>
<title>Photo gallery test</title>
<script language="JavaScript">
<!--
function photo_open(link, width, height)
{
var photoWindow = window.open(link,"photo",
'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height);


}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table cellpadding="2" align="center" width="80%" border="0">
<center><script language="JavaScript" scr="Menu.js"></script></center>
</table>
<table cellpadding="2" align="center" width="80%" border="0">
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC1.jpg','1280','
960');"><img scr="Thumbs/PIC1.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC2.jpg','1280','
960');"><img scr="Thumbs/PIC2.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC3.jpg','1280','
960');"><img scr="Thumbs/PIC3.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC4.jpg','1280','
960');"><img scr="Thumbs/PIC4.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC5.jpg','1280','
960');"><img scr="Thumbs/PIC5.jpg" width="100" height="75"></a></td>
</tr>
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC6.jpg','960','
1280');"><img scr="Thumbs/PIC6.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC7.jpg','960','
1280');"><img scr="Thumbs/PIC7.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC8.jpg','1280','
960');"><img scr="Thumbs/PIC8.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC9.jpg','1280','
960');"><img scr="Thumbs/PIC9.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC10.jpg','1280','
960');"><img scr="Thumbs/PIC10.jpg" width="100" height="75"></a></td>
</tr>
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC11.jpg','1280','
960');"><img scr="Thumbs/PIC11.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC12.jpg','960','
1280');"><img scr="Thumbs/PIC12.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC13.jpg','960','
1280');"><img scr="Thumbs/PIC13.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC16.jpg','1280','
960');"><img scr="Thumbs/PIC16.jpg" width="100" height="75"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC17.jpg','960','
1280');"><img scr="Thumbs/PIC17.jpg" width="75" height="100"></a></td>
</tr>
<tr>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC18.jpg','960','
1280');"><img scr="Thumbs/PIC18.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC19.jpg','960','
1280');"><img scr="Thumbs/PIC19.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC20.jpg','960','
1280');"><img scr="Thumbs/PIC20.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC21.jpg','960','
1280');"><img scr="Thumbs/PIC21.jpg" width="75" height="100"></a></td>
<td align="center"><a href="javascript:photo_open('photo_display.php?photo=
PIC22.jpg','960','
1280');"><img scr="Thumbs/PIC22.jpg" width="75" height="100"></a></td>
</tr>
</table>
</body>
</html>


Og ja... Jeg har husket alle "efternavnene" på filerne!

*VB newbie*- Jo mere man lærer, jo mere lærer man... øøhh..ja.



Hvilke billeder er det du ikke kan se? dine thumbnails eller dine pop-up billeder?

Husk nu at det ikke er ligemeget med store og små bogstaver i UNIX/Linux...[Redigeret d. 17/12-02 16:25:17 af Erik K. Aarslew-Jensen]



Prøv med en / (slash) foran Thumbs:
<img scr="/Thumbs/PIC1.jpg" width="100" height="75>

/*
Mikl

ICQ: 159096501
MSN: mikl@mikl.dk
*/



Hvilke billeder er det du ikke kan se? dine thumbnails eller dine pop-up billeder?

Husk nu at det ikke er ligemeget med store og små bogstaver i UNIX/Linux...[Redigeret d. 17/12-02 16:25:17 af Erik K. Aarslew-Jensen]




Det er mine thumbs jeg ikke kan se... Jeg har prøvet med en slash foran. Men forgæves...




*VB newbie*- Jo mere man lærer, jo mere lærer man... øøhh..ja.



<< < 12 > >>
t