English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

use a fake directory name, I'll figure it out, but use an absolute URL so I'll recognize it. You don't have to make any special programming to make it display just pictures, as there will only be pictures in the gallery. It just needs to write "" to the document, or whatever the equivalent would be.

PHP, ASP, etc... I have all the script interpreteurs running on my server.

So that I don't have to change the html everytime I upload a new one.

I tried and tried to learn how, but apparently you can't do this with javascript in a way that's not sneaky.

I just need it to display the picture itself and nothing else. I can modify it to do the rest of the work. Thanks!!!

2006-09-23 07:00:56 · 2 answers · asked by Rockstar 6 in Computers & Internet Programming & Design

2 answers

Interestingly enough, I just completed one of these scripts for my brother. He has a directory which stores textures for his ActiveWorlds buidling materials, but he didn't want to have to look through thousands of files to find the right one, so he asked me to make a gallery script for him. I did.

Here's the script. It displays 20 images per page, and as many pages as needed to display all the images in the directory. The images are auto-resized to 128x128 when they finish loading. Hopefully, you can figure out what needs to be changed for your purposes:


$dir = "textures/";
$txt="

";
$perpage=4;
$good_exts[]="gif";
$good_exts[]="png";
$good_exts[]="jpg";
$good_exts[]="jpeg";
$log="";
if (file_exists("gallery_log.txt")) { $log=file_get_contents("gallery_log.txt"); }
$f=fopen("gallery_log.txt","w");
fwrite($f,$log.$_SERVER['REMOTE_ADDR']."|".date("d-m-Y \G\M\TO")."\r\n");
fclose($f);

if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
$temp=explode(".",$file);
$temp=$temp[count($temp)-1];
if (array_search($temp,$good_exts)!=FALSE) {
$files[]=$dir.$file;
}
}
closedir($dh);
}
}
for ($p=($_GET['page']-1)*20; ($p if (($p%$perpage)==0) {
$txt.="
";
for ($h=$perpage; $h>0; $h-=1) {
if ($p-$h>=($_GET['page']-1)*20) {
$txt.="";
}
}
$txt.="";
}
$txt.="";
}
$txt.="";
for ($h=$perpage; $h>0; $h-=1) {
$txt.="";
}
$txt.="
".$files[$p-$h]."
".$files[$p-$h]."
";
if ($_GET['page']>1) { $txt.="

<< Previous Page"; }
else { $txt.="
"; }
if ($pNext Page >>
"; }
else { $txt.="
"; }
echo $txt;
?>


-IMP ;) :)

2006-09-23 08:13:12 · answer #1 · answered by icemetalpunk 5 · 0 0

protected directories are private. you should stay out of them.

here is how to find things in unprotected subdirectories. at google type in the following

intitle:”index of” (wma|au|wav|mp3|asf) beatles

learn google's extensive advanced search operators here. google limits the number of search keywords to 32

http://www.googleguide.com/

2006-09-23 07:06:10 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers