E-body
C.D.\Zennoposter проекты на заказ
- Регистрация
- 6 Сен 2007
- Сообщения
- 999
- Реакции
- 347
- Автор темы
- #1
Код:
<?php $sql_result = $db->query("select ct.id, ct.alt_name, ct.name, ct.posi, ct.parentid, (select count(*) from ". PREFIX ."_post ps where ps.category = ct.id AND (DATE_FORMAT(date, '%Y%m%d')=CURDATE()) AND approve = '1') as new_, (select count(*) from ". PREFIX ."_post ps where ps.category = ct.id AND approve = '1') as allnews_ from ". PREFIX ."_category ct ORDER BY ct.posi");while($row = $db->get_row($sql_result)){if ($row['parentid']=='0') echo('<li><a href="'.$config['http_home_url'].$row['alt_name'].'/">'.$row['name'].'</a> ('.($row['allnews_']).')</li>');else echo('<li class="subcat"><a href="'.$config['http_home_url'].$row['alt_name'].'/">'.$row['name'].'</a> ('.($row['allnews_']).')</li>');}?>