user_friends_online.php
Code:
<?php
$page = "user_friends_online";
include "header.php";
// ASSIGN SMARTY VARS AND INCLUDE FOOTER
$smarty->assign('online_friends', online_friends() );
include "footer.php";
?>
user_friends_online.tpl
Code:
{include file='header.tpl'}
<img src='./images/icons/friends_online48.gif' border='0' class='icon_big'>
<div class='page_header'>Friends Online</div>
<div>Who's online on your friends list.</div>
<br />
{* SHOW ONLINE FRIENDS IF MORE THAN ZERO *}
{math assign='total_online_friends' equation="x+y" x=$online_friends[0]|@count y=$online_friends[1]}
{if $total_online_friends > 0}
{if $online_friends[0]|@count == 0}
{lang_sprintf id=977 1=$online_friends[1]}
{else}
{capture assign='online_friends_registered'}{section name=online_loop loop=$online_friends[0]}{if $smarty.section.online_loop.rownum != 1}, {/if}
<div id='profile_friends' style='display: none;'></div>
<div class='browse_friends_result' style='overflow: hidden;'>
<div class='profile_friend_photo'>
<a href='{$url->url_create("profile", $online_friends[0][online_loop]->user_info.user_username)}'>
<img src='{$online_friends[0][online_loop]->user_photo('./images/nophoto.gif', TRUE)}'
width='{$misc->photo_size($online_friends[0][online_loop]->user_photo('./images/nophoto.gif'),'90','90','w')}' border='0' alt="{$online_friends[0][online_loop]->user_displayname}"></a>
</div>
<div class='profile_friend_info'>
<div class='profile_friend_name'>
<a href='{$url->url_create("profile", $online_friends[0][online_loop]->user_info.user_username)}'>{$online_friends[0][online_loop]->user_displayname}</a></div>
{$online_users[0][online_loop]->user_username}
</div>
<div class='profile_friend_options'>
<div id='addfriend_'>
<div id='remove_friend'>
<a href="javascript:TB_show('{lang_print id=837}', 'user_friends_manage.php?task=remove&user={$online_friends[0][online_loop]->user_info.user_username}=&TB_iframe=true&height=300&width=450', '', './images/trans.gif');">{lang_print id=889}</a></div>
<div id='send_message'>
<a href="javascript:TB_show('{lang_print id=784}', 'user_messages_new.php?to_user={$online_friends[0][online_loop]->user_displayname}&to_id={$online_friends[0][online_loop]->user_info.user_username}&TB_iframe=true&height=400&width=450', '', './images/trans.gif');">{lang_print id=839}</a>
</div>
<div id='view_friends'>
<a href='profile.php?user={$online_friends[0][online_loop]->user_info.user_username}&v=friends'>View {$user->user_info.user_username}'s Friends</a>
</div>
</div>
<div style='clear: both;'></div>
</div>
</div>
{/section}{/capture}
{$online_friends_registered}
{/if}
{else}
<table cellpadding='0' cellspacing='0' align='center'>
<tr><td class='result'><img src='./images/icons/bulb16.gif' border='0' class='icon'>You do not have any friends online at this time.</td></tr>
</table>
{/if}
{include file='footer.tpl'}
Установка.
Code:
1). Заливаем все файлы из папки files на сайт
2). Открываем файл include/functions_general.php
в самом начале в свободное место вставляем функцию:
// THIS FUNCTION RETURNS AN ARRAY CONTAINING THE USERNAMES OF ONLINE FRIENDS
// INPUT:
// OUTPUT: AN ARRAY OF USERNAMES FOR FRIENDS CURRENTLY ACTIVE IN THE SYSTEM
function online_friends() {
global $database, $user;
// GET LOGGED IN FRIENDS ONLINE
$onlinefriends_array = Array();
$online_time = time()-60*60;
$online_friends = $database->database_query("SELECT u.user_username, u.user_fname, u.user_lname, u.user_id, u.user_photo
FROM se_users u
INNER JOIN se_friends f ON f.friend_user_id2=u.user_id WHERE f.friend_user_id1='{$user->user_info['user_id']}'
&& u.user_lastactive > '$online_time' AND u.user_invisible=0 ORDER BY u.user_lastactive DESC LIMIT 2000")
or die($database->database_error());
while($online_friend_info = $database->database_fetch_assoc($online_friends)) {
$online_friend = new se_user();
$online_friend->user_info[user_id] = $online_friend_info[user_id];
$online_friend->user_info[user_username] = $online_friend_info[user_username];
$online_friend->user_info[user_fname] = $online_friend_info[user_fname];
$online_friend->user_info[user_lname] = $online_friend_info[user_lname];
$online_friend->user_displayname();
// SET ONLINE FRIENDS ARRAY
$onlinefriends_array[] = $online_friend;
$onlinefriends_usernames[] = $online_friend->user_info[user_username];
}
// GET VISITORS ONLINE
$total_visitors = 0;
return Array($onlinefriends_array, $total_visitors, $onlinefriends_usernames);
} // END online_friends() FUNCTION
3). Открываем файл templates/header.tpl
в блоке: {* SHOW FRIENDS MENU ITEM IF ENABLED *} после этой строки:
<div class='menu_item_dropdown'><a href='user_friends_requests_outgoing.php' class='menu_item'>
<img src='./images/icons/friends_outgoing16.gif' border='0' class='menu_icon2' alt='' />{lang_print id=1172}</a></div>
вставляем код дополнительной строки меню:
<div class='menu_item_dropdown'><a href='user_friends_online.php' class='menu_item'>
<img src='./images/icons/friends_online16.gif' border='0' class='menu_icon2'>Friends Online</a></div>
Готово!
Code:
это нужно в profile вставить
{* Общие друзья *}
{if $num_adil_naizuud != 0}
<br>
<table cellpadding='0' cellspacing='0' align='center' width='100%' style='margin-bottom: 10px;'>
<tr><td class='header'> {lang_print id=769693} ({$num_adil_naizuud}) </td></tr>
<tr>
<td class='profile'>
<table cellpadding='0' cellspacing='0' align='center' width='100%' style='margin-bottom: 10px;'>
<tr>
{* LOOP THROUGH FRIENDS *}
{section name=adil_naizuud_loop loop=$adil_naizuud max=4}
{if $adil_naizuud[adil_naizuud_loop].name!=$user->user_info.user_username and $adil_naizuud[adil_naizuud_loop].name!=$owner->user_info.user_username and $adil_naizuud[adil_naizuud_loop].namea!=$usera->user_info.user_fname and $adil_naizuud[adil_naizuud_loop].namea!=$owner->user_info.user_fname and $adil_naizuud[adil_naizuud_loop].sname!=$suser->user_info.user_lname and $adil_naizuud[adil_naizuud_loop].sname!=$owner->user_info.user_lname}
{if $smarty.section.adil_naizuud_loop.rownum != 1}{/if}
<td>
<p><center>
{assign var=cont value="`$cont+1`"}
<a href='{$url->url_create('profile',$adil_naizuud[adil_naizuud_loop].name)}'>
{$adil_naizuud[adil_naizuud_loop].name}
<div style='clear: both;'></div>
</div>
{if $adil_naizuud[adil_naizuud_loop].photo}<img src='{$url->url_userdir($adil_naizuud[adil_naizuud_loop].id)}{$adil_naizuud[adil_naizuud_loop].photo}' class='photo' width='75'>
{else} <img src='images/nophoto.gif' class='photo' width='75'>
{/if}
<br>
{if $cont == 2}</tr>{/if}
{if $cont == 6}</tr>{/if}
</center></p>
</td>
{/if}
{/section}
</tr></table>
<br>
<a href='profile.php?user={$owner->user_info.user_username}&v=friends&m=1'>{lang_print id=1020}
</td></tr></table>
{/if}
{* Конец Общих Друзей *}
{* online друзья *}
{if $online_friends != 0}
<br>
<table cellpadding='0' cellspacing='0' align='center' width='100%' style='margin-bottom: 10px;'>
<tr><td class='header'> {lang_print id=769690} </td></tr>
<tr>
<td class='profile'>
<table cellpadding='0' cellspacing='0' align='center' width='100%' style='margin-bottom: 10px;'>
<tr>
{section name=online_loop loop=$online_friends[0] max=4}
{$online_friends_registered}
{if $smarty.section.online_loop.rownum != 1}{/if}
<td>
<p><center>
{assign var=cont value="`$cont+1`"}
<a href='{$url->url_create("profile", $online_friends[0][online_loop]->user_info.user_username)}'>{$online_friends[0][online_loop]->user_info.user_username}</a></div>
{$online_users[0][online_loop]->user_username}
<div style='clear: both;'></div>
</div>
<a href='{$url->url_create("profile", $online_friends[0][online_loop]->user_info.user_username)}'>
<img src='{$online_friends[0][online_loop]->user_photo('./images/nophoto.gif', TRUE)}'
width='{$misc->photo_size($online_friends[0][online_loop]->user_photo('./images/nophoto.gif'),'75','75','w')}' border='0' alt="{$online_friends[0][online_loop]->user_displayname}"></a>
<br><br><br>
{if $cont == 2}</tr>{/if}
{if $cont == 6}</tr>{/if}
</center></p>
</td>
{/section}
</tr></table>
<a href='user_friends_online.php'>{lang_print id=769691}
</td></tr></table>
{/if}
{* END online Друзей *}
---------- Добавлено в 19:51 ---------- Предыдущее сообщение было написано в 19:28 ----------
Попробовал у себя, что то ничего не увидел