Файл: Arhmobi_esdcms/users_birthday.php
Строк: 25
<?
/*
include_once 'sys/inc/start.php';
$doc = new document ();
$doc->title = __('Поломки');
*/
$q = $db->query("
SELECT `id`, TIMESTAMPDIFF(YEAR, CONCAT_WS('-',ank_g_r,ank_m_r,ank_d_r),CURDATE()) AS age
FROM `users` WHERE `ank_m_r`='".date("m")."'
AND `ank_d_r`='".date("d")."' AND `id` IN (
SELECT `id_friend` FROM `friends`
WHERE `id_user`='" . $user->id . "')
");
if ($q) {
$res = $q->fetchAll();
$listing = new listing();
foreach ($res as $row) {
$post = $listing->post();
$ank = new user($row['id']);
$post->image = $ank->ava();
$post->title = $ank->nick();
$post->url = '/profile.view.php?id=' . $ank->id;
$post->content[] = '[b]' . __('Сегодня исполнилось ') . $row['age'] . ' [/b]';
$post->display();
}
}
?>