p_url = $p_url;
$this->img_url = $img_url;
}
function getNavBar($link='%2$s')
{
$f = '';
$res = '» '.sprintf($link,$this->p_url,__('images'));
if (file_exists($this->root.$this->base_path))
{
$r = explode('/',$this->base_path);
for ($i=1; $ip_url.'?p='.$f,$r[$i]);
}
}
return $res;
}
function listDir($k,$v,$link='%2$s')
{
if ($v['d'] && $v['jail'] && $v['r'] && $v['x'] && $k != '.' && $k != '..') {
return sprintf($link,$this->p_url.'?p='.$v['l'],$k);
}
}
function listImg($k,$v,$link='')
{
$type = $this->__getType($this->root.'/'.$this->base_path.'/'.$k);
$url = $this->__cleanPath($this->img_url.'/'.$this->base_path.'/'.$k);
if ($type == 'img' && $v['jail'] && $v['r']) {
return sprintf($link,$url,$k,$this->getThumb($k),addslashes($url));
}
}
function getThumb($k=NULL,$absolute=false)
{
if ($k === NULL) {
$img = $this->base_path;
} else {
$img = $this->base_path.'/'.$k;
}
$root = !$absolute ? $this->img_url : $this->root;
$tn = $this->root.'/'.preg_replace('/^(.*)([.]\\w+)$/','$1.TN__$2',$img);
if (file_exists($tn)) {
return $this->__cleanPath($root.'/'.dirname($img).'/'.basename($tn));
} else {
return false;
}
}
function isImg()
{
if ($this->getImgType() === false) {
return false;
}
return true;
}
function getImgType()
{
return images::type($this->root.$this->base_path);
}
}
?>