|
@@ -309,6 +309,7 @@ function Post($post_errors = array())
|
|
$context['event']['last_day'] = (int) strftime('%d', mktime(0, 0, 0, $context['event']['month'] == 12 ? 1 : $context['event']['month'] + 1, 0, $context['event']['month'] == 12 ? $context['event']['year'] + 1 : $context['event']['year']));
|
|
$context['event']['last_day'] = (int) strftime('%d', mktime(0, 0, 0, $context['event']['month'] == 12 ? 1 : $context['event']['month'] + 1, 0, $context['event']['month'] == 12 ? $context['event']['year'] + 1 : $context['event']['year']));
|
|
|
|
|
|
$context['event']['board'] = !empty($board) ? $board : $modSettings['cal_defaultboard'];
|
|
$context['event']['board'] = !empty($board) ? $board : $modSettings['cal_defaultboard'];
|
|
|
|
+ $context['event']['topic'] = !empty($topic) ? $topic : 0;
|
|
}
|
|
}
|
|
|
|
|
|
// See if any new replies have come along.
|
|
// See if any new replies have come along.
|
|
@@ -1905,18 +1906,31 @@ function Post2()
|
|
$span = !empty($modSettings['cal_allowspan']) && !empty($_REQUEST['span']) ? min((int) $modSettings['cal_maxspan'], (int) $_REQUEST['span'] - 1) : 0;
|
|
$span = !empty($modSettings['cal_allowspan']) && !empty($_REQUEST['span']) ? min((int) $modSettings['cal_maxspan'], (int) $_REQUEST['span'] - 1) : 0;
|
|
$start_time = mktime(0, 0, 0, (int) $_REQUEST['month'], (int) $_REQUEST['day'], (int) $_REQUEST['year']);
|
|
$start_time = mktime(0, 0, 0, (int) $_REQUEST['month'], (int) $_REQUEST['day'], (int) $_REQUEST['year']);
|
|
|
|
|
|
|
|
+ $board_query = '';
|
|
|
|
+ $board_params = array();
|
|
|
|
+
|
|
|
|
+ // Linking a previously non-linked event to a new post?
|
|
|
|
+ if (empty($_REQUEST['evtopic']))
|
|
|
|
+ {
|
|
|
|
+ $board_query = ',
|
|
|
|
+ id_board = {int:board},
|
|
|
|
+ id_topic = {int:topic}';
|
|
|
|
+
|
|
|
|
+ $board_params = array('board' => $board, 'topic' => $topic);
|
|
|
|
+ }
|
|
|
|
+
|
|
$smcFunc['db_query']('', '
|
|
$smcFunc['db_query']('', '
|
|
UPDATE {db_prefix}calendar
|
|
UPDATE {db_prefix}calendar
|
|
SET end_date = {date:end_date},
|
|
SET end_date = {date:end_date},
|
|
start_date = {date:start_date},
|
|
start_date = {date:start_date},
|
|
- title = {string:title}
|
|
|
|
|
|
+ title = {string:title}' . $board_query . '
|
|
WHERE id_event = {int:id_event}',
|
|
WHERE id_event = {int:id_event}',
|
|
- array(
|
|
|
|
|
|
+ array_merge(array(
|
|
'end_date' => strftime('%Y-%m-%d', $start_time + $span * 86400),
|
|
'end_date' => strftime('%Y-%m-%d', $start_time + $span * 86400),
|
|
'start_date' => strftime('%Y-%m-%d', $start_time),
|
|
'start_date' => strftime('%Y-%m-%d', $start_time),
|
|
'id_event' => $_REQUEST['eventid'],
|
|
'id_event' => $_REQUEST['eventid'],
|
|
'title' => $smcFunc['htmlspecialchars']($_REQUEST['evtitle'], ENT_QUOTES),
|
|
'title' => $smcFunc['htmlspecialchars']($_REQUEST['evtitle'], ENT_QUOTES),
|
|
- )
|
|
|
|
|
|
+ ), $board_params)
|
|
);
|
|
);
|
|
}
|
|
}
|
|
updateSettings(array(
|
|
updateSettings(array(
|