SMF Version: SMF 1.1
I would like to be able to have the calendar display event titles to guests. I still require that the details be posted in a members only board, but I want to intice new members.
When posting now, only those who are authorized to view the board (members only - events) can see the event in the calendar.
Any ideas on how to get this done?
Any help is greatly appreciated.
Admin / Calendar / Membergroups allowed to view the calendar (Check Guest).
Oh wait, guests don't have access to the board the events are being posted in?
That is correct. It boils down to the idea that I would like guests to see the titles for a topic they do not have access to.
Anyone?
Sorry for the late response. What you can do is change this:
Open:
Sources/Calendar.php:
Find:
$events = !empty($modSettings['cal_showeventsoncalendar']) ? calendarEventArray($low, $high) : array();
Change to:
$events = !empty($modSettings['cal_showeventsoncalendar']) ? calendarEventArray($low, $high, false) : array();
Next find:
// Otherwise, this is going to be cached and the VIEWER'S permissions should apply... just put together some info.
else
$events[strftime('%Y-%m-%d', $date)][] = array(
'id' => $row['ID_EVENT'],
'title' => $row['title'],
'topic' => $row['ID_TOPIC'],
'msg' => $row['ID_FIRST_MSG'],
'poster' => $row['ID_MEMBER'],
'start_date' => $row['startDate'],
'end_date' => $row['endDate'],
'is_last' => false,
'allowed_groups' => explode(',', $row['memberGroups'])
);
Change to:
// Otherwise, this is going to be cached and the VIEWER'S permissions should apply... just put together some info.
else
$events[strftime('%Y-%m-%d', $date)][] = array(
'id' => $row['ID_EVENT'],
'title' => $row['title'],
'topic' => $row['ID_TOPIC'],
'msg' => $row['ID_FIRST_MSG'],
'poster' => $row['ID_MEMBER'],
'start_date' => $row['startDate'],
'end_date' => $row['endDate'],
'is_last' => false,
'allowed_groups' => explode(',', $row['memberGroups']),
'can_edit' => allowedTo('calendar_edit_any') || ($row['ID_MEMBER'] == $ID_MEMBER && allowedTo('calendar_edit_own')),
'modify_href' => $scripturl . '?action=' . ($row['ID_BOARD'] == 0 ? 'calendar;sa=post;' : 'post;msg=' . $row['ID_FIRST_MSG'] . ';topic=' . $row['ID_TOPIC'] . '.0;calendar;') . 'eventid=' . $row['ID_EVENT'] . ';sesc=' . $sc,
'link' => $row['ID_BOARD'] == 0 ? $row['title'] : '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['title'] . '</a>',
);
Works flawlessly.
Thank you.
I made one change which was to change the end part to:
// Otherwise, this is going to be cached and the VIEWER'S permissions should apply... just put together some info.
else
$events[strftime('%Y-%m-%d', $date)][] = array(
'id' => $row['ID_EVENT'],
'title' => $row['title'],
'topic' => $row['ID_TOPIC'],
'msg' => $row['ID_FIRST_MSG'],
'poster' => $row['ID_MEMBER'],
'start_date' => $row['startDate'],
'end_date' => $row['endDate'],
'is_last' => false,
'allowed_groups' => explode(',', $row['memberGroups']),
'can_edit' => allowedTo('calendar_edit_any') || ($row['ID_MEMBER'] == $ID_MEMBER && allowedTo('calendar_edit_own')),
'modify_href' => $scripturl . '?action=' . ($row['ID_BOARD'] == 0 ? 'calendar;sa=post;' : 'post;msg=' . $row['ID_FIRST_MSG'] . ';topic=' . $row['ID_TOPIC'] . '.0;calendar;') . 'eventid=' . $row['ID_EVENT'] . ';sesc=' . $sc,
'link' => $row['ID_BOARD'] == 0 ? $row['title'] : '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['title'] . '</a>',
);
Otherwise you won't see the edit part next to calendar events.
Thank you very much!!
Another great post that should be a sticky