| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Misha v.3 17.08.2004 17:14
1. в Init я вообще ничего-бы не доставал из БД@SectionsCount[pid][tempsection;count]
# Вычисляем количество записей
$count(0)
$tempsection[^GetSectionsByParent[$pid]]
^tempsection.menu{
^if($tempsection.is_published){$count($count+1)}
}
$result[$count]
->
@SectionsCount[pid][tempsection]
# Вычисляем количество записей
$result(0)
$tempsection[^GetSectionsByParent[$pid]]
^tempsection.menu{
^if($tempsection.is_published){^result.inc(1)}
# или так
# ^result.inc($tempsection.is_published)
}
# или так:
$result(0)
$tempsection[^GetSectionsByParent[$pid]]
^result.inc($tempsection)про передачу параметров: @ShowSectionsByParent[pid;parent_uri][tempsection]
^if($hashTree.[$pid]){
$tempsection[$hashTree.[$pid]]
^tempsection.menu{
^PrintTreeItem[$tempsection.fields;$parent_uri;^if($hashTree.[$tempsection.id]){^ShowSectionsByParent[$tempsection.id;$parent_uri/$tempsection.uri]}]
}
}
</ul>
##############################
@PrintTreeItem[tempsection;parent_uri;child]
<li>
<a href="$parent_uri/$tempsection.uri">$tempsection.title</a>
$child
</li>И вопрос вдогонку: как правильней по логике-количеству отжираемой памяти я поступил с хэшами:вопрос не понят
$hashTree - в Init[] или $hashTreeByID в GetFullPath[id]???