Файл: install.txt
Строк: 56
***Функция вывод друзей как в vk.com****
***Установка***
1) Залить мод себе на
хостинг, и распоковать его!
2) Вставьте
код в /sys/fnc/avatar.php или в /sys/fnc/status.php
///***///
function frend($id){
global $set;
$p =
mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='$id'
LIMIT 1"));
$a = mysql_fetch_array(mysql_query("SELECT * FROM
`gallery_foto` WHERE `id_user`='$id' AND `avatar`='1' LIMIT
1"));
if (is_file(H."sys/gallery/50/$a[id].$a[ras]"))
echo "<a href='/id$p[id]'><img class='photo'
style='vertical-align: middle; padding: 5px; height: 50px; width: 50px;
border-radius: 2px; margin-right: 3px;' src='/foto/foto50/$a[id].$a[ras]'
title='$p[nick]' '></a>";
elseif ($p['pol']==0)
echo
"<a href='id$p[id]'><img style='vertical-align: middle;
padding: 5px;' src='/style/user/user_woman.png' align='' width='50'
title='$p[nick]' style='margin-right: 3px; border-right:px solid
#99ccff'> </a>";
else
echo "<a
href='id$p[id]'><img style='vertical-align: middle; padding: 5px;'
src='/style/user/user_man.png' align='' width='50' title='$p[nick]'
style='margin-right: 3px; border-right:px solid
#99ccff'></a>";
}
///***///
3) Вставьте
код в /user/info/wap.php или в
/user/info/web.php
////*********************Друзья*********************////
$k_frend=mysql_result(mysql_query("SELECT COUNT(*) FROM
`frends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);
$q =
mysql_query("SELECT * FROM `frends` WHERE `user` = '$ank[id]' AND `i`
= '1' ORDER BY time DESC LIMIT 6");
echo "<table
class='post'>";
echo "<div class='main2'> <a
href='/user/frends/?id=$ank[id]'>".mysql_result(mysql_query("SELECT
COUNT(*) FROM `frends` WHERE `user` = '$ank[id]' AND `i` = '1'"),
0)." друзей</a></div>";
echo
"</table>\n";
if ($k_frend==0)
{
echo
"<table class='post'>\n";
echo "
<tr>\n";
echo " <td class='p_t'>\n";
echo
"Нет друзей\n";
echo " </td>\n";
echo " </tr>\n";
echo "
</table>\n";
}
echo "<div
class='main'>\n";
echo "<div style='width:
100%;'>";
while ($frend = mysql_fetch_assoc($q))
{
$frend=get_user($frend['frend']);
frend($frend['id']);
}
echo "</div>\n";
echo
"</div>\n";
////***********************************************////
**Автор sdn