SMF Gelişmiş Takvim paket + Manuel Kurulum

Son güncelleme: 17.01.2008 12:11
  • Sources/Calendar.php dosyasında

    Bul:

    // If the month and year are not passed in, use today's date as a starting point.
    $curPage = array( 'month' => isset($_REQUEST['month']) ? (int) $_REQUEST['month'] : $today['month'],
    'year' => isset($_REQUEST['year']) ? (int) $_REQUEST['year'] : $today['year']
    );

    Sonrasına ekle:

    $curPagePrev = array(
    'month' => isset($_REQUEST['month']) ? (int) $_REQUEST['month'] - 1 : $today['month'] - 1,
    'year' => isset($_REQUEST['year']) ? (int) $_REQUEST['year'] : $today['year'],
    );

    $curPageNext = array(
    'month' => isset($_REQUEST['month']) ? (int) $_REQUEST['month'] + 1 : $today['month'] + 1,
    'year' => isset($_REQUEST['year']) ? (int) $_REQUEST['year'] : $today['year'],
    );

    if ($curPagePrev['month'] < 1)
    {
    $curPagePrev['month'] = 12;
    $curPagePrev['year'] = $curPagePrev['year'] - 1;
    }
    else
    $curPagePrev['year'] = $curPagePrev['year'];


    if ($curPageNext['month'] > 12)
    {
    $curPageNext['month'] = 1;
    $curPageNext['year'] = $curPageNext['year'] + 1;
    }
    else
    $curPageNext['year'] = $curPageNext['year'];

    Bul:

    // Get information about the first day of this month.
    $firstDayOfMonth = array(
    'dayOfWeek' => (int) strftime('%w', mktime(0, 0, 0, $curPage['month'], 1, $curPage['year'])),
    'weekNum' => (int) strftime('%U', mktime(0, 0, 0, $curPage['month'], 1, $curPage['year']))
    );

    Sonrasına ekle:

    // Get information about the first day of tprevious month.
    $firstDayOfPrevMonth = array(
    'dayOfWeek' => (int) strftime('%w', mktime(0, 0, 0, $curPagePrev['month'], 1, $curPagePrev['year'])),
    'weekNum' => (int) strftime('%U', mktime(0, 0, 0, $curPagePrev['month'], 1, $curPagePrev['year']))
    );

    // Get information about the first day of tprevious month.
    $firstDayOfNextMonth = array(
    'dayOfWeek' => (int) strftime('%w', mktime(0, 0, 0, $curPageNext['month'], 1, $curPageNext['year'])),
    'weekNum' => (int) strftime('%U', mktime(0, 0, 0, $curPageNext['month'], 1, $curPageNext['year']))
    );

    Bul:

    // Find the last day of the month.
    $nLastDay = (int) strftime('%d', mktime(0, 0, 0, $curPage['month'] == 12 ? 1 : $curPage['month'] + 1, 0, $curPage['month'] == 12 ? $curPage['year'] + 1 : $curPage['year']));

    // The number of days the first row is shifted to the right for the starting day.
    $nShift = $firstDayOfMonth['dayOfWeek'];

    Değiştir:

    // Find the last day of the month.
    $nLastDayPrev = (int) strftime('%d', mktime(0, 0, 0, $curPagePrev['month'] == 12 ? 1 : $curPage['month'], 0, $curPagePrev['month'] == 12 ? $curPagePrev['year'] : $curPagePrev['year'] - 1));
    $nLastDay = (int) strftime('%d', mktime(0, 0, 0, $curPage['month'] == 12 ? 1 : $curPage['month'] + 1, 0, $curPage['month'] == 12 ? $curPage['year'] + 1 : $curPage['year']));
    $nLastDayNext= (int) strftime('%d', mktime(0, 0, 0, $curPageNext['month'] == 12 ? 1 : $curPageNext['month'], 0, $curPageNext['year']));

    // The number of days the first row is shifted to the right for the starting day.
    $nShiftPrev = $firstDayOfPrevMonth['dayOfWeek'];
    $nShift = $firstDayOfMonth['dayOfWeek'];
    $nShiftNext = $firstDayOfNextMonth['dayOfWeek'];

    Bul:

    if ($nShift < 0)
    $nShift = 7 + $nShift;

    Sonrasına ekle:

    $nShiftPrev -= $nStartDay;
    if ($nShiftPrev < 0)
    $nShiftPrev = 7 + $nShiftPrev;

    $nShiftNext -= $nStartDay;
    if ($nShiftNext < 0)
    $nShiftNext = 7 + $nShiftNext;

    Bul:

    if (($nLastDay + $nShift) % 7)
    $nRows++;

    Sonrasına ekle:


    // Number of rows required to fit the prev month.
    $nRowsPrev = floor(($nLastDayPrev + $nShiftPrev) / 7);
    if (($nLastDayPrev + $nShiftPrev) % 7)
    $nRowsPrev++;

    // Number of rows required to fit the next month.
    $nRowsNext = floor(($nLastDayNext + $nShiftNext) / 7);
    if (($nLastDayNext + $nShiftNext) % 7)
    $nRowsNext++;

    Bul:

    $low = $curPage['year'] . '-' . sprintf('%02d', $curPage['month']) . '-01';
    $high = $curPage['year'] . '-' . sprintf('%02d', $curPage['month']) . '-' . $nLastDay;

    Sonrasına Ekle:

    $lowPrev = $curPage['year'] . '-' . sprintf('%02d', $curPagePrev['month']) . '-01';
    $highPrev = $curPage['year'] . '-' . sprintf('%02d', $curPagePrev['month']) . '-' . $nLastDay;

    $lowNext = $curPage['year'] . '-' . sprintf('%02d', $curPageNext['month']) . '-01';
    $highNext = $curPage['year'] . '-' . sprintf('%02d', $curPageNext['month']) . '-' . $nLastDay;

    Bul:

    $context['current_month'] = $curPage['month'];
    $context['current_year'] = $curPage['year'];

    Sonrasına Ekle:

    $context['last_day_prev'] = $nLastDayPrev;
    $context['current_month_prev'] = $curPagePrev['month'];
    $context['current_year_prev'] = $curPagePrev['year'];

    $context['last_day_next'] = $nLastDayNext;
    $context['current_month_next'] = $curPageNext['month'];
    $context['current_year_next'] = $curPageNext['year'];

    Bul:

    // Start off the week - and don't let it go above 52, since that's the number of weeks in a year.
    $context['weeks'][$nRow] = array(
    'days' => array(),
    'number' => $firstDayOfMonth['weekNum'] + $nRow + $nWeekAdjust
    );
    // Handle the dreaded "week 53", it can happen, but only once in a blue moon ;)
    if ($context['weeks'][$nRow]['number'] == 53 && $nShift != 4)
    $context['weeks'][$nRow]['number'] = 1;

    Değiştir:

    // This is the week number assigned as a key to limit results to a certain week.
    $number = $firstDayOfMonth['weekNum'] + $nRow + $nWeekAdjust;

    // Start off the week - and don't let it go above 52, since that's the number of weeks in a year.
    $context['weeks'][$number] = array(
    'days' => array(),
    'number' => $firstDayOfMonth['weekNum'] + $nRow + $nWeekAdjust,
    'week' => $scripturl . '?action=calendar;year=' . $curPage['year'] . ';month=' . $curPage['month'] . ';week=' . $number,

    );
    // Handle the dreaded "week 53", it can happen, but only once in a blue moon ;)
    if ($context['weeks'][$number]['number'] == 53 && $nShift != 4)
    $context['weeks'][$number]['number'] = 1;

    Bul:

    $context['weeks'][$nRow]['days'][$nCol] = array(

    Değiştir:

    $context['weeks'][$number]['days'][$nCol] = array(

    Bul:

    'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
    );
    }
    }

    Sonrasına ekle:

    // Iterate through each week.
    $context['prevMonthWeeks'] = array();
    for ($nRowPrev = 0; $nRowPrev < $nRowsPrev; $nRowPrev++)
    {
    // This is the week number assigned as a key to limit results to a certain week.
    $number = $firstDayOfPrevMonth['weekNum'] + $nRowPrev + $nWeekAdjust + ($curPage['month'] == 1 ? -1 : 0);;

    // Start off the week - and don't let it go above 52, since that's the number of weeks in a year.
    $context['prevMonthWeeks'][$number] = array(
    'days' => array(),
    'number' => $firstDayOfPrevMonth['weekNum'] + $nRowPrev + $nWeekAdjust,
    'week' => $scripturl . '?action=calendar;year=' . $curPagePrev['year'] . ';month=' . $curPagePrev['month'] . ';week=' . $number,
    );
    // Handle the dreaded "week 53", it can happen, but only once in a blue moon ;)
    if ($context['prevMonthWeeks'][$number]['number'] == 53 && $nShiftPrev != 4)
    $context['prevMonthWeeks'][$number]['number'] = 1;

    // And figure out all the days.
    for ($nCol = 0; $nCol < 7; $nCol++)
    {
    $nDay = ($nRowPrev * 7) + $nCol - $nShiftPrev + 1;

    if ($nDay < 1 || $nDay > $context['last_day_prev'])
    $nDay = 0;

    $date = sprintf('%04d-%02d-%02d', $curPagePrev['year'], $curPagePrev['month'], $nDay);

    $context['prevMonthWeeks'][$number]['days'][$nCol] = array(
    'day' => $nDay,
    'date' => $date,
    'is_today' => $date == $today['date'],
    'is_first_day' => !empty($modSettings['cal_showweeknum']) && (($firstDayOfPrevMonth['dayOfWeek'] + $nDay - 1) % 7 == $nStartDay),
    );
    }
    }

    $context['nextMonthWeeks'] = array();
    for ($nRowNext = 0; $nRowNext < $nRowsNext; $nRowNext++)
    {
    // This is the week number assigned as a key to limit results to a certain week.
    $number = $firstDayOfNextMonth['weekNum'] + $nRowNext + $nWeekAdjust + ($curPage['month'] == 12 ? 1 : 0);

    // Start off the week - and don't let it go above 52, since that's the number of weeks in a year.
    $context['nextMonthWeeks'][$number] = array(
    'days' => array(),
    'number' => $firstDayOfNextMonth['weekNum'] + $nRowNext + $nWeekAdjust,
    'week' => $scripturl . '?action=calendar;year=' . $curPageNext['year'] . ';month=' . $curPageNext['month'] . ';week=' . $number,

    );
    // Handle the dreaded "week 53", it can happen, but only once in a blue moon ;)
    if ($context['nextMonthWeeks'][$number]['number'] == 53 && $nShiftNext != 4)
    $context['nextMonthWeeks'][$number]['number'] = 1;

    // And figure out all the days.
    for ($nCol = 0; $nCol < 7; $nCol++)
    {
    $nDay = ($nRowNext * 7) + $nCol - $nShiftNext + 1;

    if ($nDay < 1 || $nDay > $context['last_day_prev'])
    $nDay = 0;

    $date = sprintf('%04d-%02d-%02d', $curPageNext['year'], $curPageNext['month'], $nDay);

    $context['nextMonthWeeks'][$number]['days'][$nCol] = array(
    'day' => $nDay,
    'date' => $date,
    'is_today' => $date == $today['date'],
    'is_first_day' => !empty($modSettings['cal_showweeknum']) && (($firstDayOfNextMonth['dayOfWeek'] + $nDay - 1) % 7 == $nStartDay),
    'week' => $scripturl . '?action=calendar;year=' . $curPageNext['year'] . ';month=' . $curPageNext['month'] . ';week=' . $number,
    );
    }
    }


    Kullandığın Tema/Calendar.template.php

    Bul:

    <table cellspacing="1" cellpadding="2" width="100%" class="bordercolor">
    <tr class="titlebg"><td style="font-size: x-large;" align="center" colspan="7">', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], '</td></tr>
    <tr>';

    Değiştir:

    <table cellspacing="4" cellpadding="2" width="100%">
    <tr>
    <td valign="top">
    <table cellspacing="1" cellpadding="2" width="100%">';

    // The previous month
    if (isset($context['previous_calendar']))
    {
    echo '
    <tr>
    <td>
    <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">
    <tr class="titlebg">
    <td align="center" colspan="8" style="padding: 5px;">
    ', $txt['months_titles'][$context['current_month_prev']], ' ', $context['current_year_prev'], '
    </td>
    </tr>
    <tr>
    <td class="titlebg2"> </td>';

    // Show each day of the week.
    foreach ($context['week_days'] as $day)
    echo '
    <td class="titlebg2" width="14%" align="left">', substr($txt['days'][$day], 0, 1), '</td>';

    echo '
    </tr>';

    /* Each week in weeks contains the following:
    days (a list of days), number (week # in the year.) */
    foreach ($context['prevMonthWeeks'] as $week)
    {
    echo '
    <tr>
    <td class="titlebg2"><a href="', $week['week'], '">»</a></td>';

    /* Every day has the following:
    day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?),
    holidays, events, birthdays. (last three are lists.) */
    foreach ($week['days'] as $day)
    {
    // If this is today, make it a different color and show a border.
    echo '
    <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : 'windowbg'), '">';

    // Skip it if it should be blank - it's not a day if it has no number.
    if (!empty($day['day']))
    echo
    $day['day'];

    echo '
    </td>';
    }

    echo '
    </tr>';
    }

    echo '
    </table>
    </td>
    </tr>
    <tr>
    <td> </td>
    </tr>';
    }

    // Current month
    echo '
    <tr>
    <td>
    <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">';
    echo'
    <tr class="titlebg">
    <td align="center" colspan="8" style="padding: 5px;">
    ', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], '
    </td>
    </tr>
    <tr>
    <td class="titlebg2"> </td>';

    Bul:

    foreach ($context['week_days'] as $day)
    echo '
    <td class="titlebg2" width="14%" align="center">', $txt['days'][$day], '</td>';
    echo '
    </tr>';

    Değiştir:

    foreach ($context['week_days'] as $day)
    echo '
    <td class="titlebg2" width="14%" align="center">', substr($txt['days'][$day], 0, 1), '</td>';

    echo '
    </tr>';

    Bul:

    foreach ($context['weeks'] as $week)
    {
    echo '
    <tr>';

    Değiştir:

    foreach ($context['weeks'] as $week)
    {
    // This is used to highlight the current week.
    $currentWeek = isset($_REQUEST['week']) && $_REQUEST['week'] == $week['number'];

    echo '
    <tr class="bordercolor" cellspacing="1" cellpadding="2">
    <td class="titlebg2"><a href="', $week['week'], '">»</a></td>';

    Bul:

    // If this is today, make it a different color and show a border.
    echo '
    <td valign="top" style="height: 100px; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : 'windowbg' , '">';

    // Skip it if it should be blank - it's not a day if it has no number.
    if (!empty($day['day']))
    {
    // Should the day number be a link?
    if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
    echo '
    <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';day=', $day['day'], ';sesc=', $context['session_id'], '">', $day['day'], '</a>';
    else
    echo '
    ', $day['day'];

    // Is this the first day of the week? (and are we showing week numbers?)
    if ($day['is_first_day'])
    echo '<span class="smalltext"> - ', $txt['calendar51'], ' ', $week['number'], '</span>';

    // Are there any holidays?
    if (!empty($day['holidays']))
    echo '
    <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode([/swf2][swf3], $day['holidays']), '</div>';

    // Show any birthdays...
    if (!empty($day['birthdays']))
    {
    echo '
    <div class="smalltext">
    <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> ';

    /* Each of the birthdays has:
    id, name (person), age (if they have one set?), and is_last. (last in list?) */
    foreach ($day['birthdays'] as $member)
    echo '
    <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '[/swf2][swf3]</a>', $member['is_last'] ? '' : [/swf2][swf3];
    echo '
    </div>';
    }

    // Any special posted events?
    if (!empty($day['events']))
    {
    echo '
    <div class="smalltext">
    <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>';
    /* The events are made up of:
    title, href, is_last, can_edit (are they allowed to?), and modify_href. */
    foreach ($day['events'] as $event)
    {
    // If they can edit the event, show a star they can click on....
    if ($event['can_edit'])
    echo '
    <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> ';

    echo '
    ', $event['link'], $event['is_last'] ? '' : [/swf2][swf3];
    }
    echo '
    </div>';
    }
    }

    echo '
    </td>';
    }

    echo '
    </tr>';
    }

    echo '
    </table>

    Değiştir:

    // If this is today, make it a different color and show a border.
    echo '
    <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : ($currentWeek ? 'windowbg2' : 'windowbg')), '">';

    // Skip it if it should be blank - it's not a day if it has no number.
    if (!empty($day['day']))
    echo
    $day['day'];

    echo '
    </td>';
    }

    echo '
    </tr>';
    }

    echo '
    </table>
    </td>
    </tr>';

    if (isset($context['next_calendar']))
    {
    echo '
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td>
    <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">';
    echo'
    <tr class="titlebg">
    <td align="center" colspan="8" style="padding: 5px;">
    ', $txt['months_titles'][$context['current_month_next']], ' ', $context['current_year_next'], '
    </td>
    </tr>
    <tr>
    <td class="titlebg2"> </td>';

    // Show each day of the week.
    foreach ($context['week_days'] as $day)
    echo '
    <td class="titlebg2" width="14%" align="center">', substr($txt['days'][$day], 0, 1), '</td>';

    echo '
    </tr>';

    /* Each week in weeks contains the following:
    days (a list of days), number (week # in the year.) */
    foreach ($context['nextMonthWeeks'] as $week)
    {
    echo '
    <tr>
    <td class="titlebg2"><a href="', $week['week'], '">»</a></td>';

    /* Every day has the following:
    day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?),
    holidays, events, birthdays. (last three are lists.) */
    foreach ($week['days'] as $day)
    {
    // If this is today, make it a different color and show a border.
    echo '
    <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : ((empty($day['day']) || isset($_REQUEST['week']) && $week['week'] == $_REQUEST['week']) ? 'windowbg3' : 'windowbg'), '">';

    // Skip it if it should be blank - it's not a day if it has no number.
    if (!empty($day['day']))
    echo
    $day['day'];

    echo '
    </td>';
    }

    echo '
    </tr>';
    }

    echo '
    </table>
    </td>
    </tr>';
    }

    echo'
    </table>
    </td>
    <td width="80%" valign="top">
    <table cellspacing="1" cellpadding="2" width="100%" class="bordercolor">';

    if (isset($_REQUEST['week']) && (int) $_REQUEST['week'] <= 53 && (int)$_REQUEST['week'] > 0)
    {
    // Set the vars used for prev and next week vars
    if ($_REQUEST['week'] == 1 && isset($context['prevMonthWeeks'][53]['week']))
    {
    $prevWeek = 53;
    $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks';
    }
    elseif ($_REQUEST['week'] == 1 && isset($context['weeks'][52]['week']))
    {
    $prevWeek = 52;
    $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks';
    }
    else
    {
    $prevWeek = $_REQUEST['week'] - 1;
    $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks';
    }

    // Next week vars
    if ($_REQUEST['week'] == 52 && isset($context['weeks'][53]['week']))
    {
    $nextWeek = 53;
    $nextWeeks = 'weeks';
    }
    elseif ($_REQUEST['week'] == 53)
    {
    $nextWeek = 1;
    $nextWeeks = isset($context['weeks'][$nextWeek]['week']) ? 'weeks' : 'nextMonthWeeks';
    }
    else
    {
    $nextWeek = $_REQUEST['week'] + 1;
    $nextWeeks = isset($context['weeks'][$nextWeek]['week']) ? 'weeks' : 'nextMonthWeeks';
    }

    echo '
    <tr class="titlebg">
    <td style="font-size: large;" align="center" colspan="7">
    <a href="', $context[$prevWeeks][$prevWeek]['week'], '">«</a>
     ', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], ' 
    <a href="', $context[$nextWeeks][$nextWeek]['week'], '">»</a>
    </td>
    </tr>';

    // This var is used to determine if the first day of week is sunday or monday
    $weekOffset = !empty($options['calendar_start_day']) ? $options['calendar_start_day'] : 0;
    foreach ($context['weeks'][$_REQUEST['week']]['days'] as $day)
    {
    echo '
    <tr class="windowbg3">
    <td style="padding: 5px; font-size: small; font-weight: bold;" colspan="2">
    <div style="text-align: left; margin: 0;">
    ', $txt['days'][$weekOffset], '
    ', !empty($day['day']) ? '<span style="float: right;"><a href="' . $scripturl . '?action=calendar;sa=post;month=' . $context['current_month'] . ';year=' . $context['current_year'] . ';day=' . $day['day'] . ';sesc=' . $context['session_id'] . '">' . $txt['calendar23'] . '</a></span>' : '[/swf2][swf3]
    </div>
    </td>';

    echo '
    </tr>';

    echo '
    <tr class="windowbg2">
    <td width="5%" align="center" class="', empty($day['day']) ? 'windowbg2' : 'windowbg[/swf2][swf3]" style="padding: 4px; font-size: small;">
    ', empty($day['day']) ? ' ' : $day['day'], '
    </td>
    <td width="95%">';

    // Are there any holidays?
    if (!empty($day['holidays']))
    echo '
    <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode([/swf2][swf3], $day['holidays']), '</div>';

    // Show any birthdays...
    if (!empty($day['birthdays']))
    {
    echo '
    <div class="smalltext">
    <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> ';

    /* Each of the birthdays has:
    id, name (person), age (if they have one set?), and is_last. (last in list?) */
    foreach ($day['birthdays'] as $member)
    echo '
    <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '[/swf2][swf3]</a>', $member['is_last'] ? '' : [/swf2][swf3];
    echo '
    </div>';
    }

    // Any special posted events?
    if (!empty($day['events']))
    {
    echo '
    <div class="smalltext">
    <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>';

    /* The events are made up of:
    title, href, is_last, can_edit (are they allowed to?), and modify_href. */
    foreach ($day['events'] as $event)
    {
    // If they can edit the event, show a star they can click on....
    if ($event['can_edit'])
    echo '
    <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> ';

    echo '
    ', $event['link'], $event['is_last'] ? '' : [/swf2][swf3];
    }
    echo '
    </div>';
    }

    echo '
    </td>
    </tr>';

    if ($context['last_day'] == $day['day'])
    echo '
    <tr class="titlebg2">
    <td height="10" colspan="2"></td>
    </tr>';

    // This is used to set the offset between days depending if a week starts on sunday or monday
    $weekOffset++;
    if ($weekOffset == 7)
    $weekOffset = 0;
    }
    }
    else
    {
    echo '
    <tr>';

    // Show each day of the week.
    foreach ($context['week_days'] as $day)
    echo '
    <td class="titlebg2" width="14%" align="center">', $txt['days'][$day], '</td>';
    echo '
    </tr>';

    /* Each week in weeks contains the following:
    days (a list of days), number (week # in the year.) */
    foreach ($context['weeks'] as $week)
    {
    echo '
    <tr>';

    /* Every day has the following:
    day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?),
    holidays, events, birthdays. (last three are lists.) */
    foreach ($week['days'] as $day)
    {
    // If this is today, make it a different color and show a border.
    echo '
    <td valign="top" style="height: 100px; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : 'windowbg'), '">';

    // Skip it if it should be blank - it's not a day if it has no number.
    if (!empty($day['day']))
    {
    // Should the day number be a link?
    if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
    echo '
    <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';day=', $day['day'], ';sesc=', $context['session_id'], '">', $day['day'], '</a>';
    else
    echo '
    ', $day['day'];

    // Is this the first day of the week? (and are we showing week numbers?)
    if ($day['is_first_day'])
    echo '
    <span class="smalltext"> - ', $txt['calendar51'], ' ', $week['number'], '</span>';

    // Are there any holidays?
    if (!empty($day['holidays']))
    echo '
    <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';">
    ', $txt['calendar5'], ' ', implode([/swf2][swf3], $day['holidays']), '
    </div>';

    // Show any birthdays...
    if (!empty($day['birthdays']))
    {
    echo '
    <div class="smalltext">
    <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> ';

    /* Each of the birthdays has:
    id, name (person), age (if they have one set?), and is_last. (last in list?) */
    foreach ($day['birthdays'] as $member)
    echo '
    <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '[/swf2][swf3]</a>', $member['is_last'] ? '' : [/swf2][swf3];
    echo '
    </div>';
    }

    // Any special posted events?
    if (!empty($day['events']))
    {
    echo '
    <div class="smalltext">
    <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>';

    /* The events are made up of:
    title, href, is_last, can_edit (are they allowed to?), and modify_href. */
    foreach ($day['events'] as $event)
    {
    // If they can edit the event, show a star they can click on....
    if ($event['can_edit'])
    echo '
    <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> ';

    echo '
    ', $event['link'], $event['is_last'] ? '' : [/swf2][swf3];
    }
    echo '
    </div>';
    }
    }

    echo '
    </td>';
    }

    echo '
    </tr>';
    }
    }
    echo '
    </table>
    </td>
    </tr>
    </table>

    alıntıdır.


#17.01.2008 12:11 0 0 0