// Определение шаблона $tpl = 'profile_publics'; $type = Text::get_get('type') == 'all' ? Text::get_get('type') : (int) Text::get_get('type'); if ($type === 'all') { $where = ' AND `p`.`user_add` = ' . $profile['id']; } else { //Получение всех постов данного пользователя $where = ' AND `p`.`type` = ' . $type . ' AND `p`.`user_add` = ' . $profile['id']; } $posts = $public->getList($where, array('date_add' => 'DESC'), 9); // Получение списка изображений для галерей for ($i = 0; $i < count($posts['pos']); $i++) { if ($posts['pos'][$i]['type'] == 1) { $posts['pos'][$i]['gallery'] = $public->getImages($posts['pos'][$i]['id'], 4); } elseif ($posts['pos'][$i]['type'] == 2) { $posts['pos'][$i]['video'] = $public->getVideo($posts['pos'][$i]['id'], 1, 460); } elseif ($posts['pos'][$i]['type'] == 3) { $posts['pos'][$i]['music'] = $public->getAudio($posts['pos'][$i]['id'], 1); } } self::setTemplatesVar($tpl, 'posts', $posts); break; default: // Определение шаблона $tpl = 'profile'; // Определение заголовка $page_title = TITLPREF . ' | ' . ($page['title'] != '' ? $page['title'] : $page['name']); // Размеры визуального редактора $editorWidth = 500; $editorHeight = 150; // Получение 3-х последний "постов"