Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
baikal-boy 11.03.2004 05:39
Здравствуйте, друзья! :)))@getMessagesByThread[thread] $result[^table::sql{ SELECT forum_message.forum_message_id, parent_id, thread_id, title, author, email, dt_published, forum_message_body.forum_message_id AS is_not_empty FROM forum_message ^MAIN:pSQL.left_join[from;forum_message_body;forum_message.forum_message_id = forum_message_body.forum_message_id] WHERE ^MAIN:pSQL.left_join[where;forum_message_body;forum_message.forum_message_id = forum_message_body.forum_message_id] ^if($thread is table){ ^if($thread){thread_id IN (^thread.menu{$thread.thread_id}[,]) AND} }{ thread_id = ^thread.int(0) AND } is_published = 1 ORDER BY dt_published DESC }] @printMessagesByParent[messages;parent_id][levelmessages] $levelmessages[^messages.select($messages.parent_id == $parent_id)] ^levelmessages.menu{ ^printTreeItem[$levelmessages.fields;^printMessagesByParent[$messages;$levelmessages.forum_message_id]] }