function list_dir($pth) {
loadLib('time');
$x = '
<div id=\'idx\'>
<table>
<tr>
<td class=\'b\'> #</td>
<td class=\'b w12_\'>Filename</td>
<td class=\'b\'>Modified</td>
</tr>
<tr>
<td colspan=\'3\'></td>
</tr>
'; $path[0] = URL.'v/'.$this->u['id'].'/'; $_name = _PATH.'v/'.$this->u['id'].'/';
while(false !== ($f = readdir($h))) { if($f <> '.' and
$f <> '..' and
substr($f,0
,4
) <> IMG_TH and
substr($f,0
,8
) <> IMG_AV
) $item['size'] = sprintf("%.2f",$stat['size']/1000
); if($this->u['status'] == 'admin') $_acc = 1; else $_acc = 0; $q = q('SELECT * FROM `'.PRFX.'imgs` WHERE id_u = "'.$this->u['id'].'" AND t = "'.$f.'" LIMIT 1'); if(n_r($q) == 0) q('INSERT INTO `'.PRFX.'imgs` (id,id_u,t,date,acc) VALUES (NULL,'.$this->u['id'].',"'.$f.'","'.DATETIME.'","'.$_acc.'");'); else $f_ = f($q);
if($f_['acc'] == 1) $acc = ''; else { $acc = 'n'; $acc_ = 'image waiting for acceptation'; }
$x .= '<tr class=\'v\''; if($this->u['avatar'] == $f) $x .= 'style=\'background-color:#ccc\' '; $x .= 'onclick=\'java script:_get("pic","'.$f.'");\'>
<td valign=\'top\' id=\'acc\' title=\''.$acc_.'\'><img src=\''.TPL.'img/dir/'.$acc.'file.gif\' /></td>
<td valign=\'top\'><div class=\'fl\'><a href=\'#\' onclick=\'java script:_get("pic","'.$f.'");\'>'.$f.'</a><div class=\'clearfix\' id=\''.$i.'\' style=\'display:none;\'>Do you want to delete picture? <a href=\''.URL.'profile/photo/d/'.$f.'\'>Yes</a> <a href=\''.URL.'profile/photo/\'>No</a></div></div><div class=\'fr\'>'.$item['size'].'kb </div></div class=\'fix\'></div></td>
<td valign=\'top\'>'._ago($stat['mtime']).' ago</td>
<td valign=\'top\' class=\'sp4\'><!--<img src=\''.TPL.'img/ico/del2.gif\' class=\'pointer\' id=\'pp'.$i.'\' alt=\'delete picture\' />--> <a href=\''.URL.$f_['id'].'\'>→</a></td>
</tr>
<script type=\'text/javascript\'>$(document).ready(function(){$("#pp'.$i.'").click(function(){$("#'.$i.'").toggle("slow")})});</script>';
$i++;/*$this->u['id'].'/p/'.substr($f,0,-4).'*/
$x .= "<img src=\"".URL.DIR_LIB.'thumb/'.INX.PHP.'?f='.$path[0].$f.'&w='.IMG_X.'&h='.IMG_Y.'&id='.$this->u['id'].'&t='.$f.'&pre=th" width="1" height="1" alt="" />';
# CREATES AVATAR AUTO. $x .= "<img src=\"".URL.DIR_LIB.'thumb/'.INX.PHP.'?f='.$path[0].$f.'&w='.IMG_X.'&h='.IMG_Y.'&id='.$this->u['id'].'&t='.$f.'&pre=avatar" width="1" height="1" alt="" />';
}
}
} $x .= '</table></div>'; return $x;
}