TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 681
  • Total: 681

Events sign-up on Calendar

Started by jayemsee283, November 19, 2007, 07:33:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jayemsee283

My pleasure. Its simplicity is its elegance really. Cutting/pasting that to a forum, .txt file, whatever else makes life easier.

confuzed

Quote from: TimUSA on November 21, 2007, 03:03:50 PM
There is an event attendee mod at smf for the calender:

http://custom.simplemachines.org/mods/index.php?mod=26
http://custom.simplemachines.org/mods/index.php?mod=138

however neither work for smf 1.4 :(

I agree this would be a great feature

Someone has updated this one and it has recently been submitted to the mod site.  This one does work for 1.1.4 as I have it installed :)  The mod author has downloads in the thread until the mod is official.  It gives a nice list of attendees at the top of the thread.

What I would like, and I'm hoping someone would know how to do this, is to have a tiny portal block that displays all the events that a member has signed up for - so it would be different for each member, not a list of everyone's events but just their events that they have agreed to attend.  This would act as a reminder for each member, and have all the events in one place ie the block. 

======================
My events:

Member chat April 17  < link to event thread
Weekend meet April 30 < link to event thread
Music Festival May 15 < link to event thread
Board celebration May 25 < link to event thread

======================

Could someone who is good with the coding work this out for me?  I think it would be very handy for a lot of boards, just tell me what you need.  If you need to see the install file to see what the mod does I can upload it here.

Thanks in advance  :)

JPDeni

I might be able to do it, but I would need to see the code so I'd know what queries to write.

confuzed

ok, sounds good :)

Here is the mod installation file, I hope that's the one you mean - attached actually not attached as it's not an accepted file type for attachments.

Here is the code:

<id>
PhatCalPack
</id>

<version>
1.0
</version>

<edit file>
index.php
</edit file>

<search for>
'who' => array('Who.php', 'Who'),
</search for>

<add before>
'toggleVCal' => array('Calendar.php', 'ToggleVCal'),
'showVCal' => array('Calendar.php', 'ShowVCal'),
'dlVCal' => array('Calendar.php', 'DownloadVCal'),
'toggleAttend' => array('Calendar.php', 'ToggleAttend'),
</add before>



<edit file>
Sources/Calendar.php
</edit file>

<search for>
$events = array();
</search for>

<replace>
$result2 = db_query("
SELECT
cal.ID_EVENT, DAYOFMONTH(cal.ID_EVENT) AS day, cal.title, cal.ID_MEMBER, cal.ID_TOPIC, cal.ID_BOARD
FROM {$db_prefix}calendar AS cal
WHERE cal.ID_EVENT BETWEEN '$low_date' AND '$high_date'
AND cal.ID_TOPIC = 0
AND cal.ID_BOARD = 0", __FILE__, __LINE__);

$results = array();
</replace>

<search for>
{
// Censor the title.
</search for>

<add before>
$results[] = $row;
while ($row = mysql_fetch_assoc($result2))
$results[] = $row;

$events = array();
foreach ($results as $row)
</add before>

<search for>
'msg' => $row['ID_FIRST_MSG'],
</search for>

<replace>
'msg' => !empty($row['ID_FIRST_MSG']) ? $row['ID_FIRST_MSG'] : '0',
</replace>

<search for>
?>
</search for>

<add before>
function ToggleAttend()
{
global $ID_MEMBER, $user_info, $db_prefix, $board, $topic, $modSettings, $options;

if ($user_info['is_guest'])
fatal_lang_error(138, false);

if (!allowedTo('calendar_view'))
fatal_lang_error(1, false);

if (empty($modSettings['cal_enabled']) || empty($modSettings['enable_attendees']))
fatal_lang_error('calendar_off', false);

$request = db_query("
SELECT id_event, attendees
FROM {$db_prefix}calendar
WHERE id_board = $board
AND id_topic = $topic
LIMIT 1", __FILE__, __LINE__);

$attendeeinfo = mysql_fetch_assoc($request);

if ($attendeeinfo['id_event'] != '')
{
$attendees = explode(',', $attendeeinfo['attendees']);
if (in_array("$ID_MEMBER", $attendees))
{
$thisArray[] = $ID_MEMBER;
$attendees = array_diff($attendees, $thisArray);
}
else
$attendees[] = $ID_MEMBER;

$attendees = implode(",", array_unique($attendees));
if (substr($attendees,0,1) == ',')
$attendees = substr($attendees,1);

$request = db_query("
UPDATE {$db_prefix}calendar
SET attendees='$attendees'
WHERE id_board = $board
AND id_topic = $topic
LIMIT 1", __FILE__, __LINE__);
}
redirectexit($_SERVER['HTTP_REFERER'], false);
}

function ToggleVCal()
{
global $user_info, $cookiename, $cookie_url, $modSettings, $options;

if ($user_info['is_guest'])
fatal_lang_error(138, false);

if (!allowedTo('calendar_view'))
fatal_lang_error(1, false);

if (empty($modSettings['cal_enabled']) || empty($modSettings['enable_vCal']) || empty($options['vCal_style']))
fatal_lang_error('calendar_off', false);

if (isset($_COOKIE[$cookiename . '-vcal']))
    $vCalList = explode(';', $_COOKIE[$cookiename . '-vcal']);
else
$vCalList = array();

   if (in_array($_GET['calid'], $vCalList))
     $vCalList = array_diff($vCalList, array($_GET['calid']));
else
     $vCalList[] = $_GET['calid'];

$vCalList = implode(";", array_unique($vCalList));

setcookie($cookiename . '-vcal', $vCalList, 0, $cookie_url[1], $cookie_url[0]);

redirectexit($_SERVER['HTTP_REFERER'], false);
}

function ShowVCal()
{
global $txt, $context, $db_prefix, $user_info, $cookiename, $modSettings, $options;

// This is gonna be needed...
loadTemplate('Calendar');

if ($user_info['is_guest'])
fatal_lang_error(138, false);

if (!allowedTo('calendar_view'))
fatal_lang_error(1, false);

if (empty($modSettings['cal_enabled']) || empty($modSettings['enable_vCal']) || empty($options['vCal_style']))
fatal_lang_error('calendar_off', false);

$context['page_title'] = $context['forum_name'] . ' : vCal/iCal : ' . $txt['vCal_view'];
$context['vcal']['list_empty'] = !isset($_COOKIE[$cookiename . '-vcal']);

if (!$context['vcal']['list_empty'])
{
    $context['vcal']['dlStyle'] = ($options['vCal_style'] == 1 ? 'vCal' : 'iCal');
$vCalList = explode(';', $_COOKIE[$cookiename . '-vcal']);

$request = db_query("
SELECT T1.id_event, T1.eventDate, T1.title FROM {$db_prefix}calendar AS T1
LEFT JOIN {$db_prefix}calendar AS T2
ON T1.id_topic=T2.id_topic
WHERE T1.id_event = " . implode(' OR T1.id_event = ', $vCalList) . "
ORDER BY T1.eventDate ASC", __FILE__, __LINE__);

$context['events'] = array();
while ($eventinfo = mysql_fetch_assoc($request))
{
if (!isset($context['events'][$eventinfo['id_event']]))
{
list($eventinfo['year'], $eventinfo['month'], $eventinfo['day']) = explode('-', $eventinfo['eventDate']);
$context['events'][$eventinfo['id_event']] = $eventinfo;
$context['events'][$eventinfo['id_event']]['span'] = 0;
}
$context['events'][$eventinfo['id_event']]['span'] = $context['events'][$eventinfo['id_event']]['span'] + 1;
}
}

// Set the sub template to the output.
$context['sub_template'] = 'show_vCal';

obExit();
}

function DownloadVCal()
{
global $context, $db_prefix, $user_info, $cookiename, $modSettings, $options;

if (!isset($_COOKIE[$cookiename . '-vcal']))
fatal_lang_error('vCal_empty', false);

if ($user_info['is_guest'])
fatal_lang_error(138, false);

if (!allowedTo('calendar_view'))
fatal_lang_error(1, false);

if (empty($modSettings['cal_enabled']) || empty($modSettings['enable_vCal']) || empty($options['vCal_style']))
fatal_lang_error('calendar_off', false);

if (isset($_COOKIE[$cookiename . '-vcal']))
{
$request = db_query("
SELECT cal.id_event, cal.eventDate, cal.title, mes.body, t.ID_FIRST_MSG, mes.ID_MSG
FROM {$db_prefix}calendar AS cal, {$db_prefix}messages AS mes, {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}calendar AS T2 ON cal.id_topic=T2.id_topic
LEFT JOIN {$db_prefix}topics AS T3 ON T3.ID_FIRST_MSG=cal.id_topic
WHERE (cal.id_event = " . implode(' OR cal.id_event = ', explode(';', $_COOKIE[$cookiename . '-vcal'])) . ")
AND mes.ID_MSG=t.ID_FIRST_MSG
AND cal.id_topic=mes.ID_TOPIC
ORDER BY cal.eventDate", __FILE__, __LINE__);

$trans_table = array_flip(get_html_translation_table(HTML_SPECIALCHARS));
$trans_table['''] = "'";
$trans_table['''] = "'";
$trans_table['$'] = "$";
$trans_table['&nbsp;'] = " ";
$trans_table['<br />'] = "=0D=0A";
$trans_table['<br>'] = "=0D=0A";

$context['events'] = array();
while ($eventinfo = mysql_fetch_assoc($request))
{
if (!isset($context['events'][$eventinfo['id_event']]))
{
list($eventinfo['year'], $eventinfo['month'], $eventinfo['day']) = explode('-', $eventinfo['eventDate']);
$eventinfo['body'] = strip_tags(strtr(doUBBC($eventinfo['body'],0), $trans_table));
$context['events'][$eventinfo['id_event']] = $eventinfo;
$context['events'][$eventinfo['id_event']]['span'] = 0;
}
$context['events'][$eventinfo['id_event']]['span'] = $context['events'][$eventinfo['id_event']]['span'] + 1;
}

if ($_REQUEST['dltype'] == 'iCal')
{
$fileExt = '.ics';
$vcalVersion = '2.0';

$repeatRule = '
RRULE:FREQ=DAILY;INTERVAL=1;COUNT={$eventinfo[\'span\']}';

}
else
{
$fileExt = '.vcs';
$vcalVersion = '1.0';

$repeatRule = '
RRULE:D1 {$endDate}';

}

$beginVCAL = 'BEGIN:VCALENDAR
PRODID:SMF Generated
VERSION:{$vcalVersion}
METHOD:PUBLISH
';

$beginEvent = '
BEGIN:VEVENT
UID:event-{$eventinfo[\'id_event\']}
DTSTAMP:' . gmdate("Ymd\THis") . 'Z
DTSTART:{$startDate}Z
DTEND:{$startDate2}Z';

$endEvent = '
SUMMARY:{$eventinfo[\'title\']}
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{$desc}
END:VEVENT

';

eval("\$vCalString = \"$beginVCAL\";");

foreach ($context['events'] as $eventinfo)
{
$startDate =  gmdate("Ymd\THis",  mktime(0, 0, 0, $eventinfo['month'], $eventinfo['day'], $eventinfo['year']));
$startDate2 =  gmdate("Ymd\THis",  mktime(0, 0, 0, $eventinfo['month'], $eventinfo['day'] + 1, $eventinfo['year']));
$endDate =  gmdate("Ymd",  mktime(0, 0, 0, $eventinfo['month'], $eventinfo['day'] + $eventinfo['span'] - 1, $eventinfo['year']));
$desc = $eventinfo['body'];

eval("\$vCalString .= \"$beginEvent\";");

if ($eventinfo['span'] > 1)
eval("\$vCalString .= \"$repeatRule\";");

eval("\$vCalString .= \"$endEvent\";");
}

$vCalString .= 'END:VCALENDAR

';

setCookie($cookiename . '-vcal', '');
header("Content-Encoding: none");
header("Content-type: octet/stream");
header("Content-disposition: filename=events$fileExt");
header('Cache-Control: private');
header('Connection: close');

echo $vCalString, "\r\n";

obExit(false);
}
}

</add before>

<edit file>
Sources/Display.php
</edit file>

<search for>
// Create the poll info if it exists.
</search for>

<add before>
  // Start with topic not linked to calendar.
$context['cal_linked'] = false;

// Get calendar event info... if one exists.
if (!$user_info['is_guest'] && allowedTo('calendar_view') && $modSettings['cal_enabled'] == '1')
{
$request = db_query("
SELECT id_event, attendees
FROM {$db_prefix}calendar
WHERE id_board = $board
AND id_topic = $topic
LIMIT 1", __FILE__, __LINE__);

$context['cal_linked'] = mysql_num_rows($request) == 1;

if ($context['cal_linked'])
$cal_info = mysql_fetch_assoc($request);
}

// Create the vCal/iCal section
if ($context['cal_linked'] && !empty($modSettings['enable_vCal']) && !empty($options['vCal_style']))
{
global $cookiename;
$context['vcal'] = $cal_info;
$context['vcal']['list_empty'] = !isset($_COOKIE[$cookiename . '-vcal']);
$context['vcal']['toggle_link'] = ((!$context['vcal']['list_empty'] && in_array($context['vcal']['id_event'], split(';', $_COOKIE[$cookiename . '-vcal']))) ? $txt['vCal_remove'] : $txt['vCal_add']);
$context['vcal']['dlStyle'] = ($options['vCal_style'] == 1 ? 'vCal' : 'iCal');
}

// Create the Attendees section
if ($context['cal_linked'] && !empty($modSettings['enable_attendees']))
{
$context['cal_attendees']['id_event'] = $cal_info['id_event'];
$attendees = $cal_info['attendees'];
$context['cal_attendees']['attendees'] = array();
$request = db_query("
SELECT ID_MEMBER, memberName, realName, location
FROM {$db_prefix}members
WHERE (FIND_IN_SET(ID_MEMBER, '$attendees'))
ORDER BY ID_MEMBER ASC", __FILE__, __LINE__);

while ($attendee = mysql_fetch_assoc($request))
$context['cal_attendees']['attendees'][] = $attendee;

if (in_array("$ID_MEMBER", explode(',', $attendees)))
$context['cal_attendees']['toggle_link'] = '<a href="' . $scripturl . '?action=toggleAttend;topic=' . $topic . '">' . $txt['cal_attend_no'] . '</a>';
else
$context['cal_attendees']['toggle_link'] = '<a href="' . $scripturl . '?action=toggleAttend;topic=' . $topic . '">' . $txt['cal_attend_yes'] . '</a>';
}

</add before>

<search for>
$context['calendar_post'] &= !empty($modSettings['cal_enabled']);
</search for>

<replace>
$context['calendar_post'] = !empty($modSettings['cal_enabled']) && (($modSettings['cal_defaultboard'] == $board));
</replace>

<edit file>
Sources/ModSettings.php
</edit file>

<search for>
// Who's online.
array('check', 'who_enabled'),
</search for>

<add after>
                  '',
           
        // Enable the vCal/iCal?
array('check', 'enable_vCal', &$txt['enable_vCal']),
// Enable the Attendee list?
array('check', 'enable_attendees', &$txt['enable_attendees']),
                  array('check', 'cal_force_default', &$txt['cal_force_default']),
array('check', 'cal_allow_no_post', &$txt['cal_allow_no_post']),
</add after>



<edit file>
Sources/Post.php
</edit file>

<search for>
// Posting an event?
$context['make_event'] = isset($_REQUEST['calendar']);
</search for>

<add after>
$context['cal_allow_no_post'] = $context['make_event'] && $modSettings['cal_allow_no_post'];
$context['cal_force_no_post'] = ($modSettings['cal_defaultboard'] == 0) && $modSettings['cal_force_default'] && (empty($_REQUEST['msg']) || $_REQUEST['msg'] == 0);
</add after>

<search for>
{
checkSession('get');

</search for>

<replace>
{
checkSession('get');
if ($_REQUEST['msg'] == 0)
{
$form_subject = '';
$form_message = '';
$context['icon'] = '';
}
else
{
</replace>

<search for>
// Set the destinaton.
</search for>

<add before>
}

</add before>

<search for>
// What are you doing?  Posting a poll, modifying, previewing, new post, or reply...
</search for>

<add before>
$context['cal_posting_denied'] = $context['cal_force_no_post'] || ($context['make_event'] && !$context['event']['new'] && $context['event']['board'] == 0);
</add before>

<search for>
'url' => $scripturl . '?topic=' . $topic . '.' . $_REQUEST['start'],
</search for>

<replace>
'url' => $scripturl . '?topic=' . $topic . '.' . (isset($_REQUEST['start']) ? $_REQUEST['start'] : 0),
</replace>







<edit file>
Themes/default/Calendar.template.php
</edit file>



<search for>
?>
</search for>

<add before>
function template_show_vCal()
{
global $context, $scripturl, $txt;

echo '
<table border="0" width="80%" cellspacing="0" align="center" cellpadding="4" class="tborder">
<tr>
<td class="titlebg"><b>vCal/iCal - ' . $txt['vCal_view'] . '</b></td>
</tr><tr>
<td class="windowbg">';

if (!$context['vcal']['list_empty'])
{
echo '
<script language="JavaScript" type="text/javascript">
<!--
var timerID = 0;
function refreshPage(id) {
if (id == 0) {
timerID = setTimeout("refreshPage(1)", 1000);
} else {
  clearTimeout(timerID);
window.location = "' . $scripturl . '?action=showVCal";
}
}
//-->
</script>';
foreach ($context['events'] as $eventinfo)
{
$startDate =  date("m/d/Y",  mktime(0, 0, 0, $eventinfo['month'] + 1, $eventinfo['day'], $eventinfo['year']));
$endDate =  date("m/d/Y",  mktime(0, 0, 0, $eventinfo['month'] + 1, $eventinfo['day'] + $eventinfo['span'] - 1, $eventinfo['year']));
echo $eventinfo['title'] . ' (' . $startDate;
if ($eventinfo['span'] > 1)
echo ' - ' . $endDate;
echo ') <a href="' . $scripturl . '?action=toggleVCal;calid=' . $eventinfo['id_event'] . '">' . $txt['vCal_remove'] . '</a><br>';
}
echo '<br><a href="', $scripturl, '?action=dlVCal;dltype=' . $context['vcal']['dlStyle'] . '" onClick="refreshPage(0)">' . $txt['vCal_download'] . '</a> (' . $context['vcal']['dlStyle'] . ')';
}
else
{
echo $txt['vCal_empty'];
}

echo '
</td>
</tr>
</table>
<div align="center" style="margin-top: 2ex;"><a href="javascript:history.go(-1)">' . $txt[193] . '</a></div>
';

}

</add before>

<edit file>
Themes/default/Display.template.php
</edit file>

<search for>
// Show the topic information - icon, subject, etc.
</search for>

<add before>
// Is this topic also linked to the calendar?
if ($context['cal_linked'])
{
if (!empty($context['cal_attendees']))
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="border-bottom: 0;">
<tr class="titlebg">
<td valign="middle" align="left" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/members.gif" alt="" align="top" /> ' . $txt['cal_attendee_title'] . '
</td>
</tr>
<tr class="windowbg">
<td>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td>';

if (empty($context['cal_attendees']['attendees']))
echo '<b>' . $txt['cal_attendees_no'] . '</b>';
else
{
echo '<b>' . $txt['cal_attendees_yes'] . '</b><br />';
foreach ($context['cal_attendees']['attendees'] as $attendee)
{
echo '
<a href="' . $scripturl . '?action=profile;u=' . $attendee['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $attendee['memberName'] . '">' . $attendee['memberName'] . ' (' . $attendee['realName'] . ')</a>';
if ($attendee['location'] != '')
echo ' - ' . $attendee['location'];
echo '<br />';
}
}

echo '
</td>
<td>&nbsp;</td>
<td>' . $context['cal_attendees']['toggle_link'] . '</td>
</td>
</tr>
</table>
</td>
</tr>
</table>';
}

if (!empty($context['vcal']))
{
echo '
   <!-- vCal/iCal -->
<script language="JavaScript" type="text/javascript">
<!--
var timerID = 0;
function refreshPage(id) {
if (id == 0) {
timerID = setTimeout("refreshPage(1)", 1000);
} else {
  clearTimeout(timerID);
window.location.reload();
}
}
//-->
</script>
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="border-bottom: 0;">
<tr class="titlebg">
<td valign="middle" align="left" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/calindex.gif" alt="" align="top" /> ' . $txt['vCal_title'] . '
</td>
</tr>
<tr class="windowbg">
<td>
<a href="', $scripturl, '?action=toggleVCal;calid=', $context['vcal']['id_event'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $context['vcal']['toggle_link'], '</a>';
if (!$context['vcal']['list_empty'])
{
echo '&nbsp;&nbsp;&nbsp;&nbsp;
<a href="', $scripturl, '?action=showVCal;topic=', $context['current_topic'], '.', $context['start'], '">' . $txt['vCal_view'] . '</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="', $scripturl, '?action=dlVCal;dltype=' . $context['vcal']['dlStyle'] . '" onClick="refreshPage(0)">' . $txt['vCal_download'] . '</a> (' . $context['vcal']['dlStyle'] . ')';
}
echo '
</td>
</tr>
</table>';
}
}

</add before>

<edit file>
Themes/default/languages/Modifications.english.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['vCal_title'] = 'vCal/iCal';
$txt['vCal_remove'] = 'Remove this event';
$txt['vCal_add'] = 'Add this event';
$txt['vCal_view'] = 'View List';
$txt['vCal_download'] = 'Download List';
$txt['vCal_empty'] = 'You have no events in your ' . $txt['vCal_title'] . ' list.';

$txt['cal_attendee_title'] = 'Attendees';
$txt['cal_attendees_no'] = 'No one is attending this event yet.';
$txt['cal_attendees_yes'] = 'Members planning to attend';
$txt['cal_attend_no'] = 'I\'ve changed my mind';
$txt['cal_attend_yes'] = 'I plan to attend this event';

$txt['enable_vCal'] = 'Enable vCal/iCal Downloads';
$txt['enable_attendees'] = 'Enable Attendee List';
$txt['cal_force_default'] = 'Force Default Board';
$txt['cal_allow_no_post'] = 'Allow Post No Topic';

$txt['cal_no_post'] = 'Post No Topic';

$txt['vCal_style'] = 'vCal/iCal download style:';
$txt['vCal_style1'] = 'Disable';
$txt['vCal_style2'] = 'vCal';
$txt['vCal_style3'] = 'iCal';

</add before>

<edit file>
Themes/default/languages/Modifications.german.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['vCal_title'] = 'vCal/iCal';
$txt['vCal_remove'] = 'Entfernen Sie diesen Fall';
$txt['vCal_add'] = 'Addieren Sie diesen Fall';
$txt['vCal_view'] = 'Ansicht-Liste';
$txt['vCal_download'] = 'Download-Liste';
$txt['vCal_empty'] = 'Sie haben keine Fälle in Ihrer ' . $txt['vCal_title'] . ' Liste.';

$txt['cal_attendee_title'] = 'Teilnehmer';
$txt['cal_attendees_no'] = 'Niemand sorgt sich diesen Fall schon.';
$txt['cal_attendees_yes'] = 'Mitglieder, die planen zu beachten';
$txt['cal_attend_no'] = 'Ich habe meinen Verstand geändert';
$txt['cal_attend_yes'] = 'Ich plane, mich diesen Fall zu sorgen';

$txt['enable_vCal'] = 'Ermöglichen Sie vCal/iCal Downloads';
$txt['enable_attendees'] = 'Ermöglichen Sie Teilnehmer-Liste';
$txt['cal_force_default'] = 'Kraft-Rückstellung Brett';
$txt['cal_allow_no_post'] = 'Erlauben Sie Pfosten Kein Thema';

$txt['cal_no_post'] = 'Geben Sie Kein Thema Bekannt';

$txt['vCal_style'] = 'vCal/iCal Downloadart:';
$txt['vCal_style1'] = 'Sperren Sie';
$txt['vCal_style2'] = 'vCal';
$txt['vCal_style3'] = 'iCal';

</add before>

<edit file>
Themes/default/languages/Modifications.spanish.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['vCal_title'] = 'vCal/iCal';
$txt['vCal_remove'] = 'Quite este acontecimiento';
$txt['vCal_add'] = 'Agregue este acontecimiento';
$txt['vCal_view'] = 'Lista De la Visión';
$txt['vCal_download'] = 'Lista De la Transferencia directa';
$txt['vCal_empty'] = 'Usted no tiene ningún acontecimiento en su lista de ' . $txt['vCal_title'];

$txt['cal_attendee_title'] = 'Asistentes';
$txt['cal_attendees_no'] = 'Nadie está atendiendo a este acontecimiento todavía.';
$txt['cal_attendees_yes'] = 'Miembros que planean atender';
$txt['cal_attend_no'] = 'He cambiado mi mente';
$txt['cal_attend_yes'] = 'Planeo atender a este acontecimiento';

$txt['enable_vCal'] = 'Permita las transferencias directas de vCal/iCal';
$txt['enable_attendees'] = 'Permita La Lista Del Asistente';
$txt['cal_force_default'] = 'Tablero Del Defecto De la Fuerza';
$txt['cal_allow_no_post'] = 'Prohiba A Poste Asunto';

$txt['cal_no_post'] = 'No fije Ningún Asunto';

$txt['vCal_style'] = 'Estilo de la transferencia directa de vCal/iCal:';
$txt['vCal_style1'] = 'Inhabilite';
$txt['vCal_style2'] = 'vCal';
$txt['vCal_style3'] = 'iCal';

</add before>

<edit file>
Themes/default/Post.template.php
</edit file>

<search for>
// Code for showing and hiding additional options.
if (!empty($settings['additional_options_collapsable']))
</search for>

<replace>
// Code for showing and hiding additional options.
if (!empty($settings['additional_options_collapsable']) && !$context['cal_posting_denied'])
</replace>

<search for>
echo '
<tr>
<td align="right"><b>', $txt['calendar13'], '</b></td>
<td class="smalltext">
<select name="board">';

foreach ($context['event']['boards'] as $board)
echo '
<option value="', $board['id'], '"', $board['id'] == $context['event']['board'] ? ' selected="selected"' : '', '>', $board['cat']['name'], ' - ', $board['prefix'], $board['name'], '</option>';

echo '
</select>
</search for>

<replace>
echo '
<tr>
<td align="right"><b>', $txt['calendar13'], '</b></td>
<td class="smalltext">';
if ($modSettings['cal_force_default'] && $modSettings['cal_allow_no_post'] && $context['event']['board'] != 0)
{
echo '
<select name="board">
<option value="0">' . $txt['cal_no_post'] . '</option>';
foreach ($context['event']['boards'] as $board)
if ($board['id'] == $context['event']['board'])
echo '
<option value="', $board['id'], '"', $board['id'] == $context['event']['board'] ? ' selected="selected"' : '', '>', $board['cat']['name'], ' - ', $board['prefix'], $board['name'], '</option>';
echo '
</select>';
}
else if ($modSettings['cal_force_default'])
{
echo '
<input type="hidden" name="board" value="', $context['event']['board'], '">';
if ($context['cal_force_no_post'])
echo $txt['cal_no_post'];
else
foreach ($context['event']['boards'] as $board)
if ($board['id'] == $context['event']['board'])
echo $board['cat']['name'], ' - ', $board['prefix'], $board['name'];
}
else
{
echo '
<select name="board">';
if ($context['cal_allow_no_post'])
echo '
<option value="0">' . $txt['cal_no_post'] . '</option>';
foreach ($context['event']['boards'] as $board)
echo '
<option value="', $board['id'], '"', $board['id'] == $context['event']['board'] ? ' selected="selected"' : '', '>', $board['cat']['name'], ' - ', $board['prefix'], $board['name'], '</option>';
echo '
</select>';
}

echo '
</replace>

<search for>
// Now show the subject box for this post.
</search for>

<add before>
if ($context['cal_posting_denied'])
{
echo '
<input type="hidden" name="cal_posting_denied" value="1">
<input type="hidden" name="subject" value="">
<input type="hidden" name="message" value="">
<input type="hidden" name="icon" value="">';
}
else
{
      }
</add before>

<search for>
// If the admin has enabled the hiding of the additional options - show a link and image for it.
if (!empty($settings['additional_options_collapsable']))
</search for>

<replace>
// If the admin has enabled the hiding of the additional options - show a link and image for it.
if (!empty($settings['additional_options_collapsable']) && !$context['cal_posting_denied'])
</replace>



<edit file>
Themes/default/Settings.template.php
</edit file>

<search for>
array(
'id' => 'return_to_post',
'label' => $txt['return_to_post'],
'default' => true,
),
</search for>

<add after>
array(
'id' => 'vCal_style',
'label' => $txt['vCal_style'],
'options' => array(
0 => $txt['vCal_style1'],
1 => $txt['vCal_style2'],
2 => $txt['vCal_style3']
),
),

</add after>


Hope you can work it out :)

confuzed

hi was that the right information jpdeni or do you need me to provide something else?

Thanks

JPDeni

I don't know how it works, really. I can't seem to figure it out by looking at the code. I'll see if I can figure it out by installing the mod on my test site and then see what I can do about creating a block for it. It'll likely take several days.

Heero

Another neat idea would be allowing users to sign up via an article which creates an automatic post upon their submission !
As I remember there is a block done which could possibly do this with a few additional edits ;)! Check this one out!

JPDeni

confuzed, where is the mod? I don't know which one to use. I need the whole package.


JPDeni

Cool. :) I got it.

I need a few people to sign up for an event so I can see how things look in the database. If you have a little bit of time, could you sign up for an account at http://www.jpdeni.com/snippets/index.php?action=forum and then say you want to attend the one event that I've got there. It's in General Discussion and the topic is "Really cool event." That'll help me to figure out how the information is stored in the database.

This website is proudly hosted on Crocweb Cloud Website Hosting.