Код:
if(listQuery("select count(Subdivision_ID) as count from Subdivision where Parent_Sub_ID=$sub and Checked=1", "$data[count]"))
{
$res1 = mysql_query("select Subdivision_ID, Subdivision_Name, Hidden_URL from Subdivision where Parent_Sub_ID=$sub and Checked=1 order by Priority");
while($row=mysql_fetch_assoc($res1))
{
$i++;
if(is_even($i))
$t_prefix .= "<tr><td valign=top><dl><dt><a href=".$row[Hidden_URL].">".$row[Subdivision_Name]."</a></dt> ".listQuery("select count(Message_ID) as count from Message".$MODULE_VARS[linkmanager][LINKS_CLASS]." where Subdivision_ID=".$row[Subdivision_ID]." and Checked=1", "($data[count])")."</td>";
else
$t_prefix .= "<td valign=top><dl><dt><a href=".$row[Hidden_URL].">".$row[Subdivision_Name]."</a></dt> ".listQuery("select count(Message_ID) as count from Message".$MODULE_VARS[linkmanager][LINKS_CLASS]." where Subdivision_ID=".$row[Subdivision_ID]." and Checked=1", "($data[count])")."</td>";
}
}