Would like to have calendar display event titles to guests

Started by akheir, December 08, 2006, 10:22:15 PM

Previous topic - Next topic

akheir

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.


codenaught

#1
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?
Dev Consultant
Former SMF Doc Coordinator

akheir

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.


codenaught

#4
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>',
);
Dev Consultant
Former SMF Doc Coordinator


codenaught

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.
Dev Consultant
Former SMF Doc Coordinator

Gargoyle


PacMan

4 stages of manhood. 1st we belive in Santa.. 2nd we find out Santa is not real. 3rd we learn to play we are santa and 4th We suddenly look like santa! ....  :)....  Merry Christmas!

Advertisement: