1 |
dpavlin |
1.1 |
<? |
2 |
|
|
|
3 |
|
|
function find_html_file($dir,$file) { |
4 |
dpavlin |
1.4 |
if (substr($dir,0,1) == "/" && $dir !="") { |
5 |
dpavlin |
1.3 |
$file="$dir/$file"; |
6 |
dpavlin |
1.5 |
} elseif ($dir == "" && substr($file,0,1) == "/") { |
7 |
|
|
// $file |
8 |
dpavlin |
1.3 |
} else { |
9 |
|
|
$file="./$dir/$file"; |
10 |
|
|
} |
11 |
dpavlin |
1.2 |
if (file_exists("$file") && is_file("$file")) { return "$file"; } |
12 |
|
|
if (file_exists("$file.htm") && is_file("$file.htm")) { return "$file.htm"; } |
13 |
|
|
if (file_exists("$file.html") && is_file("$file.html")) { return "$file.html"; } |
14 |
dpavlin |
1.1 |
return 0; |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
?> |