$tpl->set('{section}', '_' . $check_album['album_id'] . '_sec=newphotos'); } else { $tpl->set('{close-link}', '/albums/view/' . $check_album['album_id']); $tpl->set('{section}', '_' . $check_album['album_id']); } if (!$fuser) { $tpl->set('[all]', ''); $tpl->set('[/all]', ''); $tpl->set_block("'\\[wall\\](.*?)\\[/wall\\]'si", ""); } else { $tpl->set('[wall]', ''); $tpl->set('[/wall]', ''); $tpl->set_block("'\\[all\\](.*?)\\[/all\\]'si", ""); } $tpl->set('{jid}', $row['position']); $tpl->set('{comm_num}', $row['comm_num'] - 3 . ' ' . gram_record($row['comm_num'] - 3, 'comments')); $tpl->set('{num}', $row['comm_num']); $tpl->set('{author}', $row['user_search_pref']); $author_info = explode('|', $row['user_country_city_name']); if ($author_info[0]) { $tpl->set('{author-info}', $author_info[0]); } else { $tpl->set('{author-info}', ''); } if ($author_info[1]) { $tpl->set('{author-info}', $author_info[0] . ', ' . $author_info[1] . '<br />'); } megaDate(strtotime($row['date']), 1, 1); if ($user_id == $user_info['user_id']) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', '');
$tpl->set('{owner-id}', $row['owner_user_id']); $tpl->set('{close-link}', $close_link); megaDate(strtotime($row['add_date'])); if ($row['owner_user_id'] == $user_id) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); } else { $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); $tpl->set('[not-owner]', ''); $tpl->set('[/not-owner]', ''); } if ($config['video_mod_add_my'] == 'no') { $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); } $tpl->set('{prev-text-comm}', gram_record($row['comm_num'] - 3, 'prev') . ' ' . ($row['comm_num'] - 3) . ' ' . gram_record($row['comm_num'] - 3, 'comments')); if ($row['comm_num'] < 4) { $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); } else { $tpl->set('[all-comm]', ''); $tpl->set('[/all-comm]', ''); } if ($config['video_mod_comm'] == 'yes') { $tpl->set('[admin-comments]', ''); $tpl->set('[/admin-comments]', ''); } else { $tpl->set_block("'\\[admin-comments\\](.*?)\\[/admin-comments\\]'si", ""); } $tpl->compile('content'); AjaxTpl(); $db->query("UPDATE LOW_PRIORITY `" . PREFIX . "_videos` SET views = views+1 WHERE id = '" . $vid . "'");
function user_age($user_year, $user_month, $user_day) { global $server_time; if ($user_year) { $current_year = date('Y', $server_time); $current_month = date('n', $server_time); $current_day = date('j', $server_time); $current_str = strtotime($current_year . '-' . $current_month . '-' . $current_day); $current_user = strtotime($current_year . '-' . $user_month . '-' . $user_day); if ($current_str >= $current_user) { $user_age = $current_year - $user_year; } else { $user_age = $current_year - $user_year - 1; } if ($user_month and $user_month and $user_day) { return $user_age . ' ' . gram_record($user_age, 'user_age'); } else { return false; } } }
$myRow = $db->super_query("SELECT user_blacklist FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'"); $array_blacklist = explode('|', $myRow['user_blacklist']); if ($row['cnt'] and in_array($bad_user_id, $array_blacklist) and $user_id != $bad_user_id) { $myRow['user_blacklist'] = str_replace("|{$bad_user_id}|", "", $myRow['user_blacklist']); $db->query("UPDATE `" . PREFIX . "_users` SET user_blacklist_num = user_blacklist_num-1, user_blacklist = '{$myRow['user_blacklist']}' WHERE user_id = '{$user_id}'"); $openMyList = mozg_cache("user_{$user_id}/blacklist"); mozg_create_cache("user_{$user_id}/blacklist", str_replace("|{$bad_user_id}|", "", $openMyList)); } die; break; //################### Черный список ###################// //################### Черный список ###################// case "blacklist": $row = $db->super_query("SELECT user_blacklist, user_blacklist_num FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'"); $tpl->load_template('settings/blacklist.tpl'); $tpl->set('{cnt}', '<span id="badlistnum">' . $row['user_blacklist_num'] . '</span> ' . gram_record($row['user_blacklist_num'], 'fave')); if ($row['user_blacklist_num']) { $tpl->set('[yes-users]', ''); $tpl->set('[/yes-users]', ''); } else { $tpl->set_block("'\\[yes-users\\](.*?)\\[/yes-users\\]'si", ""); } $tpl->compile('info'); if ($row['user_blacklist_num'] and $row['user_blacklist_num'] <= 100) { $tpl->load_template('settings/baduser.tpl'); $array_blacklist = explode('|', $row['user_blacklist']); foreach ($array_blacklist as $user) { if ($user) { $infoUser = $db->super_query("SELECT user_photo, user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '{$user}'"); if ($infoUser['user_photo']) { $tpl->set('{ava}', '/uploads/users/' . $user . '/50_' . $infoUser['user_photo']);
$tpl->load_template('messages/head.tpl'); if ($user_info['user_msg_type'] == 0) { $tpl->set('{msg-type}', 'Показать в виде диалогов'); } else { $tpl->set('{msg-type}', 'Показать в виде сообщений'); } $tpl->set('{query}', $se_query); if ($search_sql) { if ($sql_) { $tpl->set('{msg-cnt}', 'Найдено <span id="all_msg_num">' . $msg_count['cnt'] . '</span> ' . gram_record($msg_count['cnt'], 'msg')); } else { $tpl->set('{msg-cnt}', 'Найденные <span id="all_msg_num">' . $msg_count['cnt'] . '</span> ' . gram_record($msg_count['cnt'], 'msg')); } } else { if ($sql_) { $tpl->set('{msg-cnt}', 'Вы получили <span id="all_msg_num">' . $msg_count['cnt'] . '</span> ' . gram_record($msg_count['cnt'], 'msg')); } else { $tpl->set('{msg-cnt}', 'Нет полученных сообщений'); } } $tpl->set('[inbox]', ''); $tpl->set('[/inbox]', ''); $tpl->set_block("'\\[outbox\\](.*?)\\[/outbox\\]'si", ""); $tpl->set_block("'\\[review\\](.*?)\\[/review\\]'si", ""); $tpl->compile('info'); //Если есть сообщения то продолжаем, если нет, то выводи информацию if ($sql_) { $tpl->load_template('messages/message.tpl'); foreach ($sql_ as $row) { if ($row['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row['from_user_id'] . '/50_' . $row['user_photo']);
$tpl->set('[/no-status]', ''); } $tpl->set('{web}', $row['web']); if ($row['web']) { $tpl->set('[web]', ''); $tpl->set('[/web]', ''); } else { $tpl->set_block("'\\[web\\](.*?)\\[/web\\]'si", ""); } //Видеозаписи if ($row['videos_num']) { $sql_videos = $db->super_query("SELECT id, title, photo, add_date, comm_num, owner_user_id, public_id FROM `" . PREFIX . "_videos` WHERE public_id = '{$row['id']}' ORDER by `add_date` DESC LIMIT 0, 2", 1, "groups/video{$row['id']}"); foreach ($sql_videos as $row_video) { $row_video['title'] = stripslashes($row_video['title']); $date_video = megaDateNoTpl(strtotime($row_video['add_date'])); $comm_num = $row_video['comm_num'] . ' ' . gram_record($row_video['comm_num'], 'comments'); $videos .= "\r\n<div class=\"profile_one_video\"><a href=\"/video-{$row_video['public_id']}_{$row_video['id']}\" onClick=\"videos.show({$row_video['id']}, this.href, '/{$row['adres']}'); return false\"><img src=\"{$row_video['photo']}\" alt=\"\" width=\"185\" /></a><div class=\"video_profile_title\"><a href=\"/video-{$row_video['public_id']}_{$row_video['id']}\" onClick=\"videos.show({$row_video['id']}, this.href, '/{$row['adres']}'); return false\">{$row_video['title']}</a></div><div class=\"nesubscriptstatus\">{$date_video} - <a href=\"/video-{$row_video['public_id']}_{$row_video['id']}\" onClick=\"videos.show({$row_video['id']}, this.href, '/{$row['adres']}'); return false\">{$comm_num}</a></div></div>\r\n\t\t\t\t"; } $tpl->set('{videos}', $videos); $tpl->set('{videos-num}', $row['videos_num']); $tpl->set('[videos]', ''); $tpl->set('[/videos]', ''); $tpl->set('[yesvideo]', ''); $tpl->set('[/yesvideo]', ''); $tpl->set_block("'\\[novideo\\](.*?)\\[/novideo\\]'si", ""); } else { $tpl->set('{videos}', ''); $tpl->set('[novideo]', ''); $tpl->set('[/novideo]', ''); $tpl->set_block("'\\[yesvideo\\](.*?)\\[/yesvideo\\]'si", ""); if ($public_admin) {
$tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile('content'); //Если есть комменты, то выводим и страница не "ответы" if ($rowInfoUser['comments']) { //Помещаем все комменты в id wall_fast_block_{id} это для JS $tpl->result['content'] .= '<div id="wall_fast_block_' . $row['obj_id'] . '">'; if ($rec_info_groups['fasts_num']) { if ($rec_info_groups['fasts_num'] > 3) { $comments_limit = $rec_info_groups['fasts_num'] - 3; } else { $comments_limit = 0; } $sql_comments = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, public_id, text, add_date, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.public_id = tb2.user_id AND tb1.fast_comm_id = '{$row['obj_id']}' ORDER by `add_date` ASC LIMIT {$comments_limit}, 3", 1); //Загружаем кнопку "Показать N запсии" $tpl->set('{gram-record-all-comm}', gram_record($rec_info_groups['fasts_num'] - 3, 'prev') . ' ' . ($rec_info_groups['fasts_num'] - 3) . ' ' . gram_record($rec_info_groups['fasts_num'] - 3, 'comments')); if ($rec_info_groups['fasts_num'] < 4) { $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); } else { $tpl->set('{rec-id}', $row['obj_id']); $tpl->set('[all-comm]', ''); $tpl->set('[/all-comm]', ''); } $tpl->set('{author-id}', $row['ac_user_id']); $tpl->set('[groups]', ''); $tpl->set('[/groups]', ''); $tpl->set_block("'\\[wall-func\\](.*?)\\[/wall-func\\]'si", ""); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->compile('content');
} $tpl->set('{mobile-speedbar}', $speedbar); $tpl->set('{my-name}', $user_info['user_search_pref']); $tpl->set('{my-ava}', $ava); } //################### Подарки ###################// $gifts = $user_info['all_liked_users']; if ($row['user_gifts']) { $sql_gifts = $db->super_query("SELECT gift FROM `" . PREFIX . "_gifts` WHERE uid = '{$id}' ORDER by `gdate` DESC LIMIT 3, 3", 1, "user_{$id}/gifts"); foreach ($sql_gifts as $row_gift) { $gifts .= "<div class=\"left_gift\"><div class=\"body\"><center><a href=\"/gifts{$id}\" onClick=\"Page.Go(this.href); return false\">Новый подарок</a></center><div class=\"more_div\"></div><a href=\"/gifts{$id}\" onClick=\"Page.Go(this.href); return false\"><img src=\"/uploads/gifts/{$row_gift['gift']}.png\" /></a></div></div>"; } $tpl->set('[new-gifts]', ''); $tpl->set('[/new-gifts]', ''); $tpl->set('{new-gifts}', $gifts); $tpl->set('{gifts-text}', $row['user_gifts'] . ' ' . gram_record($row['user_gifts'], 'gifts')); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); } else { $tpl->set_block("'\\[new-gifts\\](.*?)\\[/new-gifts\\]'si", ""); } if ($user_info['user_id'] == $row['user_id']) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); } else { $tpl->set('[not-owner]', ''); $tpl->set('[/not-owner]', ''); $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } //?????? ? ?????? $user_friends_demands = $user_info['user_friends_demands'];
} //#################### Вывод новых игр ###################### foreach ($sql_ as $row) { if ($row['img'] == '') { $img = '/uploads/apps/no.gif'; } else { $img = '/uploads/apps/' . $row['id'] . '/100_' . $row['img']; } $db->query("SELECT * FROM `" . PREFIX . "_apps_users` WHERE user_id = '{$user_id}' and application_id = '{$row['id']}'"); if (!$db->num_rows()) { $tpl->set('{link}', '<a href="/apps?i=' . $row['id'] . '" onClick="apps.view(' . $row['id'] . ', this.href, "/apps"); return false">'); } else { $tpl->set('{link}', '<a href="/app' . $row['id'] . '" onClick="Page.Go(this.href); return false;">'); } $num = $row['cols']; $tpl->set('{nums}', $num . ' ' . gram_record($num, 'apps')); $tpl->set('{title}', $row['title']); $tpl->set('{id}', $row['id']); $tpl->set('{ava}', $img); $tpl->compile('newapplication'); } $tpl->load_template('apps/content.tpl'); $tpl->set('{slider}', $tpl->result['slider']); $tpl->set('{my_application}', $tpl->result['my_application']); $tpl->set('{friends_application}', $tpl->result['friends_application']); $tpl->set('{popular_application}', $tpl->result['popular_application']); $tpl->set('{newapplication}', $tpl->result['newapplication']); $tpl->compile('content'); } $db->free(); $tpl->clear();
$ava = $row['photo']; $img_width = 100; $row['user_search_pref'] = $row['title']; $countr = 'Добавлено ' . megaDateNoTpl(strtotime($row['add_date']), 1, 1); $row['user_id'] = 'video' . $row['owner_user_id'] . '_' . $row['id'] . '" onClick="videos.show(' . $row['id'] . ', this.href, location.href); return false'; //Если критерий поиск "по сообществам" } else { if ($type == 4) { if ($row['photo']) { $ava = '/uploads/groups/' . $row['id'] . '/50_' . $row['photo']; } else { $ava = '/templates/' . $config['temp'] . '/images/no_ava_50.png'; } $img_width = 50; $row['user_search_pref'] = $row['title']; $countr = $row['traf'] . ' ' . gram_record($row['traf'], 'groups_users'); if ($row['adres']) { $row['user_id'] = $row['adres']; } else { $row['user_id'] = 'public' . $row['id']; } //Если критерий поиск "по людям" } else { //АВА if ($row['user_photo']) { $ava = '/uploads/users/' . $row['user_id'] . '/50_' . $row['user_photo']; } else { $ava = '/templates/' . $config['temp'] . '/images/no_ava_50.png'; } //Страна город $expCountry = explode('|', $row['user_country_city_name']);
//################### Показ всех подпискок юзера ###################// if ($_POST['page'] > 0) { $page = intval($_POST['page']); } else { $page = 1; } $gcount = 24; $limit_page = ($page - 1) * $gcount; $for_user_id = intval($_POST['for_user_id']); $subscr_num = intval($_POST['subscr_num']); $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.friend_id, tb2.user_search_pref, user_photo, user_country_city_name, user_status FROM `" . PREFIX . "_friends` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.user_id = '{$for_user_id}' AND tb1.friend_id = tb2.user_id AND tb1.subscriptions = 1 ORDER by `friends_date` DESC LIMIT {$limit_page}, {$gcount}", 1); if ($sql_) { $tpl->load_template('profile_subscription_box_top.tpl'); $tpl->set('[top]', ''); $tpl->set('[/top]', ''); $tpl->set('{subcr-num}', $subscr_num . ' ' . gram_record($subscr_num, 'subscr')); $tpl->set_block("'\\[bottom\\](.*?)\\[/bottom\\]'si", ""); $tpl->compile('content'); $tpl->load_template('profile_friends.tpl'); foreach ($sql_ as $row) { if ($row['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row['friend_id'] . '/50_' . $row['user_photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } $friend_info_online = explode(' ', $row['user_search_pref']); $tpl->set('{user-id}', $row['friend_id']); $tpl->set('{name}', $friend_info_online[0]); $tpl->set('{last-name}', $friend_info_online[1]); $tpl->compile('content'); }
} box_navigation($gcount, $count['cnt'], "''", 'sp.openfriends', ''); } else { msgbox('', '<div class="clear" style="margin-top:140px"></div>' . $lang['no_requests'], 'info_2'); } } else { msgbox('', '<div class="clear" style="margin-top:140px"></div>' . $lang['no_requests'], 'info_2'); } AjaxTpl(); die; break; default: //################### Страница заявок в друзья ###################// $user_id = $user_info['user_id']; if ($user_info['user_friends_demands']) { $user_speedbar = $user_info['user_friends_demands'] . ' ' . gram_record($user_info['user_friends_demands'], 'friends_demands'); } else { $user_speedbar = $lang['no_requests']; } //Выводим заявки в друзья если они есть if ($user_info['user_friends_demands']) { $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.from_user_id, demand_date, tb2.user_photo, user_search_pref, user_country_city_name, user_birthday FROM `" . PREFIX . "_friends_demands` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.for_user_id = '{$user_id}' AND tb1.from_user_id = tb2.user_id ORDER by `demand_date` DESC LIMIT {$limit_page}, {$gcount}", 1); $tpl->load_template('friends/ajaxrequest.tpl'); foreach ($sql_ as $row) { $user_country_city_name = explode('|', $row['user_country_city_name']); $tpl->set('{country}', $user_country_city_name[0]); $tpl->set('{city}', ', ' . $user_country_city_name[1]); $tpl->set('{user-id}', $row['from_user_id']); $tpl->set('{name}', $row['user_search_pref']); if ($row['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row['from_user_id'] . '/100_' . $row['user_photo']);
$sql_where = "ORDER by `sfor_user_id` DESC"; $sql_where_cnt = ""; } else { $sql_where = "AND tb1.suser_id = '{$user_id}' ORDER by `sdate` DESC"; $sql_where_cnt = "WHERE suser_id = '{$user_id}'"; } $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, title, suser_id, sfor_user_id, sdate, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_support` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.suser_id = tb2.user_id {$sql_where} LIMIT {$limit_page}, {$gcount}", 1); if ($sql_) { $count = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_support` {$sql_where_cnt}"); } $tpl->load_template('support/head.tpl'); if ($sql_) { if ($user_info['user_group'] == 4) { $tpl->set('{cnt}', $count['cnt'] . ' ' . gram_record($count['cnt'], 'questions')); } else { $tpl->set('{cnt}', 'Вы задали ' . $count['cnt'] . ' ' . gram_record($count['cnt'], 'questions')); } } else { $tpl->set('{cnt}', ''); } $tpl->compile('info'); if ($sql_) { $tpl->load_template('support/question.tpl'); foreach ($sql_ as $row) { $tpl->set('{title}', stripslashes($row['title'])); megaDate($row['sdate']); if ($row['sfor_user_id'] == $row['suser_id'] or $user_info['user_group'] == 4) { if ($row['sfor_user_id'] == $row['suser_id']) { $tpl->set('{status}', 'Вопрос ожидает обработки.'); } else { $tpl->set('{status}', 'Есть ответ.');
} $groups .= '<div class="onesubscription onesubscriptio2n cursor_pointer" onClick="Page.Go(\'/' . $adres . '\')"><a href="/' . $adres . '" onClick="Page.Go(this.href); return false"><img src="' . $ava_groups . '" /></a><div class="onesubscriptiontitle"><a href="/' . $adres . '" onClick="Page.Go(this.href); return false">' . stripslashes($row_groups['title']) . '</a></div></div>'; } $tpl->set('[groups]', ''); $tpl->set('[/groups]', ''); $tpl->set('{groups}', $groups); $tpl->set('{groups-num}', $row['user_public_num']); } else { $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", ""); } //################### Музыка ###################// if ($row['user_audio'] and $config['audio_mod'] == 'yes') { $tpl->set('[audios]', ''); $tpl->set('[/audios]', ''); $tpl->set('{audios}', $tpl->result['audios']); $tpl->set('{audios-num}', $row['user_audio'] . ' ' . gram_record($row['user_audio'], 'audio')); } else { $tpl->set_block("'\\[audios\\](.*?)\\[/audios\\]'si", ""); } //################### Праздники друзей ###################// if ($cnt_happfr) { $tpl->set('{happy-friends}', $tpl->result['happy_all_friends']); $tpl->set('{happy-friends-num}', $cnt_happfr); $tpl->set('[happy-friends]', ''); $tpl->set('[/happy-friends]', ''); } else { $tpl->set_block("'\\[happy-friends\\](.*?)\\[/happy-friends\\]'si", ""); } //################### Обработка дополнительных полей ###################// $xfieldsdata = xfieldsdataload($row['xfields']); $xfields = profileload();
} $tpl->set('{aid}', $row['aid']); $tpl->set('{hash}', $row['ahash']); $tpl->compile('content'); } else { $m_cnt--; } } //Конец ID для DragNDrop jQuery $tpl->result['content'] .= '</div></ul>'; $row_owner['user_albums_num'] = $m_cnt; if ($row_owner['user_albums_num']) { if ($user_info['user_id'] == $uid) { $user_speedbar = 'У Вас <span id="albums_num">' . $row_owner['user_albums_num'] . '</span> ' . gram_record($row_owner['user_albums_num'], 'albums'); } else { $user_speedbar = 'У ' . gramatikName($author_info[0]) . ' ' . $row_owner['user_albums_num'] . ' ' . gram_record($row_owner['user_albums_num'], 'albums'); } $tpl->load_template('albums_top.tpl'); $tpl->set('{user-id}', $uid); $tpl->set('{name}', gramatikName($author_info[0])); $tpl->set('[all-albums]', ''); $tpl->set('[/all-albums]', ''); $tpl->set_block("'\\[view\\](.*?)\\[/view\\]'si", ""); $tpl->set_block("'\\[comments\\](.*?)\\[/comments\\]'si", ""); $tpl->set_block("'\\[editphotos\\](.*?)\\[/editphotos\\]'si", ""); $tpl->set_block("'\\[albums-comments\\](.*?)\\[/albums-comments\\]'si", ""); $tpl->set_block("'\\[all-photos\\](.*?)\\[/all-photos\\]'si", ""); //Показ скрытых тексто только для владельца страницы if ($user_info['user_id'] == $uid) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', '');
} else { $page_cnt = 0; } //Если страница вывзана через "Показать больше аудиозаписей" if ($page_cnt) { NoAjaxQuery(); } $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS aid, url, artist, name FROM `" . PREFIX . "_audio` WHERE auser_id = '" . $get_user_id . "' ORDER by `adate` DESC LIMIT {$page_cnt}, {$limit_select}", 1); if ($sql_) { if (!$page_cnt) { $tpl->load_template('audio/head.tpl'); if ($user_id != $get_user_id) { $user = $db->super_query("SELECT user_name FROM `" . PREFIX . "_users` WHERE user_id = '" . $get_user_id . "'"); } $tpl->set('{name}', gramatikName($user['user_name'])); $tpl->set('{num}', $user['user_audio'] . ' ' . gram_record($user['user_audio'], 'audio')); $tpl->set('{uid}', $get_user_id); if ($get_user_id == $user_id) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); } else { $tpl->set('[not-owner]', ''); $tpl->set('[/not-owner]', ''); $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } if ($config['audio_mod_add'] == 'no') { $tpl->set_block("'\\[admin-add\\](.*?)\\[/admin-add\\]'si", ""); } else { $tpl->set('[admin-add]', ''); $tpl->set('[/admin-add]', '');
function select($public_admin, $server_time) { global $tpl, $db, $user_info, $pid; $user_id = $user_info['user_id']; $this->template; foreach ($this->query as $row_wall) { $tpl->set('{rec-id}', $row_wall['id']); //КНопка Показать полностью.. $expBR = explode('<br />', $row_wall['text']); $textLength = count($expBR); $strTXT = strlen($row_wall['text']); if ($textLength > 9 or $strTXT > 600) { $row_wall['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_wall['id'] . '">' . $row_wall['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_wall['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_wall['id'] . '">Показать полностью..</div>'; } //Прикрипленные файлы if ($row_wall['attach']) { $attach_arr = explode('||', $row_wall['attach']); $cnt_attach = 1; $cnt_attach_link = 1; $jid = 0; $attach_result = ''; foreach ($attach_arr as $attach_file) { $attach_type = explode('|', $attach_file); //Фото со стены сообщества if ($row_wall['tell_uid']) { $globParId = $row_wall['tell_uid']; } else { $globParId = $row_wall['public_id']; } if ($attach_type[0] == 'photo' and file_exists(ROOT_DIR . "/uploads/groups/{$globParId}/photos/c_{$attach_type[1]}")) { if ($cnt_attach < 2) { $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$globParId}', '{$attach_type[1]}', '{$cnt_attach}')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/groups/{$globParId}/photos/{$attach_type[1]}\" align=\"left\" /></div>"; } else { $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/groups/{$globParId}/photos/c_{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$globParId}', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />"; } $cnt_attach++; $resLinkTitle = ''; //Фото со стены юзера } elseif ($attach_type[0] == 'photo_u') { $attauthor_user_id = $row_wall['tell_uid']; if ($attach_type[1] == 'attach' and file_exists(ROOT_DIR . "/uploads/attach/{$attauthor_user_id}/c_{$attach_type[2]}")) { if ($cnt_attach < 2) { $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$attauthor_user_id}', '{$attach_type[1]}', '{$cnt_attach}', 'photo_u')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/attach/{$attauthor_user_id}/{$attach_type[2]}\" align=\"left\" /></div>"; } else { $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/attach/{$attauthor_user_id}/c_{$attach_type[2]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />"; } $cnt_attach++; } elseif (file_exists(ROOT_DIR . "/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/c_{$attach_type[1]}")) { if ($cnt_attach < 2) { $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$attauthor_user_id}', '{$attach_type[1]}', '{$cnt_attach}', 'photo_u')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/{$attach_type[1]}\" align=\"left\" /></div>"; } else { $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/c_{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$row_wall['tell_uid']}', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />"; } $cnt_attach++; } $resLinkTitle = ''; //Видео } elseif ($attach_type[0] == 'video' and file_exists(ROOT_DIR . "/uploads/videos/{$attach_type[3]}/{$attach_type[1]}")) { $attach_result .= "<div align=\"left\" style=\"margin-top:0px;margin-right:3px\"><a href=\"/video{$attach_type[3]}_{$attach_type[2]}\" onClick=\"videos.show({$attach_type[2]}, this.href, location.href); return false\"><img src=\"/uploads/videos/{$attach_type[3]}/{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" /></a></div>"; $resLinkTitle = ''; //Музыка } elseif ($attach_type[0] == 'audio') { $audioId = intval($attach_type[1]); $audioInfo = $db->super_query("SELECT artist, name, url FROM `" . PREFIX . "_audio` WHERE aid = '" . $audioId . "'"); if ($audioInfo) { $jid++; $attach_result .= '<div class="audioForSize' . $row_wall['id'] . '" id="audioForSize"><div class="audio_onetrack audio_wall_onemus"><div class="audio_playic cursor_pointer fl_l" onClick="music.newStartPlay(\'' . $jid . '\', ' . $row_wall['id'] . ')" id="icPlay_' . $row_wall['id'] . $jid . '"></div><div id="music_' . $row_wall['id'] . $jid . '" data="' . $audioInfo['url'] . '" class="fl_l" style="margin-top:-1px"><a href="/?go=search&type=5&query=' . $audioInfo['artist'] . '&n=1" onClick="Page.Go(this.href); return false"><b>' . stripslashes($audioInfo['artist']) . '</b></a> – ' . stripslashes($audioInfo['name']) . '</div><div id="play_time' . $row_wall['id'] . $jid . '" class="color777 fl_r no_display" style="margin-top:2px;margin-right:5px">00:00</div><div class="player_mini_mbar fl_l no_display player_mini_mbar_wall" id="ppbarPro' . $row_wall['id'] . $jid . '"></div></div></div>'; } $resLinkTitle = ''; //Смайлик } elseif ($attach_type[0] == 'smile' and file_exists(ROOT_DIR . "/uploads/smiles/{$attach_type[1]}")) { $attach_result .= '<img src=\\"/uploads/smiles/' . $attach_type[1] . '\\" style="margin-right:5px" />'; $resLinkTitle = ''; //Если ссылка } elseif ($attach_type[0] == 'link' and preg_match('/http:\\/\\/(.*?)+$/i', $attach_type[1]) and $cnt_attach_link == 1) { $count_num = count($attach_type); $domain_url_name = explode('/', $attach_type[1]); $rdomain_url_name = str_replace('http://', '', $domain_url_name[2]); $attach_type[3] = stripslashes($attach_type[3]); $attach_type[3] = substr($attach_type[3], 0, 200); $attach_type[2] = stripslashes($attach_type[2]); $str_title = substr($attach_type[2], 0, 55); if (stripos($attach_type[4], '/uploads/attach/') === false) { $attach_type[4] = '{theme}/images/no_ava_groups_100.gif'; $no_img = false; } else { $no_img = true; } if (!$attach_type[3]) { $attach_type[3] = ''; } if ($no_img and $attach_type[2]) { if ($row_wall['tell_comm']) { $no_border_link = 'border:0px'; } $attach_result .= '<div style="margin-top:2px" class="clear"><div class="attach_link_block_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Ссылка: <a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $rdomain_url_name . '</a></div></div><div class="clear"></div><div class="wall_show_block_link" style="' . $no_border_link . '"><a href="/away.php?url=' . $attach_type[1] . '" target="_blank"><div style="width:108px;height:80px;float:left;text-align:center"><img src="' . $attach_type[4] . '" /></div></a><div class="attatch_link_title"><a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $str_title . '</a></div><div style="max-height:50px;overflow:hidden">' . $attach_type[3] . '</div></div></div>'; $resLinkTitle = $attach_type[2]; $resLinkUrl = $attach_type[1]; } else { if ($attach_type[1] and $attach_type[2]) { $attach_result .= '<div style="margin-top:2px" class="clear"><div class="attach_link_block_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Ссылка: <a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $rdomain_url_name . '</a></div></div></div><div class="clear"></div>'; $resLinkTitle = $attach_type[2]; $resLinkUrl = $attach_type[1]; } } $cnt_attach_link++; //Если документ } elseif ($attach_type[0] == 'doc') { $doc_id = intval($attach_type[1]); $row_doc = $db->super_query("SELECT dname, dsize FROM `" . PREFIX . "_doc` WHERE did = '{$doc_id}'"); if ($row_doc) { $attach_result .= '<div style="margin-top:5px;margin-bottom:5px" class="clear"><div class="doc_attach_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Файл <a href="/index.php?go=doc&act=download&did=' . $doc_id . '" target="_blank" onMouseOver="myhtml.title(\'' . $doc_id . $cnt_attach . $row_wall['id'] . '\', \'<b>Размер файла: ' . $row_doc['dsize'] . '</b>\', \'doc_\')" id="doc_' . $doc_id . $cnt_attach . $row_wall['id'] . '">' . $row_doc['dname'] . '</a></div></div></div><div class="clear"></div>'; $cnt_attach++; } //Если опрос } elseif ($attach_type[0] == 'vote') { $vote_id = intval($attach_type[1]); $row_vote = $db->super_query("SELECT title, answers, answer_num FROM `" . PREFIX . "_votes` WHERE id = '{$vote_id}'", false, "votes/vote_{$vote_id}"); if ($vote_id) { $checkMyVote = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE user_id = '{$user_id}' AND vote_id = '{$vote_id}'", false, "votes/check{$user_id}_{$vote_id}"); $row_vote['title'] = stripslashes($row_vote['title']); if (!$row_wall['text']) { $row_wall['text'] = $row_vote['title']; } $arr_answe_list = explode('|', stripslashes($row_vote['answers'])); $max = $row_vote['answer_num']; $sql_answer = $db->super_query("SELECT answer, COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE vote_id = '{$vote_id}' GROUP BY answer", 1, "votes/vote_answer_cnt_{$vote_id}"); $answer = array(); foreach ($sql_answer as $row_answer) { $answer[$row_answer['answer']]['cnt'] = $row_answer['cnt']; } $attach_result .= "<div class=\"clear\" style=\"height:10px\"></div><div id=\"result_vote_block{$vote_id}\"><div class=\"wall_vote_title\">{$row_vote['title']}</div>"; for ($ai = 0; $ai < sizeof($arr_answe_list); $ai++) { if (!$checkMyVote['cnt']) { $attach_result .= "<div class=\"wall_vote_oneanswe\" onClick=\"Votes.Send({$ai}, {$vote_id})\" id=\"wall_vote_oneanswe{$ai}\"><input type=\"radio\" name=\"answer\" /><span id=\"answer_load{$ai}\">{$arr_answe_list[$ai]}</span></div>"; } else { $num = $answer[$ai]['cnt']; if (!$num) { $num = 0; } if ($max != 0) { $proc = 100 * $num / $max; } else { $proc = 0; } $proc = round($proc, 2); $attach_result .= "<div class=\"wall_vote_oneanswe cursor_default\">\r\n\t\t\t\t\t\t\t\t\t{$arr_answe_list[$ai]}<br />\r\n\t\t\t\t\t\t\t\t\t<div class=\"wall_vote_proc fl_l\"><div class=\"wall_vote_proc_bg\" style=\"width:" . intval($proc) . "%\"></div><div style=\"margin-top:-16px\">{$num}</div></div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"fl_l\" style=\"margin-top:-1px\"><b>{$proc}%</b></div>\r\n\t\t\t\t\t\t\t\t\t</div><div class=\"clear\"></div>"; } } if ($row_vote['answer_num']) { $answer_num_text = gram_record($row_vote['answer_num'], 'fave'); } else { $answer_num_text = 'человек'; } if ($row_vote['answer_num'] <= 1) { $answer_text2 = 'Проголосовал'; } else { $answer_text2 = 'Проголосовало'; } $attach_result .= "{$answer_text2} <b>{$row_vote['answer_num']}</b> {$answer_num_text}.<div class=\"clear\" style=\"margin-top:10px\"></div></div>"; } } else { $attach_result .= ''; } } if ($resLinkTitle and $row_wall['text'] == $resLinkUrl or !$row_wall['text']) { $row_wall['text'] = $resLinkTitle . $attach_result; } else { if ($attach_result) { $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']) . $attach_result; } else { $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']); } } } else { $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']); } $resLinkTitle = ''; //Если это запись с "рассказать друзьям" if ($row_wall['tell_uid']) { if ($row_wall['public']) { $rowUserTell = $db->super_query("SELECT title, photo FROM `" . PREFIX . "_communities` WHERE id = '{$row_wall['tell_uid']}'"); } else { $rowUserTell = $db->super_query("SELECT user_search_pref, user_photo FROM `" . PREFIX . "_users` WHERE user_id = '{$row_wall['tell_uid']}'"); } if (date('Y-m-d', $row_wall['tell_date']) == date('Y-m-d', $server_time)) { $dateTell = langdate('сегодня в H:i', $row_wall['tell_date']); } elseif (date('Y-m-d', $row_wall['tell_date']) == date('Y-m-d', $server_time - 84600)) { $dateTell = langdate('вчера в H:i', $row_wall['tell_date']); } else { $dateTell = langdate('j F Y в H:i', $row_wall['tell_date']); } if ($row_wall['public']) { $rowUserTell['user_search_pref'] = stripslashes($rowUserTell['title']); $tell_link = 'public'; if ($rowUserTell['photo']) { $avaTell = '/uploads/groups/' . $row_wall['tell_uid'] . '/50_' . $rowUserTell['photo']; } else { $avaTell = '{theme}/images/no_ava_50.png'; } } else { $tell_link = 'u'; if ($rowUserTell['user_photo']) { $avaTell = '/uploads/users/' . $row_wall['tell_uid'] . '/50_' . $rowUserTell['user_photo']; } else { $avaTell = '{theme}/images/no_ava_50.png'; } } if ($row_wall['tell_comm']) { $border_tell_class = 'wall_repost_border'; } else { $border_tell_class = 'wall_repost_border2'; } $row_wall['text'] = <<<HTML {$row_wall['tell_comm']} <div class="{$border_tell_class}"> <div class="wall_tell_info"><div class="wall_tell_ava"><a href="/{$tell_link}{$row_wall['tell_uid']}" onClick="Page.Go(this.href); return false"><img src="{$avaTell}" width="30" /></a></div><div class="wall_tell_name"><a href="/{$tell_link}{$row_wall['tell_uid']}" onClick="Page.Go(this.href); return false"><b>{$rowUserTell['user_search_pref']}</b></a></div><div class="wall_tell_date">{$dateTell}</div></div>{$row_wall['text']} <div class="clear"></div> </div> HTML; } $tpl->set('{text}', stripslashes($row_wall['text'])); $tpl->set('{name}', $row_wall['title']); $tpl->set('{user-id}', $row_wall['public_id']); if ($row_wall['adres']) { $tpl->set('{adres-id}', $row_wall['adres']); } else { $tpl->set('{adres-id}', 'public' . $row_wall['public_id']); } megaDate($row_wall['add_date']); if ($row_wall['photo']) { $tpl->set('{ava}', '/uploads/groups/' . $row_wall['public_id'] . '/50_' . $row_wall['photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } //Мне нравится if (stripos($row_wall['likes_users'], "u{$user_id}|") !== false) { $tpl->set('{yes-like}', 'public_wall_like_yes'); $tpl->set('{yes-like-color}', 'public_wall_like_yes_color'); $tpl->set('{like-js-function}', 'groups.wall_remove_like(' . $row_wall['id'] . ', ' . $user_id . ')'); } else { $tpl->set('{yes-like}', ''); $tpl->set('{yes-like-color}', ''); $tpl->set('{like-js-function}', 'groups.wall_add_like(' . $row_wall['id'] . ', ' . $user_id . ')'); } if ($row_wall['likes_num']) { $tpl->set('{likes}', $row_wall['likes_num']); $tpl->set('{likes-text}', '<span id="like_text_num' . $row_wall['id'] . '">' . $row_wall['likes_num'] . '</span> ' . gram_record($row_wall['likes_num'], 'like')); } else { $tpl->set('{likes}', ''); $tpl->set('{likes-text}', '<span id="like_text_num' . $row_wall['id'] . '">0</span> человеку'); } //Выводим информцию о том кто смотрит страницу для себя $tpl->set('{viewer-id}', $user_id); if ($user_info['user_photo']) { $tpl->set('{viewer-ava}', '/uploads/users/' . $user_id . '/50_' . $user_info['user_photo']); } else { $tpl->set('{viewer-ava}', '{theme}/images/no_ava_50.png'); } //Админ if ($public_admin) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); } else { $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } //Если есть комменты к записи, то выполняем след. действия / Приватность if ($row_wall['fasts_num']) { $tpl->set_block("'\\[comments-link\\](.*?)\\[/comments-link\\]'si", ""); } else { $tpl->set('[comments-link]', ''); $tpl->set('[/comments-link]', ''); } //Приватность комментирования записей if ($row_wall['comments'] or $public_admin) { $tpl->set('[privacy-comment]', ''); $tpl->set('[/privacy-comment]', ''); } else { $tpl->set_block("'\\[privacy-comment\\](.*?)\\[/privacy-comment\\]'si", ""); } $tpl->set('[record]', ''); $tpl->set('[/record]', ''); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->compile); //Если есть комменты к записи, то открываем форму ответа уже в развернутом виде и выводим комменты к записи if ($row_wall['comments'] or $public_admin) { if ($row_wall['fasts_num']) { //Помещаем все комменты в id wall_fast_block_{id} это для JS $tpl->result[$this->compile] .= '<div id="wall_fast_block_' . $row_wall['id'] . '" class="public_wall_rec_comments">'; if ($row_wall['fasts_num'] > 3) { $comments_limit = $row_wall['fasts_num'] - 3; } else { $comments_limit = 0; } $sql_comments = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, public_id, text, add_date, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.public_id = tb2.user_id AND tb1.fast_comm_id = '{$row_wall['id']}' ORDER by `add_date` ASC LIMIT {$comments_limit}, 3", 1); //Загружаем кнопку "Показать N запсии" $tpl->set('{gram-record-all-comm}', gram_record($row_wall['fasts_num'] - 3, 'prev') . ' ' . ($row_wall['fasts_num'] - 3) . ' ' . gram_record($row_wall['fasts_num'] - 3, 'comments')); if ($row_wall['fasts_num'] < 4) { $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); } else { $tpl->set('{rec-id}', $row_wall['id']); $tpl->set('[all-comm]', ''); $tpl->set('[/all-comm]', ''); } $tpl->set('{public-id}', $pid); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->compile($this->compile); //Сообственно выводим комменты foreach ($sql_comments as $row_comments) { $tpl->set('{public-id}', $pid); $tpl->set('{name}', $row_comments['user_search_pref']); if ($row_comments['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comments['public_id'] . '/50_' . $row_comments['user_photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } $tpl->set('{comm-id}', $row_comments['id']); $tpl->set('{user-id}', $row_comments['public_id']); $expBR2 = explode('<br />', $row_comments['text']); $textLength2 = count($expBR2); $strTXT2 = strlen($row_comments['text']); if ($textLength2 > 6 or $strTXT2 > 470) { $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_comments['id'] . '" style="max-height:102px"">' . $row_comments['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_comments['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_comments['id'] . '">Показать полностью..</div>'; } $tpl->set('{text}', stripslashes($row_comments['text'])); megaDate($row_comments['add_date']); if ($public_admin or $user_id == $row_comments['public_id']) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); } else { $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } $tpl->set('[comment]', ''); $tpl->set('[/comment]', ''); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->compile); } //Загружаем форму ответа $tpl->set('{rec-id}', $row_wall['id']); $tpl->set('{user-id}', $row_wall['public_id']); $tpl->set('[comment-form]', ''); $tpl->set('[/comment-form]', ''); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->compile); //Закрываем блок для JS $tpl->result[$this->compile] .= '</div>'; } } } }
$page_type = '/wall' . $id . '_sec=own&page='; } else { if ($_GET['type'] == 'record') { $where_sql = "AND tb1.id = '{$rid}'"; $tpl->set('[record-tab]', ''); $tpl->set('[/record-tab]', ''); $wallAuthorId = $db->super_query("SELECT author_user_id FROM `" . PREFIX . "_wall` WHERE id = '{$rid}'"); } else { $_GET['type'] = ''; $where_sql = ''; $tpl->set_block("'\\[record-tab\\](.*?)\\[/record-tab\\]'si", ""); $page_type = '/wall' . $id . '/page/'; } } if ($cnt_rec['cnt'] > 0) { $user_speedbar = 'На стене ' . $cnt_rec['cnt'] . ' ' . gram_record($cnt_rec['cnt'], 'rec'); } $tpl->load_template('wall/head.tpl'); $tpl->set('{name}', gramatikName($row_user['user_name'])); $tpl->set('{uid}', $id); $tpl->set('{rec-id}', $rid); $tpl->set("{activetab-{$_GET['type']}}", 'activetab'); $tpl->compile('info'); if ($cnt_rec['cnt'] < 1) { msgbox('', $lang['wall_no_rec'], 'info_2'); } } else { $user_speedbar = $lang['error']; msgbox('', $lang['no_notes'], 'info'); } } else {
$max = $row_vote['answer_num']; $sql_answer = $db->super_query("SELECT answer, COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE vote_id = '{$vote_id}' GROUP BY answer", 1, "votes/vote_answer_cnt_{$vote_id}"); $answer = array(); foreach ($sql_answer as $row_answer) { $answer[$row_answer['answer']]['cnt'] = $row_answer['cnt']; } $attach_result .= "<div class=\"clear\" style=\"height:10px\"></div><div id=\"result_vote_block{$vote_id}\"><div class=\"wall_vote_title\">{$row_vote['title']}</div>"; for ($ai = 0; $ai < sizeof($arr_answe_list); $ai++) { if (!$checkMyVote['cnt']) { $attach_result .= "<div class=\"wall_vote_oneanswe\" onClick=\"Votes.Send({$ai}, {$vote_id})\" id=\"wall_vote_oneanswe{$ai}\"><input type=\"radio\" name=\"answer\" /><span id=\"answer_load{$ai}\">{$arr_answe_list[$ai]}</span></div>"; } else { $num = $answer[$ai]['cnt']; if (!$num) { $num = 0; } if ($max != 0) { $proc = 100 * $num / $max; } else { $proc = 0; } $proc = round($proc, 2); $attach_result .= "<div class=\"wall_vote_oneanswe cursor_default\">\r\r\t\t\t\t\t\t\t\t\t\t\t{$arr_answe_list[$ai]}<br />\r\r\t\t\t\t\t\t\t\t\t\t\t<div class=\"wall_vote_proc fl_l\"><div class=\"wall_vote_proc_bg\" style=\"width:" . intval($proc) . "%\"></div><div style=\"margin-top:-21px\">{$num}</div></div>\r\r\t\t\t\t\t\t\t\t\t\t\t<div class=\"fl_l\" style=\"margin: 3px 0;\"><b>{$proc}%</b></div>\r\r\t\t\t\t\t\t\t\t\t\t\t</div><div class=\"clear\"></div>"; } } if ($row_vote['answer_num']) { $answer_num_text = gram_record($row_vote['answer_num'], 'fave'); } else { $answer_num_text = 'человек'; } if ($row_vote['answer_num'] <= 1) { $answer_text2 = 'Проголосовал';
$row = $db->super_query("SELECT `user_id` FROM `" . PREFIX . "_fave` WHERE user_id = '{$user_id}' AND fave_id = '{$fave_id}'"); if ($row) { $db->query("DELETE FROM `" . PREFIX . "_fave` WHERE user_id = '{$user_id}' AND fave_id = '{$fave_id}'"); $db->query("UPDATE `" . PREFIX . "_users` SET user_fave_num = user_fave_num-1 WHERE user_id = '{$user_id}'"); } else { echo 'yes_user'; } die; break; default: //################### Вывод людей которые есть в закладках ###################// //Выводим кол-во людей в закладках $user = $db->super_query("SELECT SQL_CALC_FOUND_ROWS user_fave_num FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'"); //Если кто-то есть в заклаках то выводим if ($user['user_fave_num']) { $user_speedbar = '<span id="fave_num">' . $user['user_fave_num'] . '</span> ' . gram_record($user['user_fave_num'], 'fave'); //Загружаем поиск на странице $tpl->load_template('fave_search.tpl'); $tpl->compile('content'); //Выводи из базы $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.fave_id, tb2.user_search_pref, user_photo, user_last_visit FROM `" . PREFIX . "_fave` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.user_id = '{$user_id}' AND tb1.fave_id = tb2.user_id ORDER by `date` ASC LIMIT {$limit_page}, {$gcount}", 1); $tpl->load_template('fave.tpl'); $tpl->result['content'] .= '<table class="food_planner" id="fave_users">'; foreach ($sql_ as $row) { if ($row['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row['fave_id'] . '/100_' . $row['user_photo']); } else { $tpl->set('{ava}', '{theme}/images/100_no_ava.png'); } $tpl->set('{name}', $row['user_search_pref']); $tpl->set('{user-id}', $row['fave_id']);
$limit = 20; $page_post = intval($_POST['page']); if ($page_post > 0) { $page = $page_post * $limit; } else { $page = 0; } $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS fid, title, lastuser_id, lastdate, msg_num, status, fixed FROM `" . PREFIX . "_communities_forum` WHERE public_id = '{$public_id}' ORDER by `fixed` DESC, `lastdate` DESC, `fdate` DESC LIMIT {$page}, {$limit}", 1); if ($sql_) { $tpl->load_template('forum/theme.tpl'); foreach ($sql_ as $row) { $row_last_user = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '{$row['lastuser_id']}'"); $last_userX = explode(' ', $row_last_user['user_search_pref']); $row_last_user['user_search_pref'] = gramatikName($last_userX[0]) . ' ' . gramatikName($last_userX[1]); $tpl->set('{name}', $row_last_user['user_search_pref']); $tpl->set('{msg-num}', '<b>' . $row['msg_num'] . '</b> ' . gram_record($row['msg_num'], 'msg')); $tpl->set('{title}', stripslashes($row['title'])); $tpl->set('{fid}', $row['fid']); $tpl->set('{user-id}', $row['lastuser_id']); $tpl->set('{pid}', $public_id); //STATUS if ($row['status'] and $row['fixed']) { $tpl->set('{status}', 'тема закреплена и закрыта'); } else { if ($row['status']) { $tpl->set('{status}', 'тема закрыта'); } else { if ($row['fixed']) { $tpl->set('{status}', 'тема закреплена'); } else { $tpl->set('{status}', '');
$admin_del_href = "<a href=\"/\" onClick=\"groups.deladmin('{$row['id']}', '{$admin_id}'); return false\"><small>Удалить</small></a>"; } $adminO .= "<div class=\"public_oneadmin\" id=\"admin{$admin_id}\"><a href=\"/u{$admin_id}\" onClick=\"Page.Go(this.href); return false\"><img src=\"{$ava_admin}\" align=\"left\" width=\"32\" /></a><a href=\"/u{$admin_id}\" onClick=\"Page.Go(this.href); return false\">{$row_admin['user_search_pref']}</a><br />{$admin_del_href}</div>"; } } $tpl->set('{admins}', $adminO); } $tpl->set('{records}', $tpl->result['wall']); //Стена if ($row['rec_num'] > 10) { $tpl->set('{wall-page-display}', ''); } else { $tpl->set('{wall-page-display}', 'no_display'); } if ($row['rec_num']) { $tpl->set('{rec-num}', '<b id="rec_num">' . $row['rec_num'] . '</b> ' . gram_record($row['rec_num'], 'rec')); } else { $tpl->set('{rec-num}', '<b id="rec_num">Нет записей</b>'); if ($public_admin) { $tpl->set('{records}', '<div class="wall_none" style="border-top:0px">Новостей пока нет.</div>'); } else { $tpl->set('{records}', '<div class="wall_none">Новостей пока нет.</div>'); } } //Выводим информцию о том кто смотрит страницу для себя $tpl->set('{viewer-id}', $user_id); if (!$row['adres']) { $row['adres'] = 'public' . $row['id']; } $tpl->set('{adres}', $row['adres']); //Аудиозаписи
$tpl->set('{author-f}', $expName[1]); $tpl->set('{author-id}', $row['auser_id']); $tpl->compile('content'); } } elseif ($type == 6) { $tpl->load_template('search/result_groups.tpl'); foreach ($sql_ as $row) { if ($row['photo']) { $tpl->set('{ava}', '/uploads/groups/' . $row['id'] . '/100_' . $row['photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_groups_100.gif'); } $tpl->set('{public-id}', $row['id']); $tpl->set('{name}', stripslashes($row['title'])); $tpl->set('{note-id}', $row['id']); $tpl->set('{traf}', $row['traf'] . ' ' . gram_record($row['traf'], 'groups_users')); if ($row['adres']) { $tpl->set('{adres}', $row['adres']); } else { $tpl->set('{adres}', 'public' . $row['id']); } $tpl->compile('content'); } } else { msgbox('', $lang['search_none'], 'info_2'); } navigation($gcount, $count['cnt'], '/index.php?' . $query_string . '&page='); } else { msgbox('', '', 'info_search'); } $tpl->clear();
function comm_select() { global $tpl, $db, $config, $user_id, $id, $for_user_id, $fast_comm_id, $record_fasts_num; if ($this->comm_query) { $this->comm_template; //Помещаем все комменты в id wall_fast_block_{id} это для JS $tpl->result[$this->compile] .= '<div id="wall_fast_block_' . $fast_comm_id . '">'; //Загружаем кнопку "Показать N запсии" если их больше 3 if ($record_fasts_num > 3) { $tpl->set('{gram-record-all-comm}', gram_record($record_fasts_num - 3, 'prev') . ' ' . ($record_fasts_num - 3) . ' ' . gram_record($record_fasts_num - 3, 'comments')); $tpl->set('[all-comm]', ''); $tpl->set('[/all-comm]', ''); $tpl->set('{rec-id}', $fast_comm_id); $tpl->set('{author-id}', $for_user_id); $tpl->set('[wall-func]', ''); $tpl->set('[/wall-func]', ''); $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", ""); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->compile($this->comm_compile); } else { $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); } //Сообственно выводим комменты foreach ($this->comm_query as $row_comments) { $tpl->set('{name}', $row_comments['user_search_pref']); if ($row_comments['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comments['author_user_id'] . '/50_' . $row_comments['user_photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } $tpl->set('{comm-id}', $row_comments['id']); $tpl->set('{user-id}', $row_comments['author_user_id']); $expBR2 = explode('<br />', $row_comments['text']); $textLength2 = count($expBR2); $strTXT2 = strlen($row_comments['text']); if ($textLength2 > 6 or $strTXT2 > 470) { $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_comments['id'] . '" style="max-height:102px"">' . $row_comments['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_comments['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_comments['id'] . '">Показать полностью..</div>'; } $tpl->set('{text}', stripslashes($row_comments['text'])); megaDate($row_comments['add_date']); if (!$id) { $id = $for_user_id; } if ($user_id == $row_comments['author_user_id'] || $user_id == $id) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); } else { $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } $tpl->set('[comment]', ''); $tpl->set('[/comment]', ''); $tpl->set('[wall-func]', ''); $tpl->set('[/wall-func]', ''); $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", ""); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->comm_compile); } //Закрываем блок для JS $tpl->result[$this->compile] .= '</div>'; //Загружаем форму ответа $tpl->set('{rec-id}', $fast_comm_id); $tpl->set('{author-id}', $for_user_id); $tpl->set('[comment-form]', ''); $tpl->set('[/comment-form]', ''); $tpl->set('[wall-func]', ''); $tpl->set('[/wall-func]', ''); $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", ""); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->comm_compile); } }
$get_user_id = intval($_GET['user_id']); if (!$get_user_id) { $get_user_id = $user_info['user_id']; } //ЧС $CheckBlackList = CheckBlackList($get_user_id); if (!$CheckBlackList) { //Выводим кол-во друзей из таблицы юзеров $friends_sql = $db->super_query("SELECT user_name, user_friends_num FROM `" . PREFIX . "_users` WHERE user_id = '{$get_user_id}'"); if ($user_info['user_id'] != $get_user_id) { $gram_name = gramatikName($friends_sql['user_name']); } else { $gram_name = 'Вас'; } if ($friends_sql['user_friends_num']) { $user_speedbar = 'У ' . $gram_name . ' <span id="friend_num">' . $friends_sql['user_friends_num'] . '</span> ' . gram_record($friends_sql['user_friends_num'], 'friends'); } else { $user_speedbar = $lang['no_requests']; } //Верх $tpl->load_template('friends/head.tpl'); if ($user_info['user_id'] != $get_user_id) { $tpl->set('{name}', $gram_name); } else { $tpl->set('{name}', ''); } $tpl->set('{user-id}', $get_user_id); if ($get_user_id == $user_info['user_id']) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", "");
$gcount = 15; $limit_page = ($page - 1) * $gcount; $owner = $db->super_query("SELECT user_name, user_gifts FROM `" . PREFIX . "_users` WHERE user_id = '{$uid}'"); $tpl->load_template('gifts/head.tpl'); $tpl->set('{uid}', $uid); if ($user_id == $uid) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); } else { $tpl->set('[not-owner]', ''); $tpl->set('[/not-owner]', ''); $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } $tpl->set('{name}', gramatikName($owner['user_name'])); $tpl->set('{gifts-num}', '<span id="num">' . $owner['user_gifts'] . '</span> ' . gram_record($owner['user_gifts'], 'gifts')); if ($owner['user_gifts']) { $tpl->set('[yes]', ''); $tpl->set('[/yes]', ''); $tpl->set_block("'\\[no\\](.*?)\\[/no\\]'si", ""); } else { $tpl->set('[no]', ''); $tpl->set('[/no]', ''); $tpl->set_block("'\\[yes\\](.*?)\\[/yes\\]'si", ""); } if ($_GET['new'] and $user_id == $uid) { $tpl->set('[new]', ''); $tpl->set('[/new]', ''); $tpl->set_block("'\\[no-new\\](.*?)\\[/no-new\\]'si", ""); $sql_where = "AND status = 1"; $gcount = 50;