- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
$posts = $db->execAndReturnAll('select `id`, `user_id`, `theme_id`, `text` from `posts` order by `id` desc limit 5');
$users = array();
$themes = array();
$groups = array();
$l = sizeof($posts);
for($i = 0; $i < $l; ++$i)
{
if(!in_array($posts[$i]['user_id']), $users)
$users[] = $posts[$i]['user_id'];
if(!in_array($posts[$i]['theme_id']), $themes)
$themes[] = $posts[$i]['theme_id'];
}
$users = $db->execAndReturnAll('select `id`, `nick`, `group_id` from `users` where `id` in (0,'.implode(',', $users).')');
$themes = $db->execAndReturnAll('select `id`, `name` from `themes` where `id` in (0,'.implode(',', $themes).')');
$l = sizeof($users);
for($i = 0; $i < $l; ++$i)
{
if(!in_array($users[$i]['group_id']), $groups)
$groups[] = $users[$i]['group_id'];
}
$groups = $db->execAndReturnAll('select `id`, `name` from `groups` where `id` in (0,'.implode(',', $groups).')');
De-Luxis 24.04.2011 18:52 # 0
rO_ot 24.04.2011 22:34 # +3
rO_ot 24.04.2011 22:35 # +1
rO_ot 24.04.2011 22:36 # +1
Lure Of Chaos 24.04.2011 23:03 # +5
ling 25.04.2011 20:53 # 0
Несвежее говнецо, батенька. =)
guest 13.05.2011 19:34 # +2
Пасаны! Смарите - быдлокодер оправдывается!