Już już, przepraszam

To jest plik, gdzie pokazywana jest galeria, tutaj korzystam z dodatkowego pliku pgfunctions.php
Kod
<?php
/***INCLUDE THE FUNCTION FILE ***/
if (!file_exists("pgfunctions.php"))
{
echo "Dostęp zabroniony<br>";
}
include ("pgfunctions.php");
echo "<table cellspacing=\"5\">";
echo "<tr>";
echo "<td><font class=\"tekstmaly\">Dostępne galerie:</font> </td>";
$dir_list = Dir_List($base_serverpath);
for ($i = 2; $i < count ($dir_list); $i++)
{
$dirname = $dir_list[$i];
echo "<td><font class=\"tekstmaly\"><a href=\"$PHP_SELF?gallery_name=$dirname\">$dirname</a></font> </td>";
}
echo "</tr>";
echo "</table>";
/*** if there's not a Gallery chosen - chose the first ***/
if (!$gallery_name)
{
$gallery_name = $dir_list[2];
}
echo "<center><table cellpadding=\"8\">";
echo "<tr>";
echo "<td colspan=\"4\">";
echo "<br><font face=\"arial\" color=\"#cc0033\" size=\"2\">";
echo "<div align=\"center\">$gallery_name</div>";
echo "</font>";
echo "<hr width=\"100%\" size=\"2\" align=\"right\" color=\"#cc0033\">";
echo "</td>";
echo "</tr>";
/*** if there's already a Picture chosen ***/
if ($picture_n)
{
$picturename_withpath = $base_dir."/".$gallery_name."/". $picture_n;
echo "<tr><td>";
echo "<img src=\"$picturename_withpath\" border=\"0\">";
echo "</td></tr>";
}
else
{
$Picture_List = Picture_List ($base_serverpath . "/".$gallery_name);
$picture_at_row =0;
for ($i = 0; $i < count($Picture_List); $i++)
{
$Picturename = $Picture_List[$i];
$particles = explode(".", $Picturename);
$Titel = $particles[0];
$particles[0] = $particles[0]."_thumb";
$Picturename_thumb = implode(".", $particles);
$Picturename_thumb_withpath = $base_dir."/".$gallery_name."/". $Picturename_thumb;
$Picturename_thumb_withserverpath = $base_serverpath."/".$gallery_name."/". $Picturename_thumb;
$Picturename_withpath = $base_dir."/".$gallery_name."/". $Picturename;
if (!file_exists("$Picturename_thumb_withserverpath"))
{
$Picturename_thumb_withpath = "no_thumb.gif";
}
if ($picture_at_row >= $pictures_per_row) $picture_at_row=0;
if ($picture_at_row==0) echo "<tr>";
echo "<td>";
echo "<a href=\"$PHP_SELF?picture_n=$Picturename&gallery_name=$gallery_name\"><img src=\"$Picturename_thumb_withpath\" width=\"120\" border=\"0\"></a>";
echo "</td>";
$picture_at_row ++;
}
}
echo "<tr>";
echo "<td colspan=\"4\">";
echo "<br><br><br><hr width=\"100%\" size=\"2\" align=\"right\" color=\"#cc0033\">";
echo "<font class=\"menu\"><div align=\"right\"><a href=\"javascript:history.back()\">back</a></div></font><br><br>";
echo "</td>";
echo "</tr>";
echo "</table>";
?>
c.d.
Wspomniany wcześniej pgfunctions.php:
Kod
<?php
if (!file_exists("pgconfig.php"))
{
echo "Uups! Fatal Error pgconfig.php is missing, please contact your webmaster<br>";
}
include ("pgconfig.php");
$version = "V0.9b";
$base_url = $SCRIPT_NAME;
$base_dir = dirname($SCRIPT_NAME);
$base_serverpath = dirname($PATH_TRANSLATED);
$date = Date("d M Y");
function Error($err)
{
global $webmaster_mail, $home_url, $version;
echo "<h2>Uups! Error: $err</h2><br>";
echo "contact webmaster: <A
HREF=\"mailto:$webmaster_mail\">$webmaster_mail </A><br>";
echo "<A HREF=\"http://$home_url\">home</A><br><br>";
echo "Script $version, copyrights by <A
HREF=\"http://www.dgeuropa.pl\">www.dgeuropa.pl</A>";
}
function Dir_List ($path)
{
$dir = @opendir($path);
if ($dir)
{
while ($file = readdir($dir))
{
/*** only dir's not files ***/
if (is_dir($file))
{
$dir_list[]= $file;
}
}
}
else
{
@closedir($path);
Error ("Dostęp zabroniony");
}
@closedir($path);
sort($dir_list);
return $dir_list;
}
function Picture_List ($gallery_path)
{
$dir = @opendir($gallery_path);
if ($dir)
{
while ($file = readdir($dir))
{
/*** only jpeg, jpg, gif and bmp ***/
if (eregi("\.(jpeg|jpg|gif|bmp)$", $file))
{
/*** without the thumbnail files ***/
if (!eregi("_thumb\.(jpeg|jpg|gif|bmp)$", $file))
{
$Picture_List[]= $file;
}
}
}
}
else
{
@closedir($gallery_path);
Error ("Dostęp zabroniony");
}
@closedir($gallery_path);
sort ($Picture_List);
return $Picture_List;
}
?>
Błąd wywala mi taki:
Warning: sort() expects parameter 1 to be array, null given in
/home/moja_nazwa/public_html/pl/pgfunctions.php on line
45 oraz
Warning: sort() expects parameter 1 to be array, null given in
/home/moja_nazwa/public_html/pl/pgfunctions.php on line
73 Z góry dziękuję za odpowiedzi