hey mensen, ik verveelde me een beetje en heb een simpel DivX lijstje gecode. Het haalt alle titels uit een textfile (moviez.txt) sorteert ze op alfabetische volgorde en laat dit zien op het scherm, met daarbij achter elke film een link naar de IMDb search op die titel! Ik post hier de code zodat iedereen er gebruik van kan maken, of zelf aanpassen. Maar laat me even weten wat je gedaan hebt, misschien vind ik het zelf ook nog wel nuttig
anyway.
script in werking te zien op http://www2.hku.nl/~jaap3/
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
| <html>
<head>
<title>Mijn DivX;-) collectie</title>
</head>
<style type="text/css">
<!--
td {
font-family : "MS Sans Serif", Geneva, sans-serif;
font-size : 10pt;
}
-->
</style>
<body>
<table cellspacing="1" cellpadding="1" border="0">
<?php
$filename = "moviez.txt"; // textfile with the movies
$moviez = file($filename); // read the file into array $moviez
sort($moviez); // sort the array $moviez
$no=1; // set counter
while (list ($key, $val) = each ($moviez) )
{
$title = str_replace (" ", "+", $val); //replace spaces with an + for the search
echo (
"<tr>
<td>$no.</td>
<td>$val</td>
<td>
<small>
<a href=\"http://www.imdb.com/Find?for=$title&select=Titles\" target=\"_blank\">about this title</a>
</small>
</td>
</tr>\n"
); //output a nice formatted list of your movies with links!
$no++; //update the counter with +1
}
?>
</table>
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td>Movie info courtesy of</td>
</tr>
<tr>
<td align="center">
<a href="http://www.imdb.com/" target="_blank">
[img]"http://icons.imdb.com/Icons/logo.gif"[/img]
</a>
</td>
</tr>
</table>
<body>
</html> |
script in werking te zien op http://www2.hku.nl/~jaap3/
