Копирую свое первое сообщение (выделяю жирным то что просто добавил к стандартной ТипДин странице)
<?php
/* ID Информационной системы */
$InformationSystem_id = to_int($GLOBALS['LA']['InformationSystemID']);
// Получаем информацию о текущем пользователе
if (class_exists('SiteUsers'))
{
$SiteUsers = & singleton('SiteUsers');
$site_user_id = $SiteUsers->GetCurrentSiteUser();
}
else
{
$site_user_id = 0;
}
$form_user_name = to_str($_POST['comment_autor']);
$form_user_email = to_str($_POST['comment_email']);
$form_text = to_str($_POST['comment_text']);
$form_subject = to_str($_POST['comment_subject']);
$form_parent_id = to_int($_POST['comment_parent_id']);
/* Массив внешних параметров, передаваемых в XML */
$external_propertys = array();
/* Добавление комментария */
// ShowAddComment == 1 - только авторизированные
// ShowAddComment == 2 - все
if (isset($_POST['add_comment'])
&& (($GLOBALS['LA']['ShowAddComment'] == 1 && $site_user_id > 0) || $GLOBALS['LA']['ShowAddComment'] == 2))
{
$param['information_items_id'] = to_int($GLOBALS['InformationResult']['item_id']);
/* XSL шаблон для отправки уведомления администратору о добавлении комментария */
$param['admin_email_xsl'] = to_str($GLOBALS['LA']['xsl_admin_email']);
$xsl_add_comment = to_str($GLOBALS['LA']['xsl_add_comment']);
/* Режим добавления комментария:
1 - публиковать сразу,
0 - публиковать после проверки.*/
if (to_bool($GLOBALS['LA']['TypeAddComment'])/* || $site_user_id > 0*/)
{
$param['status'] = 1;
}
else
{
$param['status'] = 0;
}
// Текст комментария
$_POST['comment_text'] = nl2br(to_str($_POST['comment_text']));
// Типографируем текст, если доступен модуль типографирования
if (class_exists('typograph'))
{
$typograph = new typograph();
$_POST['comment_text'] = $typograph->ProcessTypographic($_POST['comment_text']);
}
$param['comment_mail_type'] = to_int($GLOBALS['LA']['comment_mail_type']);
// ID родительского комментария
$param['comment_parent_id'] = to_int($_POST['comment_parent_id']);
$param['comment_autor'] = htmlspecialchars(to_str($_POST['comment_autor']));
$param['comment_email'] = htmlspecialchars(to_str($_POST['comment_email']));
$param['comment_subject'] = htmlspecialchars(to_str($_POST['comment_subject']));
$param['comment_text'] = to_str($_POST['comment_text']);
$param['comment_grade'] = to_int($_POST['comment_grade']);
$param['allowable_tags'] = '<b><strong><i><em><br><p><u><strike><ul><ol><li>';
ob_start();
$GLOBALS['LA_InformationSystem']->ShowAddComment('УведомлениеДобавлениеКомментария', $param);
$external_propertys['message'] = ob_get_clean();
if (strpos($external_propertys['message'], '<div id="error">') === false)
{
$form_user_name = '';
$form_user_email = '';
$form_text = '';
$form_subject = '';
$form_parent_id = to_int($_POST['comment_parent_id']);
}
}
if ($GLOBALS['INFSYS_result'] != false)
{
/* XSL шаблон для отображения списка элементов информационной системы */
$xsl_list = to_str($GLOBALS['LA']['xsl_information_system_list']);
/* XSL шаблон для отображения элемента информационной системы */
$xsl_item = to_str($GLOBALS['LA']['xsl_information_item']);
$InformationResult = $GLOBALS['InformationResult'];
/* Массив внешних параметров, передаваемых в XML */
$external_propertys['ОтображатьСсылкуНаАрхив'] = 0;
$external_propertys['ОтображатьСсылкиНаСледующиеСтраницы'] = 1;
/* Массив дополнительных параметров */
$property = array();
$property_id = 26; // Идентификатор доп. свойства типа "Дата"
// Заполняем первое условие
$element['type'] = 1;
$element['property_id'] = $property_id;
$element['prefix'] = ' AND ';
$element['if'] = '!=';
$element['value'] = '';
$element['sufix']=" AND CONVERT(CONCAT(SUBSTR(information_propertys_items_value, 7, 4), CHAR(45), SUBSTR(information_propertys_items_value, 4, 2), CHAR(45), SUBSTR(information_propertys_items_value, 1, 2)), DATE) > CURDATE()";
$property['select'][] = $element;
/* Число элементов на страницу */
if (isset($InformationResult['items_on_page']))
{
if ($InformationResult['items_on_page'] !== true)
{
$InformationResult['items_on_page'] = to_int($InformationResult['items_on_page']);
}
}
else
{
$InformationResult['items_on_page'] = 10;
}
/* Номер, с которого начинается показ */
if (isset($InformationResult['items_begin']))
{
$InformationResult['items_begin'] = to_int($InformationResult['items_begin']);
}
else
{
$InformationResult['items_begin'] = 0;
}
/* Вывод списка */
if ($GLOBALS['INFSYS_result']['item'] == false)
{
// Если передано имя тэга - фильтруем
if (isset($GLOBALS['INFSYS_result']['tag_name']))
{
if (class_exists('Tag'))
{
$oTag = & singleton('Tag');
$tag_row = $oTag->GetTagByName($GLOBALS['INFSYS_result']['tag_name']);
$property['tags'] = array($tag_row['tag_id']);
// При выводе тэгов вывод элементов ведется из всех групп
$GLOBALS['INFSYS_result']['group'] = false;
}
}
// $property['xml_show_group_type'] = 'all';
// Разрешаем передачу в XML свойств групп
$property['xml_show_group_property'] = true;
/* Отображаем информационную систему */
$GLOBALS['LA_InformationSystem']->ShowInformationSystem($InformationSystem_id, $GLOBALS['INFSYS_result']['group'], $xsl_list, $InformationResult['items_on_page'], $InformationResult['items_begin'], $external_propertys, $property);
}
else
{
/* Определяем идентификатор информационного элемента */
$item_id = $GLOBALS['LA_InformationSystem']->GetIdInformationItem($GLOBALS['INFSYS_result']['item'], $GLOBALS['INFSYS_result']['group'], $InformationSystem_id);
if (to_bool($GLOBALS['LA']['ShowComments']))
{
$external_propertys['show_comments'] = '1';
}
else
{
$external_propertys['show_comments'] = '0';
}
// Кому разрешено добавление комментария
$external_propertys['show_add_comments'] = to_int($GLOBALS['LA']['ShowAddComment']);
$property['part'] = $GLOBALS['part_ii'];
// Запрещаем передачу в XML свойств групп
$property['xml_show_group_property'] = false;
$external_propertys['form_user_name'] = $form_user_name;
$external_propertys['form_user_email'] = $form_user_email;
$external_propertys['form_text'] = $form_text;
$external_propertys['form_subject'] = $form_subject;
$external_propertys['form_parent_id'] = $form_parent_id;
// Выводим элемент информационной системы
$GLOBALS['LA_InformationSystem']->ShowInformationSystemItem($item_id, $xsl_item, $external_propertys, $property);
}
}
?>
compaq писал(а):
Нужна сортировка возрастанием по дате но вставив решение в тип дин страницу оно не канает — элементы сортируются походу дела в зависимости от настроек у ИС