Ihr Browser versucht gerade eine Seite aus dem sogenannten Internet auszudrucken. Das Internet ist ein weltweites Netzwerk von Computern, das den Menschen ganz neue Möglichkeiten der Kommunikation bietet.

Da Politiker im Regelfall von neuen Dingen nichts verstehen, halten wir es für notwendig, sie davor zu schützen. Dies ist im beidseitigen Interesse, da unnötige Angstzustände bei Ihnen verhindert werden, ebenso wie es uns vor profilierungs- und machtsüchtigen Politikern schützt.

Sollten Sie der Meinung sein, dass Sie diese Internetseite dennoch sehen sollten, so können Sie jederzeit durch normalen Gebrauch eines Internetbrowsers darauf zugreifen. Dazu sind aber minimale Computerkenntnisse erforderlich. Sollten Sie diese nicht haben, vergessen Sie einfach dieses Internet und lassen uns in Ruhe.

Die Umgehung dieser Ausdrucksperre ist nach §95a UrhG verboten.

Mehr Informationen unter www.politiker-stopp.de.

Menu verstecken/anzeigen [Jens Benecke: ]
 Menü [JB] PHPHP - How does it work? / Generating File lists

Generating iconized file and directory listings

The last (for now) nifty feature is used heavily on the TUHH Dormitory studies material collection. Just have a look. :-)

You can generate file and directory listings with PHPHP. For example if you want to offer download files. Look:

   ....
   $p->icons_cols = 4;			# show pics in 4 colums
   $p->icons_border = 0;		# NO border around the images
   $p->icons_name   = 1;		# show file names below image
   $p->icons_size   = 1;		# show file size below image
   print $p->icons("/pic/_dummies");	# (do NOT use relative paths here!)
   ....

The first four lines set the defaults for this page. (You can toggle them as often as you want, they are a property of the page object whose methods you are using). This would result in the directory being read and the files within it being displayed as clickable icons. Clicking on one file would display it in the browser (or download it).

You can also just display one file: <?=$p->icon("/pic/titel.png");?> results in
[titel.png]
titel.png
[0 kb]

You might want to center it (or put it in a table), though. :)

You can also generate listings of whole subdirectories. <?=$p->diricons("/my/directory");?> will scan all subdirectories of /my/directory, generate a <h3> header for each, and display the files in each subdirectory as icons.

Nifty Stuff

If you can give the web server write access to your directory (just once) and then call the page in your browser, it will generate thumbnail icons for most of your files. You only need to do this once and remove write access afterwards (as it might be considered a security risk to allow the web server to write to your files all the time), the thumbnails will be saved and re-read if they exist already.

Look:

[../pic/_dummies_writeable/file1.pdf]
file1.pdf
[2 kb]
[../pic/_dummies_writeable/file1.ps]
file1.ps
[22 kb]
[../pic/_dummies_writeable/file1.txt]
file1.txt
[0 kb]
[../pic/_dummies_writeable/file2.pdf]
file2.pdf
[2 kb]
[../pic/_dummies_writeable/file2.ps]
file2.ps
[5 kb]
[file2.txt]
file2.txt
[2 kb]
[../pic/_dummies_writeable/file3.jpg]
file3.jpg
[2 kb]
[../pic/_dummies_writeable/file3.pdf]
file3.pdf
[2 kb]
[../pic/_dummies_writeable/file3.png]
file3.png
[121 kb]
[../pic/_dummies_writeable/file3.ps]
file3.ps
[27 kb]
[../pic/_dummies_writeable/file3.txt]
file3.txt
[1 kb]
[file4.zip]
file4.zip
[57 kb]
[file5.tar.gz]
file5.tar.gz
[7 kb]

If you change the images you'll have to delete the icons (and grant write access to the directory and once call the page in your browser) though. The script does not (yet) detect changed images.

NOTE: If you have a lot of big files the thumbnail generation process takes some time. Also, you need the ImageMagick software package on the server. I'm planning to do the conversion process within PHP (which would require imlib, however), but as of now it's not finished yet. So if you don't see any icons it might be because your provider doesn't have ImageMagick installed.


Zuletzt geändert am: 15.07.2003 13:33
(c) 2003 Jens Benecke. Verlinkung dieser Seiten generell erlaubt, ich übernehme KEINE Verantwortung für externe Links (z.B. zu Google-Suche).
Details hierzu und zur Verantwortung über den Inhalt der Seiten hier.
Alle Artikel auf dieser Seite sind lediglich MEINUNGSÄUSSERNGEN.
[Apache Logo] [Debian Logo] [PHP Logo] [Perl Logo] [MySQL Logo] [Postfix Logo]