本文整理汇总了PHP中functions::is_friend方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::is_friend方法的具体用法?PHP functions::is_friend怎么用?PHP functions::is_friend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类functions
的用法示例。
在下文中一共展示了functions::is_friend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
exit;
} elseif ($album['access'] == 2 && $user['id'] != $user_id && $rights < 6) {
// Доступ через пароль
if (isset($_POST['password'])) {
if ($album['password'] == trim($_POST['password'])) {
$_SESSION['ap'] = $album['password'];
} else {
echo functions::display_error($lng['error_wrong_password']);
}
}
if (!isset($_SESSION['ap']) || $_SESSION['ap'] != $album['password']) {
echo '<form action="album.php?act=show&al=' . $al . '&user=' . $user['id'] . '" method="post"><div class="menu"><p>' . $lng_profile['album_password'] . '<br />' . '<input type="text" name="password"/></p>' . '<p><input type="submit" name="submit" value="' . $lng['login'] . '"/></p>' . '</div></form>' . '<div class="phdr"><a href="album.php?act=list&user=' . $user['id'] . '">' . $lng_profile['album_list'] . '</a></div>';
require '../incfiles/end.php';
exit;
}
} elseif ($album['access'] == 3 && $user['id'] != $user_id && $rights < 6 && !functions::is_friend($user['id'])) {
// Доступ только для друзей
echo functions::display_error($lng_profile['friends_only'], '<a href="album.php?act=list&user=' . $user['id'] . '">' . $lng_profile['album_list'] . '</a>');
require '../incfiles/end.php';
exit;
}
/*
-----------------------------------------------------------------
Просмотр альбома и фотографий
-----------------------------------------------------------------
*/
if ($view) {
$kmess = 1;
$start = isset($_REQUEST['page']) ? $page - 1 : mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `album_id` = '{$al}' AND `id` > '{$img}'"), 0);
// Обрабатываем ссылку для возврата
if (empty($_SESSION['ref'])) {
示例2: mysql_result
echo '</div></td></tr></table></div>';
}
// Меню выбора
$total_photo = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `user_id` = '" . $user['id'] . "'"), 0);
echo '<div class="list2"><p>' . '<div><img src="../images/contacts.png" width="16" height="16"/> <a href="profile.php?act=info&user=' . $user['id'] . '">' . $lng['information'] . '</a></div>' . '<div><img src="../images/activity.gif" width="16" height="16"/> <a href="profile.php?act=activity&user=' . $user['id'] . '">' . $lng_profile['activity'] . '</a></div>' . '<div><img src="../images/rate.gif" width="16" height="16"/> <a href="profile.php?act=stat&user=' . $user['id'] . '">' . $lng['statistics'] . '</a></div>';
$bancount = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_ban_users` WHERE `user_id` = '" . $user['id'] . "'"), 0);
if ($bancount) {
echo '<div><img src="../images/block.gif" width="16" height="16"/> <a href="profile.php?act=ban&user=' . $user['id'] . '">' . $lng['infringements'] . '</a> (' . $bancount . ')</div>';
}
$total_friends = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact` WHERE `user_id`='{$user['id']}' AND `type`='2' AND `friends`='1'"), 0);
echo '<br />' . '<div><img src="../images/photo.gif" width="16" height="16"/> <a href="album.php?act=list&user=' . $user['id'] . '">' . $lng['photo_album'] . '</a> (' . $total_photo . ')</div>' . '<div><img src="../images/guestbook.gif" width="16" height="16"/> <a href="profile.php?act=guestbook&user=' . $user['id'] . '">' . $lng['guestbook'] . '</a> (' . $user['comm_count'] . ')</div>' . '<div><img src="../images/users.png" width="16" height="16"/> <a href="profile.php?act=friends&user=' . $user['id'] . '">' . $lng_profile['friends'] . '</a> (' . $total_friends . ')</div>' . '</p></div>';
if ($user['id'] != $user_id) {
echo '<div class="menu"><p>';
// Контакты
if (!functions::is_ignor($user['id']) && functions::is_contact($user['id']) != 2) {
if (!functions::is_friend($user['id'])) {
$fr_in = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact` WHERE `type`='2' AND `from_id`='{$user_id}' AND `user_id`='{$user['id']}'"), 0);
$fr_out = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact` WHERE `type`='2' AND `user_id`='{$user_id}' AND `from_id`='{$user['id']}'"), 0);
if ($fr_in == 1) {
$friend = '<a class="underline" href="profile.php?act=friends&do=ok&id=' . $user['id'] . '">' . $lng_profile['confirm_friendship'] . '</a> | <a class="underline" href="profile.php?act=friends&do=no&id=' . $user['id'] . '">' . $lng_profile['decline_friendship'] . '</a>';
} else {
if ($fr_out == 1) {
$friend = '<a class="underline" href="profile.php?act=friends&do=cancel&id=' . $user['id'] . '">' . $lng_profile['canceled_demand_friend'] . '</a>';
} else {
$friend = '<a href="profile.php?act=friends&do=add&id=' . $user['id'] . '">' . $lng_profile['in_friend'] . '</a>';
}
}
} else {
$friend = '<a href="profile.php?act=friends&do=delete&id=' . $user['id'] . '">' . $lng_profile['remov_friend'] . '</a>';
}
echo '<div><img src="../images/add.gif" width="16" height="16"/> ' . $friend . '</div>';