Отзывы тестовая

$cash_time){ $result = json_decode(vk_query('https://api.vk.com/method/board.getComments', array( 'group_id' => '79273040', 'topic_id' => '30800886', 'count' => '15', 'extended' => '1', 'sort' => 'desc' )), true); $update = false; $profil_arr = array(); foreach ($result['response']['profiles'] as $profil){ $profil_arr[$profil['uid']] = $profil; $update = true; } $html = '
'; foreach ($result['response']['comments'] as $comment){ if (!empty($comment['from_id'])){ $profil = $profil_arr[$comment['from_id']]; $text = $comment['text']; preg_match('@\[(.*)\:(.*)\|(.*)\]@', $text, $m); if (!empty($m[0])){ $uid = $m[1]; $name = $m[3]; $r = ''.$name.''; } $text = preg_replace('@\[.*\]@', $r, $text); $html .= '
'; if ($comment['from_id'] != 101){ $html .= ''; } else { $html .= '
'.$profil['first_name'].' '.$profil['last_name'].'
'; } $html .= '
'.$text.'
'.date('d.m.Y H:i', $comment['date']).'
'; } } $html .= '
'; if ($update == true){ $cash_live = time() + 60*60; file_put_contents('cash_time.txt', $cash_live); file_put_contents('cash_vk.html', $html); echo $html; } else { $cash_html = file_get_contents('cash_vk.html'); echo $cash_html; } } else { $cash_html = file_get_contents('cash_vk.html'); echo $cash_html; } ?>