View file xmyx.ru/notifi/inc/stena_like.php

File size: 4.18Kb
<?


$post_wall = mysql_fetch_assoc(query("SELECT * FROM `user_wall` WHERE `id` = '" . $post['id_object'] . "' LIMIT 1"));

if ($post_wall['id']) {

//  Видео
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_wall_files` WHERE `id_ank` = '".$post_wall['id_ank']."' AND `id_post` = '".$post_wall['id']."' AND `type` = '2'"), 0) > 0)
{
$chto_ocenili = 'видеозапись';
}
else{
$chto_ocenili = 'запись';
}

?>
<div class="notification notification_withActions Row Row_style_withBorder">        

<a class="notification__fillLink" href="/wall<?= $post_wall['id_ank']?>_<?= $post_wall['id']?>" aria-label="Перейти к уведомлению"></a>

<div class="notification__left">
<a class="notification__avatar" href="/id<?= $avtor['id']?>"><?= avka50($avtor['id'], 'notification__avatarPhoto')?>     
<div class="notification__avatarIcon Icon Icon_notify_mini_like"></div>
</a>
</div>
        
<div class="notification__center">
<div class="notification__row notification__row_name_header">
<b><a href="/id<?= $avtor['id']?>" class="mem_link" mention="" mention_id="/id<?= $avtor['id']?>"><?= $avtor['nick']?></a></b> 
оценил<?= ($avtor['pol'] == 1 ? '' : 'а')?> Вашу <?= $chto_ocenili?> 
<?
if($post_wall['text'] != NULL){
?>
<a href="/wall<?= $post_wall['id_ank']?>_<?= $post_wall['id']?>"><?= output_text(short_text($post_wall['text'], 8))?></a>
<?
}
?>
</div>
<div class="notification__row notification__row_name_footer"><?= vremja($post['time'])?></div>
</div>
<?
// Если смении аватар
if($post_wall['type'] == 'avatar'){
	$post_avatar = mysql_fetch_assoc(mysql_query("SELECT * FROM `photos_user` WHERE `id` = '".$post_wall['id_object']."' LIMIT 1"));
?>
<div class="notification__right">
<a class="notification__media" href="/albums<?= $post_avatar['id_user']?>?act=photo&id=<?= $post_avatar['id']?>" style="background-image: url('/files/photos/original/<?= $post_avatar['id'] . $post_avatar['hash']?>.jpg')">    
</a>
</div>
<?
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_wall_files` WHERE `id_ank` = '".$post_wall['id_ank']."' AND `id_post` = '".$post_wall['id']."'"), 0) > 0)
{
// Картинки
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_wall_files` WHERE `id_ank` = '".$post_wall['id_ank']."' AND `id_post` = '".$post_wall['id']."' AND `type` = '1'"), 0) > 0)
{
$q_f = mysql_query("SELECT * FROM `user_wall_files` WHERE `id_ank` = '".$post_wall['id_ank']."' AND `id_post` = '".$post_wall['id']."' AND `type` = '1' ORDER BY `time` DESC LIMIT 1");
while ($post_f = mysql_fetch_array($q_f))
{
$file = mysql_fetch_assoc(mysql_query("SELECT `id`,`type` FROM `user_wall_files` WHERE `id` = '".$post_f['id']."' LIMIT 1"));
?>
<div class="notification__right">
<a class="notification__media" href="/wall<?= $post['id_user']?>_<?= $post_wall['id']?>?act=photo&pic=<?= $file['id']?>" style="background-image: url('/files/wall/files/others/<?= $file['id']?>.jpg')">    
</a>
</div>
<?
}
}
// Видео
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_wall_files` WHERE `id_ank` = '".$post_wall['id_ank']."' AND `id_post` = '".$post_wall['id']."' AND `type` = '2'"), 0) > 0)
{
$q_f = mysql_query("SELECT * FROM `user_wall_files` WHERE `id_ank` = '".$post_wall['id_ank']."' AND `id_post` = '".$post_wall['id']."' AND `type` = '2' ORDER BY `time` DESC LIMIT 1");
while ($post_f = mysql_fetch_array($q_f))
{
$file = mysql_fetch_assoc(mysql_query("SELECT `id`,`type` FROM `user_wall_files` WHERE `id` = '".$post_f['id']."' LIMIT 1"));
?>
<div class="notification__right">
<a class="notification__media" href="/wall<?= $post_wall['id_ank']?>_<?= $post_wall['id']?>" style="background-image: url('/files/wall/files/video/<?= $file['id']?>.gif')">    
</a>
</div>
<?
}
}
}

?>
 

<div class="notification__body">

<div id="show_menu<?= $post['id']?>" class="notification__actionsBubble">
<a class="notification__action" href="/notifi?high=<?= $post['id']?>"> Скрыть уведомление</a>
</div>

<div class="notification__actions">
      <div class="notification__actionsTrigger" onclick="show_menu(<?= $post['id']?>)" aria-hidden="true"></div>
</div>

</div>  
</div> 
<?
}
else{
	query("DELETE FROM `notifi` WHERE `id_user` = '$user[id]' AND `id` = '$post[id]' LIMIT 1");
}


?>