PDA

View Full Version : need some help



rgildoss
05-11-2005, 05:58 PM
okay,

I'm looking to create a text box that populates from file names in a selected folder.....

For instance,
I have a folder that has shortcuts to network folders.

And i need to display these links on a html page.. wich works great, but because i have thousands of these shortcuts it would be a huge work load to add these folders manualy to the page..

So i was wondering if there maybe a applet that can do this. so basicly the html page would just display the content of that folder....maybe a dynamic text box ??

any help on this would be greatfull :confused:

jscheuer1
05-11-2005, 08:15 PM
Is this on your computer? If so, this would work:


<html>
<head>
<title>Dir Display - Demo</title>
</head>
<body>
<iframe src="//c:/networkshortcuts/" width="100%" height="100%" scrolling="auto" frameborder="0"></iframe>
</body>
</html>Just substitute the path to the folder you want displayed. Even if the directory isn't on your computer, many servers will display the contents of a directory if its absolute url is inserted above where I have //c:/networkshortcuts/ - IF there is no file in that directory that takes precedence like a file named index.html would.

rgildoss
05-12-2005, 03:59 PM
Thank you so much for the info…
I do have a problem when using this tag.
Using this displays the entire folder content, meaning it also displays the folder properties on the left side


If I change the folder views from “Show common tasks in folders” to “Use windows classic folders”
It does go away, however it’s only to my PC. When another user on a PC has the Show common tasks in folders “ selected they have the same problem , seeing the tasks menue…




So is there a way to not show this at all?

jscheuer1
05-12-2005, 08:14 PM
This is only an issue in IE on a windows based computer showing a local (and possibly a windows based networked) directory. Using another browser will eliminate this, as will using IE but, displaying a directory on a system that doesn't use windows, like the internet. Locally however, IE uses the directory settings generally in force for listing directories. If the particular computer is using the most common system defaults, this code will do what you want on most windows systems:


<html>
<head>
<title>Dir Display - Demo</title>
</head>
<body style="overflow:hidden">

<iframe style="position:absolute;top:0;left:-198px;" src="//c:/networkshortcuts/" width="122%" height="100%" scrolling="auto" frameborder="0"></iframe>

</body>
</html>However, I would recommend against it as there are so many ifs involved and, it will mess things up under many other circumstances. Besides, is it so bad to see the common tasks?

jscheuer1
05-13-2005, 08:33 AM
I got to thinking (first mistake) 'there must be a way to make this more widely applicable'. I came up with this set of scripts that should behave pretty well no matter the browser (as long as it supports iframes) and as long as the two variables at the top are correctly set.


<html>
<head>
<title>Dir Display - Demo</title>
</head>
<script type="text/javascript">
///////////////////////////////
//Directory Display Script
//Copyright © John Davenport Scheuer
//Permission to use granted
//This credit must remain
///////////////////////////////

//Set Use -
//ielocal for viewing a directory that will display in Windows default explorer mode
//other for all others
var Use = 'ielocal';

//Set Directory to be displayed
var dir = '//c:/networkshortcuts/'

//////////////No Need to Edit Below Here/////////////
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;
if ((typeof(window.onresize))==('object')||('undefined'))
window.onresize=refresh;
function refresh() {
setTimeout("doit()",1)
}
function doit(){
if (window.location.reload)
window.location.reload( true );
else if (window.location.replace)
window.location.replace(unescape(location.href))
else
window.location.href=unescape(location.href)
}
</script>
<body style="overflow:hidden">
<script type="text/javascript">
if (ns6||ie4){
function winWid(){ return (ns6) ? window.innerWidth:document.body.clientWidth; }
var width=winWid();
var left=0;
if(ie4&&(Use=='ielocal')){
width+=210;
left-=210;
}
document.write('<iframe style="position:absolute;top:0;left:'+left+'px;" src="'+dir+'" width="'+width+'" height="100%" scrolling="auto" frameborder="0">Unsupported Browser</iframe>')
}
else
document.write('Unsupported Browser')
</script>
</body>
</html>

rgildoss
05-13-2005, 03:07 PM
Thank you so much for the help on this .....
it works great.......

you guys are the best :)