выаодит фото добавленые и подарки на страницу
В user/info/wap.php
Прописать в удобном для вас
месте код:
<?php
/* Последние фото */
echo "<table cellspacing='0' cellpad
ding='0'><tr>" ;
echo "<td class='nav1'>" ;
$q2 = mysql_query
("SELECT * FROM `gallery_foto` WHE
RE `id_user` = ' $ank
[id]' ORDER BY `id` DESC LIMIT 2" );
while ( $foto = mysql_fetch_assoc
($q2 )){
echo "<a href='/foto/ $ank [ id]/ $foto
[id_gallery ] /$foto [id] /'><img src='/
foto/foto50/ $foto [id]. $foto
[ras ]' alt=''/></a>" ; }
echo "<br/>" ;
echo "<div class='nav2'><a href='/
foto/$ank
[id]/'><center>Все фотографии</
center></a></div> " ;
/*
===============================
=========
Подарки
===============================
=========
*/
echo "<td class='nav1' align='right'>
";
$k_p = mysql_result (mysql_query
("SELECT COUNT
(id) FROM `gifts_user` WHERE `id_us
er` = ' $ank
[id]' AND `status` = '1'" ), 0);
$width = ( $webbrowser == 'web' ? '6
0' : '45'); // Размер подарков при в
ыводе в браузер
if ( $k_p > 0 )
{
$q = mysql_query
("SELECT id,id_gift,status FROM `gift
s_user` WHERE `id_user` = ' $ank
[id]' AND `status` = '1' ORDER BY `id`
DESC LIMIT 1" );
while ( $post = mysql_fetch_assoc
($q ))
{
$gift = mysql_fetch_assoc
(mysql_query
("SELECT id FROM `gift_list` WHERE
`id` = ' $post [id_gift ]' LIMIT 1" ));
echo '<a href="/user/gift/gift.php?
id=' . $post ['id' ] . '"><img src="/sys/
gift/' . $gift ['id' ] . '.png" style="max-
width:' . $width . 'px;" alt="Подарок
" /></a> ' ;
}
echo '<div class="nav2">' ;
echo '<a href="/user/gift/index.php?
id=' . $ank [ 'id'] . '">Все подарки</
a>' ;
echo "</div>" ;
}else{
echo '<div class="nav2">Нет подар
ков</div>' ;
}
echo "</td>" ;
echo "</table>" ;
?>