okay, I went for the first option.
First I made this script in the actual folder and it worked.
Now I wanted to implement it into index.inc.php and changed the opendir(".") in opendir("$basedir."/".$twg_album.") but it doesn't work
//------------------------------------------- extra links on top -------------------------
echo "<table cellspacing='10'>";
echo "<tr><td valign='top'>";
function getPDF($filetype) // here I am searching for pdf's and show a link if there are
{
$dir_handle = opendir("$basedir."/".$twg_album.");
while(false !== ($entryname = readdir($dir_handle)))
{
$splitentryname = explode(".", $entryname);
$sizesplitentryname = count($splitentryname);
$fileext = $splitentryname[$sizesplitentryname-1];
$fileext = strtolower($fileext);
if($filetype == $fileext)
{
echo "<a href='$entryname'>Download $entryname</a><br>";
}
}
}
getPDF("pdf");
//---------------------------------
echo "</td><td valign='top'>";
function getQXD($filetype) // here I am searching for qxd's and show a link if there are
{
$dir_handle = opendir("$basedir."/".$twg_album.");
while(false !== ($entryname = readdir($dir_handle)))
{
$splitentryname = explode(".", $entryname);
$sizesplitentryname = count($splitentryname);
$fileext = $splitentryname[$sizesplitentryname-1];
$fileext = strtolower($fileext);
if($filetype == $fileext)
{
echo "<a href='$entryname'>Download $entryname</a><br>";
}
}
}
getQXD("qxd");
//--------------------------------
echo "</td><td valign='top'>";
function getINDD($filetype) // here I am searching for indd's and show a link if there are
{
$dir_handle = opendir("$basedir."/".$twg_album.");
while(false !== ($entryname = readdir($dir_handle)))
{
$splitentryname = explode(".", $entryname);
$sizesplitentryname = count($splitentryname);
$fileext = $splitentryname[$sizesplitentryname-1];
$fileext = strtolower($fileext);
if($filetype == $fileext)
{
echo "<a href='$entryname'>Download $entryname</a><br>";
}
}
}
getINDD("indd");
//--------------------------------
echo "</td></tr></table>";
//----------------------------------------end extra links on top -------------------------
Help... please