Here is a simple page that will display all your work files, you should be able to adapt the display to fit your site.
For this to work all the files must be in the same directory and have the same name prefix with a number suffix, eg workfile1, workfile2, workfile3, etc.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
var rootpath="http://mydomain/mysubdirectory/"; // Put the details of where your files are
function file_exists (url) {
// http://kevin.vanzonneveld.net
// + original by: Enrique Gonzalez
// + input by: Jani Hartikainen
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// % note 1: This function uses XmlHttpRequest and cannot retrieve resource from different domain.
// % note 1: Synchronous so may lock up browser, mainly here for study purposes.
// * example 1: file_exists('http://kevin.vanzonneveld.net/pj_test_supportfile_1.htm');
// * returns 1: '123'
url=rootpath+url;
var req = this.window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
if (!req) {throw new Error('XMLHttpRequest not supported');}
// HEAD Results are usually shorter (faster) than GET
req.open('HEAD', url, false);
req.send(null);
if (req.status == 200){
return true;
}
return false;
}
function create_list(filenum1,filenum2){ // when the function is called put the range of numbers you want to appear in the column
var fileprefix="myfile"; // put the name prefix of your files
var ext="htm"; // the file extension for your files
var optionCntr = 1;
for (x = filenum1; x <= filenum2; x++){
workfile=fileprefix+x+"."+ext;
fullfile=rootpath+workfile;
listfile=fileprefix+x;
if (file_exists(workfile)){
document.write('<a href="'+fullfile+'">'+ listfile +'</a><br>');
}
}
}
</script>
</head>
<body onload="create_list(7)">
<form>
<table border="0" width="100%">
<tr>
<td>
</td>
<td>
<script>create_list(1,20)</script>
</td>
<td>
<script>create_list(21,40)</script>
</td>
<td>
<script>create_list(41,60)</script>
</td>
</tr>
</table>
</form>
</body>
</html>
The script checks for the existence of the file, if it does not exist it will not create a link.
Bookmarks