Файл: public_html/sys/inc/obmen.php
Строк: 12
<?
function obmen_path($path)
{
$path = preg_replace("#(/){1,}#","/",$path);
$path = preg_replace("#(^(/){1,})|((/){1,}$)#","",$path);
$path_arr = explode('/',$path);
$rdir = NULL;
$rudir = NULL;
for ($i = 0; $i < count($path_arr); $i++)
{
$of = '/';
for ($z = 0; $z <= $i; $z++)
$of .= $path_arr[$z] . '/';
$rdir .= $path_arr[$i] . '/';
$dir_id = mysql_fetch_assoc(mysql_query("SELECT * FROM `obmennik_dir` WHERE `dir` = '/$rdir' OR `dir` = '$rdir/' OR `dir` = '$rdir' LIMIT 1"));
$dirname = $dir_id['name'];
$rudir .= "<a href="/obmen/".url(preg_replace("#(^(/){1,})|((/){1,}$)#","",$rdir))."/?page=$_SESSION[page]">".$dirname.'</a> > ';
}
return preg_replace("# > $#","",$rudir);
}
?>