Просмотр поста

.
blackvj

Screamer,

$text = preg_replace_callback('#\[im\](.*?)\[/im\]#si', $getImages, $text);
function getImages($matches) {
$array = array();
$dir = opendir('../'.$matches[1].'/');
while ($file = readdir($dir)) {
if (($file != '.') && ($file != "..")) {
$array[] = $file;
}
}
closedir($dir);
$total = count($array);
$end = $start + $kmess;
for ($i = $start; $i < $end; $i++) {

$t = '<img src="http://anires.ru/'.$matches[1].'/' . $array[$i] . '.gif" /><br/>';

}

return $t;
}


папка сайт.ru/bonus/1.gif и тд