@ -135,7 +135,8 @@ class Unicalendar
uca_link = '" . $_POST['uca_link'] . "',
uca_day = '" . $_POST['uca_day'] . "',
uca_scroll = '" . $_POST['uca_scroll'] . "',
uca_descript = '" . $_POST['uca_descript'] . "'
uca_descript = '" . $_POST['uca_descript'] . "',
uca_events_limit = '" . $_POST['uca_events_limit'] . "'
");
// Получаем обновленные данные календаря
@ -161,11 +162,12 @@ class Unicalendar
$uca_scroll = $v['uca_scroll'];
$uca_link = $v['uca_link'];
$uca_descript = $v['uca_descript'];
$uca_events_limit = $v['uca_events_limit'];
}
// Если выбрали вывести все документы из заданной рубрики - документы с Id=1 (Главная) и 404 страница - выводиться не будут!
if ($uevents !='' & & $uevents == '1'){
$sql = $AVE_DB->Query("
SELECT Id, document_alias, document_title, document_published, document_meta_description
SELECT Id, document_alias, document_title, document_published, document_expire, document_ meta_description
FROM " . PREFIX . "_documents
WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 & & Id != '".PAGE_NOT_FOUND_ID."'
");
@ -177,10 +179,10 @@ class Unicalendar
//получаем данные всех документов из заданной рубрики циклом, формируем строку JSON
foreach ( $results as $k=>$v )
{
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"expire_date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_expire']))."\", \" title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$rubric_count .= $v['Id']." OR Id=";
}
$js_data_files = "$(function(){"."var data".$uca_id." = [".$uni_data."]; $(\"#eventCalendar".$uca_id."\").eventCalendar({jsonData: data".$uca_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
$js_data_files = "$(function(){"."var data".$uca_id." = [".$uni_data."]; $(\"#eventCalendar".$uca_id."\").eventCalendar({jsonData: data".$uca_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", eventsLimit: ".$uca_events_limit.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
// Получаем Id документов в категории на момент создания календаря и записываем значение в БД
$rubric_count ='Id='.$rubric_count;
@ -209,7 +211,7 @@ class Unicalendar
// Если выбрали вывести выбранные документы из заданной рубрики - документы с Id=1 (Главная) и 404 страница - выводиться не будут!
if ($uevents !='' & & $uevents == '2'){
$sql = $AVE_DB->Query("
SELECT Id, document_alias, document_title, document_published, document_meta_description
SELECT Id, document_alias, document_title, document_published, document_expire, document_ meta_description
FROM " . PREFIX . "_documents
WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 & & Id != '".PAGE_NOT_FOUND_ID."' AND ".$udoc_id."
");
@ -221,10 +223,10 @@ class Unicalendar
//получаем данные выбранных документов из заданной рубрики циклом, формируем строку JSON
foreach ( $results as $k=>$v )
{
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"expire_date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_expire']))."\", \"title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$rubric_count .= $v['Id'].",";
}
$js_data_files = "$(function(){"."var data".$uca_id." = [".$uni_data."]; $(\"#eventCalendar".$uca_id."\").eventCalendar({jsonData: data".$uca_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
$js_data_files = "$(function(){"."var data".$uca_id." = [".$uni_data."]; $(\"#eventCalendar".$uca_id."\").eventCalendar({jsonData: data".$uca_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", eventsLimit: ".$uca_events_limit.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
// Создаем js файл для календаря с названием dataXXX.js - где XXX = Id календаря
$fdir = "/modules/unicalendar/js/data-files/";
@ -270,7 +272,7 @@ class Unicalendar
if($uevents == 2)
{
$sql = $AVE_DB->Query("
SELECT Id, document_alias, document_title, document_published, document_meta_description
SELECT Id, document_alias, document_title, document_published, document_expire, document_ meta_description
FROM " . PREFIX . "_documents
WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 & & Id != '".PAGE_NOT_FOUND_ID."'
");
@ -319,7 +321,8 @@ class Unicalendar
uca_link = '" . $_POST['uca_link'] . "',
uca_day = '" . $_POST['uca_day'] . "',
uca_scroll = '" . $_POST['uca_scroll'] . "',
uca_descript = '" . $_POST['uca_descript'] . "'
uca_descript = '" . $_POST['uca_descript'] . "',
uca_events_limit = '" . $_POST['uca_events_limit'] . "'
WHERE id = '" . $unicalendar_id . "'
");
$as = array();
@ -348,11 +351,12 @@ class Unicalendar
$uca_scroll = $v['uca_scroll'];
$uca_link = $v['uca_link'];
$uca_descript = $v['uca_descript'];
$uca_events_limit = $v['uca_events_limit'];
}
// Если выбрали вывести все документы из заданной рубрики - документы с Id=1 (Главная) и 404 страница - выводиться не будут!
if ($uevents !='' & & $uevents == '1'){
$sql = $AVE_DB->Query("
SELECT Id, document_alias, document_title, document_published, document_meta_description
SELECT Id, document_alias, document_title, document_published, document_expire, document_ meta_description
FROM " . PREFIX . "_documents
WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 & & Id != '".PAGE_NOT_FOUND_ID."'
");
@ -364,10 +368,10 @@ class Unicalendar
//получаем данные всех документов из заданной рубрики циклом, формируем строку JSON
foreach ( $results as $k=>$v )
{
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"expire_date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_expire']))."\", \" title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$rubric_count .= $v['Id']." OR Id=";
}
$js_data_files = "$(function(){"."var data".$unicalendar_id." = [".$uni_data."]; $(\"#eventCalendar".$unicalendar_id."\").eventCalendar({jsonData: data".$unicalendar_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
$js_data_files = "$(function(){"."var data".$unicalendar_id." = [".$uni_data."]; $(\"#eventCalendar".$unicalendar_id."\").eventCalendar({jsonData: data".$unicalendar_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", eventsLimit: ".$uca_events_limit.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
// Получаем Id документов в категории на момент создания календаря и записываем значение в БД
$rubric_count ='Id='.$rubric_count;
@ -396,7 +400,7 @@ class Unicalendar
// Если выбрали вывести выбранные документы из заданной рубрики - документы с Id=1 (Главная) и 404 страница - выводиться не будут!
if ($uevents !='' & & $uevents == '2'){
$sql = $AVE_DB->Query("
SELECT Id, document_alias, document_title, document_published, document_meta_description
SELECT Id, document_alias, document_title, document_published, document_expire, document_ meta_description
FROM " . PREFIX . "_documents
WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 & & Id != '".PAGE_NOT_FOUND_ID."' AND ".$udoc_id."
");
@ -408,10 +412,10 @@ class Unicalendar
//получаем данные выбранных документов из заданной рубрики циклом, формируем строку JSON
foreach ( $results as $k=>$v )
{
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$uni_data .= "{ \"date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_published']))."\", \"expire_date\": \"".pretty_date(strftime('%Y-%m-%d %H:%M:%S', $v['document_expire']))."\", \" title\": \"".$v['document_title']."\", \"description\": \"".$v['document_meta_description']."\", \"url\": \"".$v['document_alias']."\" },";
$rubric_count .= $v['Id'].",";
}
$js_data_files = "$(function(){"."var data".$unicalendar_id." = [".$uni_data."]; $(\"#eventCalendar".$unicalendar_id."\").eventCalendar({jsonData: data".$unicalendar_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
$js_data_files = "$(function(){"."var data".$unicalendar_id." = [".$uni_data."]; $(\"#eventCalendar".$unicalendar_id."\").eventCalendar({jsonData: data".$unicalendar_id.", jsonDateFormat: \"human\", startWeekOnMonday: ".$uca_day.", eventsScrollable: ".$uca_scroll.", openEventInNewWindow: ".$uca_link.", dateFormat: \"".$uca_dfrm."\", showDescription: ".$uca_descript.", eventsLimit: ".$uca_events_limit.", locales: {locale: \"".$uca_locale."\", txt_noEvents: \"".$uca_no_events."\", txt_SpecificEvents_prev: \"\", txt_SpecificEvents_after: \"".$uca_real_events."\", txt_NextEvents: \"".$uca_next_events."\", txt_GoToEventUrl: \"".$uca_look_events."\", moment: {\"months\" : ".$uca_months_events.", \"monthsShort\" : ".$uca_monshort_events.", \"weekdays\" : ".$uca_weekdays_events.", \"weekdaysShort\" : ".$uca_wdayshort_events.", \"weekdaysMin\" : ".$uca_wdaymin_events."}}});});";
// Создаем js файл для календаря с названием dataXXX.js - где XXX = Id календаря
$fdir = "/modules/unicalendar/js/data-files/";
@ -455,7 +459,7 @@ class Unicalendar
{
global $AVE_DB;
$sql = $AVE_DB->Query("
SELECT Id, document_alias, document_title, document_published, document_meta_description
SELECT Id, document_alias, document_title, document_published, document_expire, document_ meta_description
FROM " . PREFIX . "_documents
WHERE rubric_id = '" . $_POST['b'] . "' AND Id !=1 & & Id != '".PAGE_NOT_FOUND_ID."'
");
@ -466,7 +470,7 @@ class Unicalendar
}
foreach ( $u_sel_doc as $k=>$v )
{
echo "< tr class = 'noborder' > < td align = 'center' > < input type = 'checkbox' class = 'my-checkbox' name = 'u_chek".$v[' Id ' ] . " ' value = '".$v[' Id ' ] . " ' > < / td > "."< td align = 'center' > ".$v['Id']."< / td > "."< td > ".$v['document_title']."< / td > "."< td align = 'center' > ".$v['document_published'] = pretty_date(strftime(TIME_FORMAT, $v['document_published']))."< / td > < / tr > ";
echo "< tr class = 'noborder' > < td align = 'center' > < input type = 'checkbox' class = 'my-checkbox' name = 'u_chek".$v[' Id ' ] . " ' value = '".$v[' Id ' ] . " ' > < / td > "."< td align = 'center' > ".$v['Id']."< / td > "."< td > ".$v['document_title']."< / td > "."< td align = 'center' > ".$v['document_published'] = pretty_date(strftime(TIME_FORMAT, $v['document_published']))."< / td > "."< td align = 'center' > ".$v['document_expire'] = pretty_date(strftime(TIME_FORMAT, $v['document_expire']))."< / td > < / tr > ";
}
}
if (isset($_POST['check_rel'])) // если пришел запрос-проверка актуальности календаря (не будет выведен документ с Id=1 это Главная страница и документ Ошибка 404)