Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: akheir on December 08, 2006, 10:22:15 PM

Title: Would like to have calendar display event titles to guests
Post by: akheir on December 08, 2006, 10:22:15 PM
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.

Title: Re: Would like to have calendar display event title to guests
Post by: codenaught on December 10, 2006, 11:09:39 AM
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?
Title: Re: Would like to have calendar display event titles to guests
Post by: akheir on December 10, 2006, 04:22:12 PM
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.
Title: Re: Would like to have calendar display event titles to guests
Post by: akheir on December 22, 2006, 01:02:18 AM
Anyone?
Title: Re: Would like to have calendar display event titles to guests
Post by: codenaught on December 22, 2006, 07:14:39 PM
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>',
);
Title: Re: Would like to have calendar display event titles to guests
Post by: akheir on December 22, 2006, 07:31:25 PM
Works flawlessly.

Thank you.
Title: Re: Would like to have calendar display event titles to guests
Post by: codenaught on December 22, 2006, 07:34:36 PM
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.
Title: Re: Would like to have calendar display event titles to guests
Post by: Gargoyle on December 22, 2006, 10:49:39 PM
Thank you very much!!
Title: Re: Would like to have calendar display event titles to guests
Post by: PacMan on December 26, 2006, 02:40:28 AM
Another great post that should be a sticky