I have downloaded a file manager from the coding library. It's generaly a very good file manager, except it has many bugs :-)
I have corrected all of them except one that could do it.
It is a function for creating a file alias.
the code is as follows....
//$alias_to is the file name to be aliased to
//get_file_path($fp) returns the path of the file to be aliased.
$allowalias = true;
$filealiases = true;
$filealiasext = 'als';
if ($allowalias && $filealiases && ($act == "alias") && ($subdir != $trashcan))
{
if (isset($file) && ($file != ""))
{
if (!checkFileName($file) || (($subdir == "") && ($file == $trashcan)))
{
redirectWithMsg("warning", "als1");
}
else
{
$fp = getFilePath($file);
$fp_alias = $fp.".".$filealiasext;
//echo $fp_alias;
if (!is_dir($fp))
{
if ($aliasto != "")
{
if ($fda = @fopen($fp_alias, "w"))
{
@fwrite($fda, $aliasto);
@fclose($fda);
redirectWithMsg("info", "als2", $file);
}
else
{
redirectWithMsg("error", "als3", $file);
}
}
else
{
if (@is_readable($fp_alias))
{
@unlink($fp_alias);
redirectWithMsg("info", "als4", $file);
}
else
{
redirectWithMsg("info", "als5", $file);
}
}
}
else
{
redirectWithMsg("error", "als6");
}
}
}
else
{
redirectWithMsg("warning", "als7");
}
}
Can someone give me a hint? If not anyone knows a script that can to it?
Thanks