elfi,
<?
$file = H.'system/cache/user/anketa/'.$ank->id.'.json';
if (!file_exists($file)){
$q = array (
'foto' => $db -> q('select img, id from album_foto where id_user = '.$id.' order by id desc limit 10')->fetchAll(),
'stena' => $db -> q('select a.* from stena a where a.id_ank = '.$ank->id.' order by a.id desc limit 10')->fetchAll()
);
file_put_contents($file, serialize($q));
}else $q = unserialize(file_get_contents($file));
?>
Работает
и генерация упала до 0.006