[2.0.4] Datum eines Ereignisses von dem Title (Kalender)

In diesem Forum können Mod-Autoren ihre Mods vorstellen, die sich noch im Entwicklungsstatus befinden. Der Einbau in Foren im produktiven Betrieb wird nicht empfohlen.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Lowtechmatt
Mitglied
Beiträge: 54
Registriert: 13.06.2003 12:04
Kontaktdaten:

Beitragvon Lowtechmatt » 16.10.2003 09:27

Also ich hatte den Mod mal auf nem 4er board laufen, da ging der, aber ist schon nen Weilchen her, denke da kann dir nur der Entwickler des Mods helfen...

Wär auch schon wenn sich jemand meinem Problem annehmen könnte...

Lowtechmatt
Mitglied
Beiträge: 54
Registriert: 13.06.2003 12:04
Kontaktdaten:

Beitragvon Lowtechmatt » 19.10.2003 19:36

Fühlt sich denn hier keiner Verantwortlich? :(

Benutzeravatar
Budowelt
Mitglied
Beiträge: 94
Registriert: 11.08.2003 09:38

Beitragvon Budowelt » 20.10.2003 16:52

Wie es auschaut niemand der hier noch was postet !?

Benutzeravatar
neo18tilidie
Mitglied
Beiträge: 56
Registriert: 23.02.2003 13:47
Kontaktdaten:

Beitragvon neo18tilidie » 20.10.2003 17:36

edit: TEXT UPDATED

mag daran liegen, dass draus nie ein mod werden sollte??? :roll:


testet mal das

mycalendar_body2.tpl:

Code: Alles auswählen

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;</td>
<td align=right width=176 nowrap=nowrap><img src="/images/menu_top_s_u.gif"></td>
</tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">   <tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
   <tr>
      <td height="4" background="/templates/neues_menu/images/nav_line_1.gif"></td>
      <td rowspan="2" width="11" nowrap="nowrap" valign="bottom" background="/templates/neues_menu/images/nav_2_r.gif"></td>
      <td height="4"></td>
      <td width="7" nowrap="nowrap"></td>
      <td height="4"></td>
      <td width="7" nowrap="nowrap"></td>

      <td height="4"></td>
      <td width="7" nowrap="nowrap"></td>
      <td height="4"></td>
      <td width="7" nowrap="nowrap"></td>
      <td rowspan="2" width="100%" valign="middle" align="right" class="gensmall" background="/templates/neues_menu/images/nav_line_2.gif">&nbsp;</td>


   </tr>
   <tr>
      <td height="16" nowrap="nowrap" bgcolor="#111c47">&nbsp;&nbsp;<span class="nav">{L_MONATSNAME}</span>&nbsp;&nbsp;</td>
      <td nowrap="nowrap" valign=top align="center" background="/templates/neues_menu/images/nav_line_3.gif"><span class="gensmall">&nbsp;&nbsp;<a href="/event_tips.php">Event Tips</nobr></a>&nbsp;&nbsp;</td>
      <td nowrap="nowrap" valign="bottom" background="/templates/neues_menu/images/nav_5_r.gif"></td>
      <td nowrap="nowrap" valign=top align="center" background="/templates/neues_menu/images/nav_line_3.gif"><span class="gensmall">&nbsp;&nbsp;{L_ALL_EVENTS_HEUTE}&nbsp;&nbsp;</td>
      <td nowrap="nowrap" valign="bottom" background="/templates/neues_menu/images/nav_5_r.gif"></td>
      <td nowrap="nowrap" valign=top align="center" background="/templates/neues_menu/images/nav_line_3.gif"><span class="gensmall">&nbsp;&nbsp;<a href="/posting.php?mode=newtopic&f=1">Event hinzufügen</a>&nbsp;&nbsp;</td>
      <td nowrap="nowrap" valign="bottom" background="/templates/neues_menu/images/nav_5_r.gif"></td>
      <td nowrap="nowrap" valign=top align="center" background="/templates/neues_menu/images/nav_line_3.gif"><span class="gensmall">&nbsp;&nbsp;<a href="/posting.php?mode=newtopic&f=40">Disco Event hinzufügen</a>&nbsp;&nbsp;</td>
      <td nowrap="nowrap" valign="bottom" background="/templates/neues_menu/images/nav_5_e.gif"></td>


   </tr>
</table><td width=6>&nbsp;</td>
</tr></table>



<table border="0" bgcolor="#111c47"  cellpadding="0" cellspacing="0" width="100%">
<tr><td>


<center>


<br>
<table border=0 width=95% cellspacing=1 cellpadding=4 bgcolor="#090E31">
<tr>


<td align=left class=row2><span class=gensmall><a href="{U_PREV_MONTH}">vorheriger Monat</a></td>
<td class=row2 align=center><b><span class="gensmall">{KOMMENDE_EVENTS} aktuelle Events gefunden</td>
<td align=right class=row2><span class=gensmall><a href="{U_NEXT_MONTH}">nächster Monat</a></td>

</tr>
</table>
<br>
<small>{L_MINI_KAL} |
 </small><p>




      <table border="0" class=forumline cellpadding="0" cellspacing="1" width="95%" align=center><tr><td>
      <table border="0" cellpadding="0" bgcolor="#101b3c" cellspacing="0" width="100%" align=center>
<tr><td colspan=2 align=center><br></td></tr>

  <!-- BEGIN date_row -->

    <!-- BEGIN date_cell -->

      <!-- BEGIN switch_date_cells -->



<tr><td colspan=2 align=center><img src="/templates/neues_menu/background.gif" vspace=2 height=1 width=97%></td></tr>

        <tr>
          <td valign="top" height="1" colspan=2>
          <!-- BEGIN switch_date_today -->
<a name="heute"></a>
<a name="{date_row.date_cell.DATE}"></a>          <span class="mainmenu">&nbsp;&nbsp;&nbsp;&nbsp;<b>{date_row.date_cell.WEEKDAY}, {date_row.date_cell.DATE}. {date_row.date_cell.MONTH}</b></span></td>
          <!-- END switch_date_today -->
          <!-- BEGIN switch_date_otherday -->
<a name="{date_row.date_cell.DATE}"></a>
          <span class="mainmenu">&nbsp;&nbsp;&nbsp;&nbsp;{date_row.date_cell.WEEKDAY}, {date_row.date_cell.DATE}. {date_row.date_cell.MONTH}</span></td>
          <!-- END switch_date_otherday -->

</tr>
<tr><td colspan=2 align=center><img src="/templates/neues_menu/background.gif" vspace=2 height=1 width=97%></td></tr>
     <tr>
          <td valign="top" height="2" align="right" width=30>&nbsp;</td>
     <td valign="top" >
          <!-- BEGIN date_event -->

<table border=0 cellpadding="0" cellspacing="0" width=98%><tr><td width=50%><span class="gensmall">
&nbsp;&nbsp;&nbsp;&nbsp;{date_row.date_cell.switch_date_cells.date_event.U_EVENT}</td>
<td width=24%><span class="gensmall">{date_row.date_cell.switch_date_cells.date_event.C_LOCATION}</td>
<td width=17%><span class="gensmall">{date_row.date_cell.switch_date_cells.date_event.C_STADT}</td>
<td width=3% title="ext. Link">{date_row.date_cell.switch_date_cells.date_event.C_URL}</td>
<td width=3% title="Review/Bilder">{date_row.date_cell.switch_date_cells.date_event.C_PICS}</td>
<td width=3% align=right title="{date_row.date_cell.switch_date_cells.date_event.C_REPLIES} Kommentare"><span class="gensmall">{date_row.date_cell.switch_date_cells.date_event.C_REPLIES}</td>
</tr></table>
          <!-- END date_event -->
          </td>
        </tr>
<tr><td colspan=2 align=center>&nbsp;<br></td></tr>



      <!-- END switch_date_cells -->
    <!-- END date_cells -->

  <!-- END date_rows -->
      </table>
</td></tr></table>
{L_ERROR}
<p>
<table border=0 width=95% cellspacing=1 cellpadding=4 bgcolor="#090E31">
<tr>


<td align=left class=row2><span class=gensmall><a href="{U_PREV_MONTH}">vorheriger Monat</a></td>
<td align=center class=row2><span class=gensmall>
{VERGANGENE_EVENTS} Events im Archiv | {EVENT_COMMENTS} Comments

<td align=right class=row2><span class=gensmall><a href="{U_NEXT_MONTH}">nächster Monat</a></td>

</tr>
</table>
<br><p>

<p><center><b>
<a href="/posting.php?mode=newtopic&f=1">Event hinzufügen</a> | <a href="/posting.php?mode=newtopic&f=40">Disco Event hinzufügen</a>
</b><br>
Oder Event Tips per eMail einsenden: <a href="mailto:events@party-cam.org">events@party-cam.org</a><p>
</td>
<td background="/templates/neues_menu/images/shadow_n_r.gif" width=6 valign=top><img src="/templates/neues_menu/images/shadow_n_ro.gif"></td>
</tr>
<tr>
<td background="/templates/neues_menu/images/shadow_n_u.gif"><img src="/templates/neues_menu/images/shadow_n_l.gif"></td>
<td width=6><img src="/templates/neues_menu/images/shadow_n_ru.gif"></td>
</tr>
</table>






events.php:

Code: Alles auswählen

<?php
#################################################################
## Mod Title:mycalendar Mod w/selected forum integration
## Mod Version: 2.2.7
## Author: marksten
## Author: mojavelinux <dan@mojavelinux.com>
## Description: Enables users to add events to the calendar
##              through a chosen forum.
#################################################################

$phpbb_root_path = './';
define('IN_PHPBB', true);
include_once $phpbb_root_path . 'extension.inc';
include_once $phpbb_root_path . 'common.'.$phpEx;
include_once $phpbb_root_path . 'includes/bbcode.'.$phpEx;
// Start session management
$userdata = session_pagestart($user_ip, PAGE_MYCALENDAR);
init_userprefs($userdata);



   $sqlmonat = 'SELECT MONTH(CURDATE()) as curmonat';
   if( $resultmonat = $db->sql_query($sqlmonat) )
   {
         while ($monat = $db->sql_fetchrow($resultmonat))
      {    $curmonat = $monat[curmonat]; }

      }

   $sql = 'SELECT DAYOFMONTH(CURDATE()) as curtag';
   if( $result = $db->sql_query($sql) )
   {
         while ($row = $db->sql_fetchrow($result))
      {    $curtag = $row[curtag]; }

      }

   $sqljahr = 'SELECT YEAR(CURDATE()) as curjahr';
   if( $resultjahr = $db->sql_query($sqljahr) )
   {
         while ($jahr = $db->sql_fetchrow($resultjahr))
      {    $curjahr = $jahr[curjahr]; }

      }


$current_datum = $curjahr . '-' . $curmonat . '-' . sprintf('%02d', $curtag) . ' 00:00:00';

    if( isset($HTTP_GET_VARS['monat']) || isset($HTTP_POST_VARS['monat']) )
    {
       $cal_monat = ( isset($HTTP_POST_VARS['monat']) ) ? intval($HTTP_POST_VARS['monat']) : intval($HTTP_GET_VARS['monat']);
    }

    else if( isset($HTTP_GET_VARS['month']) || isset($HTTP_POST_VARS['month']) )
    {
       $cal_monat = ( isset($HTTP_POST_VARS['month']) ) ? intval($HTTP_POST_VARS['month']) : intval($HTTP_GET_VARS['month']);
    }

    else
    {
    $cal_monat = $curmonat;
    }


    if( isset($HTTP_GET_VARS['jahr']) || isset($HTTP_POST_VARS['jahr']) )
    {
       $cal_jahr = ( isset($HTTP_POST_VARS['jahr']) ) ? intval($HTTP_POST_VARS['jahr']) : intval($HTTP_GET_VARS['jahr']);
    }

    else
    {
    $cal_jahr = $curjahr;
    }


    if( isset($HTTP_GET_VARS['tag']) || isset($HTTP_POST_VARS['tag']) )
    {
       $cal_tag = ( isset($HTTP_POST_VARS['tag']) ) ? intval($HTTP_POST_VARS['tag']) : intval($HTTP_GET_VARS['tag']);
    }

    else
    {
    $cal_tag = $curtag;
    }






// determine the information for the current date
list($today['year'], $today['month'], $today['day']) = explode('-', create_date('Y-m-d', time(), $board_config['board_timezone']));

// get the month/year offset from the get variables, or else use first day of this month
if (isset($HTTP_GET_VARS['month']) && isset($HTTP_GET_VARS['year'])) {
    $view_isodate = sprintf('%04d', $HTTP_GET_VARS['year']) . '-' . sprintf('%02d', $HTTP_GET_VARS['month']) . '-01 00:00:00';
}
// get the first day of the month as an isodate
else {
    $view_isodate = $today['year'] . '-' . $today['month'] . '-01 00:00:00';
}

// setup the current view information
$query = "SELECT
             MONTHNAME('$view_isodate') as monthName,
             DATE_FORMAT('$view_isodate', '%m') as month,
             DAYOFWEEK('$view_isodate') as cal_weekday,
             YEAR('$view_isodate') as year,
             DATE_FORMAT(CONCAT(YEAR('$view_isodate'), '-', MONTH('$view_isodate' + INTERVAL 1 MONTH), '-01') - INTERVAL 1 DAY, '%e') as numDays,
             WEEKDAY('$view_isodate') as offset";
$result = $db->sql_query($query);
$monthView = $db->sql_fetchrow($result);
$monthView['monthName'] = $lang['datetime'][$monthView['monthName']];


$l_monat = "Events im ".$monthView['monthName']."</b>";


// [*] is this going to give us a negative number ever?? [*]
if (!$lang['Calendar_start_monday']) {
    $monthView['offset']++;
}

// set the page title and include the page header
$page_title = $lang['View_calendar'];
include ($phpbb_root_path . 'includes/page_portal.'.$phpEx);

$template->set_filenames(array(
    'body' => 'mycalendar_body2.tpl')
);

// prepare the loops for running through the calendar for the current month
$numRows = ceil(($monthView['numDays'] + $monthView['offset']) / 1);
$day = 1;
$weekday = $monthView['cal_weekday'];
$weekday = ( $weekday - 1 );
$eventStack = array();
$topicCache = array();
foreach(range(1, $numRows) as $row) {

    $template->assign_block_vars('date_row', array());
    foreach (range(1, 1) as $weekIndex) {






        // we are before the first date
        if ( ($row == 1 && $weekIndex <= $monthView['offset']) ) {
            if ( $weekIndex == 1 ) {
                $template->assign_block_vars('date_row.date_cell', array(
                    'BLANK_COLSPAN' => $monthView['offset'])
                );
                $template->assign_block_vars('date_row.date_cell.switch_blank_cells', array());
            }
        }
        // we are after the last date
        elseif ($day > $monthView['numDays']) {

            if ($day == ($monthView['numDays'] + 1)) {
                $template->assign_block_vars('date_row.date_cell', array(
                    'BLANK_COLSPAN' => ($row * 1) - ($monthView['numDays'] + $monthView['offset']))
                );
                $template->assign_block_vars('date_row.date_cell.switch_blank_cells', array());

                // We have to now increment the day so that we don't repeat this cell
                $day++;

            }



        }
        // we are on a date
        else {

if ( $weekday == '7' )
{ $weekday = '1';  }
else
{ $weekday++; }




            $template->assign_block_vars('date_row.date_cell', array(
                'TODAY_STYLE' => $today_style,
                'DATE_CLASS' => ($row % 2) ? 'row2' : 'row3',
                'DATE' => $day,
      'WEEKDAY' => $lang['mini_cal']['f_day'][$weekday],
                'MONTH' => $monthView['monthName'])
            );
            $template->assign_block_vars('date_row.date_cell.switch_date_cells', array());

            // allow the template to handle how to treat the day
            if ($today['day'] == $day && $today['month'] == $monthView['month'] && $today['year'] == $monthView['year']) {
                $template->assign_block_vars('date_row.date_cell.switch_date_cells.switch_date_today', array());
            }
            else {
                $template->assign_block_vars('date_row.date_cell.switch_date_cells.switch_date_otherday', array());
            }

            // set the isodate for our current mark in the calendar (padding day appropriately)
            $current_isodate = $monthView['year'] . '-' . $monthView['month'] . '-' . sprintf('%02d', $day) . ' 00:00:00';

            $query = "SELECT
                          c.*,
             DAYOFWEEK(c.cal_date) as cal_weekday,
                          t.topic_title,
           l.cat_id,
                          t.topic_views,
                          t.topic_replies,
                          f.forum_name,
                          f.auth_read,
                          (cal_interval_units = 'DAY' && cal_interval = 1 && '$current_isodate' = INTERVAL (cal_interval * (cal_repeat - 1)) DAY + cal_date) as block_end
                      FROM
                          " . MYCALENDAR_TABLE . " as c,
                          " . TOPICS_TABLE . " as t,
                          " . FORUMS_TABLE . " as f,
                          " . POSTS_TEXT_TABLE . " as pt
      LEFT JOIN locations l ON l.location_name = c.location
                      WHERE
                          c.forum_id = f.forum_id
                          AND
                          c.topic_id = t.topic_id
                          AND
                          f.events_forum > 0
                          AND
                          pt.post_id = t.topic_first_post_id
                          AND
                          '$current_isodate' >= cal_date
                          AND
                          (
                              # If the repeat is forever just continue here
                              cal_repeat = 0
                              OR
                              (
                                  # If the repeat is limited, then make sure we are not past the end
                                  cal_repeat > 0
                                  AND
                                  (
                                      (cal_interval_units = 'DAY' AND ('$current_isodate' <= INTERVAL (cal_interval * (cal_repeat - 1)) DAY + cal_date))
                                      OR
                                      (cal_interval_units = 'WEEK' AND ('$current_isodate' <= INTERVAL ((cal_interval * (cal_repeat - 1)) * 7) DAY + cal_date))
                                      OR
                                      (cal_interval_units = 'MONTH' AND ('$current_isodate' <= INTERVAL (cal_interval * (cal_repeat - 1)) MONTH + cal_date))
                                      OR
                                      (cal_interval_units = 'YEAR' AND ('$current_isodate' <= INTERVAL (cal_interval * (cal_repeat - 1)) YEAR + cal_date))
                                  )
                              )
                          )
                          AND
                          (
                              (
                                  cal_interval_units = 'DAY'
                                  AND
                                  (TO_DAYS('$current_isodate') - TO_DAYS(cal_date)) % cal_interval = 0
                              )
                              OR
                              (
                                  cal_interval_units = 'WEEK'
                                  AND
                                  (TO_DAYS('$current_isodate') - TO_DAYS(cal_date)) % (7 * cal_interval) = 0
                              )
                              OR
                              (
                                  cal_interval_units = 'MONTH'
                                  AND
                                  DAYOFMONTH(cal_date) = DAYOFMONTH('$current_isodate')
                                  AND
                                  PERIOD_DIFF(DATE_FORMAT('$current_isodate', '%Y%m'), DATE_FORMAT(cal_date, '%Y%m')) % cal_interval = 0
                              )
                              OR
                              (
                                  cal_interval_units = 'YEAR'
                                  AND
                                  DATE_FORMAT(cal_date, '%m%d') = DATE_FORMAT('$current_isodate', '%m%d')
                                  AND
                                  (YEAR('$current_isodate') - YEAR(cal_date)) % cal_interval = 0
                              )
                          )
                      ORDER BY
                          cal_interval_units ASC,
                          cal_repeat DESC,
         cal_date ASC";
            if (!$result = $db->sql_query($query)) {
                message_die(GENERAL_ERROR, 'Error querying dates for calendar.');
            }

            $numEvents = 0;
            while ($topic = $db->sql_fetchrow($result)) {

                $is_auth = array();
                $is_auth = auth(AUTH_ALL, $topic['forum_id'], $userdata);
                if ( $is_auth['auth_read'] ) {
                    $topic_id = $topic['topic_id'];
                    // prepare the first post text if it has not already been cached
                    if (!isset($topicCache[$topic_id])) {
                        $post_text = $topic['post_text'];
                        // if we are spilling over, reduce size...[!] should be configurable [!]
                        if (strlen($post_text) > 2) {
                            $post_text = substr($post_text, 0, 0) . 'Tip: Klicke auf den Event um alle Infos & Kommentare zu lesen';
                        }
                        $post_text = bbencode_second_pass($post_text, $topic['bbcode_uid']);
                        $post_text = smilies_pass($post_text);
                        $post_text = preg_replace("/[\n\r]{1,2}/", '<br />', $post_text);

                        // prepare the popup text, escaping quotes for javascript
                        $title_text = '<b>' . $lang['Topic'] . ':</b> ' . $topic['topic_title'] . '<br /><b>' . $lang['Forum'] . ':</b> <i>' . $topic['forum_name'] . '</i><br /><b>' . $lang['Views'] . ':</b> ' . $topic['topic_views'] . '<br /><b>' . $lang['Replies'] . ':</b> ' . $topic['topic_replies'];
                        // tack on the interval and repeat if this is a repeated event
                        if ($topic['cal_repeat'] != 1) {
                            $title_text .= '<br /><b>' . $lang['Calendar_interval'] . ':</b> ' . $topic['cal_interval'] . ' ' . (($topic['cal_interval'] == 1) ? $lang['interval'][strtolower($topic['cal_interval_units'])] : $lang['interval'][strtolower($topic['cal_interval_units']) . 's']). '<br /><b>' . $lang['Calendar_repeat'] . ':</b> ' . ($topic['cal_repeat'] ? $topic['cal_repeat'] . 'x' : 'always');
                        }

                        $title_text .= '<br />' . $post_text;
                        $title_text = str_replace('\'', '\\\'', htmlspecialchars($title_text));
                        // make the url for the topic

                        $topic_url = append_sid('viewtopic.php?topic_id=' . $topic_id);
                        $topicCache[$topic_id] = array(
                            'first_post' => $title_text,
                            'topic_url'  => $topic_url,
                        );
                    }

                    // if we have a block event running (interval = 1 day) with this topic ID, then output our line

//                    if (isset($eventStack[$topic_id])) {
//                        $first_date = '';
//         }
//      else {
                        $topic_text = strlen($topic['topic_title']) > 137 ? substr($topic['topic_title'], 0, 137) . '...' : $topic['topic_title'];
         $topic_text = "$topic_text<br>";

         if ( !empty($topic['url']) )
         {
         $topic['url'] = "<a href=\"".$topic['url']."\" target=_blank><img src=/images/homepage.gif border=0></a>";
         }
         else
         { $topic['url'] = ''; }



         if ( !empty($topic['cat_id']) )
          {
             $cal_location = "<a href=/cam/categories.php?cat_id=".$topic['cat_id'].">".$topic['location']."</a>";
          }

         else
          {
           $cal_location = $topic['location'];
          }

         if ( !empty($cal['location']) && $cal['location'] != 'sonstige')
          {
             $cal_location = "<a href=/cam/categories.php?cat_id=".$cal['cat_id']."><font color=#dddddd>".$cal['location']."</font></a> :: ";
          }


                    $template->assign_block_vars('date_row.date_cell.switch_date_cells.date_event', array(
                        'U_EVENT' => $topic_text,
                   'C_LOCATION' => $cal_location, 'C_REPLIES' => $topic['topic_replies'],
                   'C_STADT' => $topic['stadt'],
                   'C_EINTRITT' => $topic['eintritt'],
                   'C_URL' => $topic['url'],
                   'C_URL_C' => "</a>"
)
                    );


// }
                    $numEvents++;

                    // Here I use a stack of sorts to keep track of block events which are
                    // still running...I sort the block start dates by date, so the overlaps
                    // will always appear in the same order...if a block ends while a lower block
                    // continues, I keep a place holder so that the line continues along the same
                    // path

                    // we are at the end of a block event
                    if ($topic['block_end']) {
                        unset($eventStack[$topic_id]);
                    }
                    // we place an entry in the event stack, key as the topic, value as the row
                    // number the event should fall in, for visual block events (interval = 1 day)
                    elseif (!isset($eventStack[$topic_id]) && $topic['cal_interval_units'] == 'DAY' && $topic['cal_interval'] == 1) {
                        $eventStack[$topic_id] = empty($eventStack) ? 0 : sizeof($eventStack);
                    }
                }
            }

            // Increment the day
            $day++;
        }
    }
}

if ($monthView['month'] == '12') {
    $nextmonth = 1;
    $nextyear = $monthView['year'] + 1;
}
else {
    $nextmonth = sprintf('%02d', $monthView['month'] + 1);
    $nextyear = $monthView['year'];
}

if ($monthView['month'] == '01') {
    $previousmonth = '12';
    $previousyear = $monthView['year'] - 1;
}
else {
    $previousmonth = sprintf('%02d', $monthView['month'] - 1);
    $previousyear = $monthView['year'];
}

// prepare images and links for month navigation
$url_prev_month = append_sid('events.' . $phpEx . "?month=$previousmonth&amp;year=$previousyear");
$url_next_month = append_sid('events.' . $phpEx . "?month=$nextmonth&amp;year=$nextyear");

$url_prev_year = append_sid('events.' . $phpEx . '?month=' . $monthView['month'] . '&amp;year=' . ($monthView['year'] - 1));
$url_next_year = append_sid('events.' . $phpEx . '?month=' . $monthView['month'] . '&amp;year=' . ($monthView['year'] + 1));

if ($lang['Calendar_start_monday']) {
    $template->assign_block_vars('switch_sunday_end', array());
}
else {
    $template->assign_block_vars('switch_sunday_beginning', array());
}



$template->assign_vars(array(
    'L_SUNDAY' => $lang['datetime']['Sunday'],
    'L_MONDAY' => $lang['datetime']['Monday'],
    'L_TUESDAY' => $lang['datetime']['Tuesday'],
    'L_WEDNESDAY' => $lang['datetime']['Wednesday'],
    'L_THURSDAY' => $lang['datetime']['Thursday'],
    'L_FRIDAY' => $lang['datetime']['Friday'],
    'L_SATURDAY' => $lang['datetime']['Saturday'],
    'L_CURRENT_MONTH' => $monthView['monthName'],
    'L_CURRENT_YEAR' => $monthView['year'],
    'I_PREV_MONTH' => $image_prev_month,
    'I_NEXT_MONTH' => $image_next_month,
    'U_PREV_MONTH' => $url_prev_month,
    'U_NEXT_MONTH' => $url_next_month,
    'I_PREV_YEAR'  => $image_prev_year,
    'I_NEXT_YEAR'  => $image_next_year,
    'U_PREV_YEAR'  => $url_prev_year,
    'U_NEXT_YEAR'  => $url_next_year,
          // Recent Topics
   'L_RECENT_TOPICS' => $lang['Recent_topics'],
    )
);

if ( $cal_monat == 1
|| $cal_monat == 3
|| $cal_monat == 5
|| $cal_monat == 7
|| $cal_monat == 8
|| $cal_monat == 10
|| $cal_monat == 12 )

{
$number_days = '31';

$cal_tage = '';

$i=0;
while ($i < $number_days)
{
$i++;


$cal_tage = "".$cal_tage." | <a href=#".$i.">".$i."</a>";

$template->assign_vars(array(
      'L_MINI_KAL' => $cal_tage )
             );

}

}

if ( $cal_monat == 4
|| $cal_monat == 6
|| $cal_monat == 9
|| $cal_monat == 11 )

{
$number_days = '30';

$cal_tage = '';

$i=0;
while ($i < $number_days)
{
$i++;


$cal_tage = "".$cal_tage." | <a href=#".$i.">".$i."</a>";



$template->assign_vars(array(
      'L_MINI_KAL' => $cal_tage )
             );

}

}


if ( $cal_monat == 2 )

{
$number_days = '28';

$cal_tage = '';

$i=0;
while ($i < $number_days)
{
$i++;


$cal_tage = "".$cal_tage." | <a href=#".$i.">".$i."</a>";

$template->assign_vars(array(
      'L_MINI_KAL' => $cal_tage )
             );

}

}





 $sql = "SELECT    SUM(t.topic_replies) as cal_topic_replies
                      FROM
                          " . MYCALENDAR_TABLE . " as c,
                          board_topics as t
                      WHERE c.topic_id = t.topic_id";
$result = mysql_query($sql);
while($array1=mysql_fetch_array($result))
{
$cal_topic_replies = $array1['cal_topic_replies'];
}

 $sql = "SELECT COUNT(cal_date) as kommende_events
                      FROM
                          " . MYCALENDAR_TABLE . "
                      WHERE
                          '$current_datum' <= cal_date";
$result = mysql_query($sql);
while($array2=mysql_fetch_array($result)) {
$kommende_events = $array2['kommende_events'];
}

 $sql = "SELECT COUNT(cal_date) as vergangene_events
                      FROM
                          " . MYCALENDAR_TABLE . "
                      WHERE
                          1";
$result = mysql_query($sql);
while($array3=mysql_fetch_array($result)) {
$vergangene_events = $array3['vergangene_events'];
}


$L_ALL_EVENTS_MORGEN = '<a href=event.php?type=detailed&monat=' . $curmonat . '&tag=' . ( $curtag + 1) . '&jahr=2003>Morgen (' . ( $curtag + 1) . '.' . $curmonat . '.)</a>';
   $template->assign_vars(array(
      'L_MONATSNAME' => $l_monat,
      'KOMMENDE_EVENTS' => $kommende_events,
      'VERGANGENE_EVENTS' => $vergangene_events,
      'EVENT_COMMENTS' => $cal_topic_replies,
      'L_CLUBBING' => '<a href=event.php?monat=' . $cal_monat . '&type=clubbing>Discos & Clubs</a>',
      'L_EVENTS' => '<a href=event.php?monat=' . $cal_monat . '&type=party>off|location events</a>',
      'L_ALL_EVENTS' => '<a href=event.php?monat=' . $cal_monat . '>Alle Events</a>',
      'L_ALL_EVENTS_HEUTE' => '<a href=events.php#heute>Was geht heute (' . $curtag . '.' . $curmonat . '.)</a>',
      'L_ALL_EVENTS_MORGEN' => $L_ALL_EVENTS_MORGEN,
      'L_MINI_CAL_MONTH' => $lang['datetime'][$mini_cal->day[0][3]] . " " . $mini_cal->day[0][5],
      'L_MINI_CAL_ADD_EVENT' => $lang['Mini_Cal_add_event'],
      'L_MINI_CAL_CALENDAR' => $lang['Mini_Cal_calendar'],
      'L_MINI_CAL_EVENTS' => $lang['Mini_Cal_events'],
      'L_MINI_CAL_SUN' => $lang['mini_cal']['day'][1],
      'L_MINI_CAL_MON' => $lang['mini_cal']['day'][2],
      'L_MINI_CAL_TUE' => $lang['mini_cal']['day'][3],
      'L_MINI_CAL_WED' => $lang['mini_cal']['day'][4],
      'L_MINI_CAL_THU' => $lang['mini_cal']['day'][5],
      'L_MINI_CAL_FRI' => $lang['mini_cal']['day'][6],
      'L_MINI_CAL_SAT' => $lang['mini_cal']['day'][7],
      'U_MINI_CAL_CALENDAR' => append_sid($phpbb_root_path . 'mycalendar.' . $phpEx),
      'U_MINI_CAL_ADD_EVENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=newtopic&f=' . MINI_CAL_EVENTS_FORUM ),

        )
    );




$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>


das verwende ich grad.
müsst ihr halt an eure page anpassen. kp ob das so funkt...


edit: TEXT UPDATED
Zuletzt geändert von neo18tilidie am 23.10.2003 14:45, insgesamt 2-mal geändert.

Lowtechmatt
Mitglied
Beiträge: 54
Registriert: 13.06.2003 12:04
Kontaktdaten:

Beitragvon Lowtechmatt » 21.10.2003 10:54

neo18tilidie hat geschrieben:mag daran liegen, dass draus nie ein mod werden sollte???


Dann machen wir einen draus :wink:

Ich probier das mal aus, meld mich dann,
Greetz, Matt

Benutzeravatar
Budowelt
Mitglied
Beiträge: 94
Registriert: 11.08.2003 09:38

Beitragvon Budowelt » 21.10.2003 20:34

to kind

werde es gleich mal ausprobieren

:cookie:

Lowtechmatt
Mitglied
Beiträge: 54
Registriert: 13.06.2003 12:04
Kontaktdaten:

Beitragvon Lowtechmatt » 21.10.2003 21:47

Also ich bin schonmal nen Step weiter:
http://www.hsweb.lowtechweb.de/forum/events.php

sagt mir halt:
SQL Error : 1146 Table 'hsweb.locations' doesn't exist

Wenn ich die Tabelle anlege findet er die Spalten nich, also da fehlt was essenzielles... wieso greift der die nich von der phpbb_mycalender-table ab wo ich location, eintritt, stadt, url usw schon als spalte drinn hab?


Grüsse, Matt

codemonkey
Ehemaliger
Beiträge: 3005
Registriert: 13.10.2002 15:15
Wohnort: Wilhelmshaven
Kontaktdaten:

Beitragvon codemonkey » 21.10.2003 21:49

Hast du denn mal versucht, die komplette Tabelle (inkl. Spalten) zu erstellen? Mach das mal und poste dann ggf. die Fehlermeldung.

Lowtechmatt
Mitglied
Beiträge: 54
Registriert: 13.06.2003 12:04
Kontaktdaten:

Beitragvon Lowtechmatt » 21.10.2003 21:54

codemonkey hat geschrieben:Hast du denn mal versucht, die komplette Tabelle (inkl. Spalten) zu erstellen? Mach das mal und poste dann ggf. die Fehlermeldung.


Dann weiss ich aber immernoch nich welche feldtypen und alles die spalten haben...

ob das so sinnvoll ist?

Benutzeravatar
neo18tilidie
Mitglied
Beiträge: 56
Registriert: 23.02.2003 13:47
Kontaktdaten:

Beitragvon neo18tilidie » 23.10.2003 14:46

hab die events.php kleines bisschen gesäubert.
evtl. funkts nun


events.php:

Code: Alles auswählen

<?php
#################################################################
## Mod Title:mycalendar Mod w/selected forum integration
## Mod Version: 2.2.7
## Author: marksten
## Author: mojavelinux <dan@mojavelinux.com>
## Description: Enables users to add events to the calendar
##              through a chosen forum.
#################################################################

$phpbb_root_path = './';
define('IN_PHPBB', true);
include_once $phpbb_root_path . 'extension.inc';
include_once $phpbb_root_path . 'common.'.$phpEx;
include_once $phpbb_root_path . 'includes/bbcode.'.$phpEx;
// Start session management
$userdata = session_pagestart($user_ip, PAGE_MYCALENDAR);
init_userprefs($userdata);



   $sqlmonat = 'SELECT MONTH(CURDATE()) as curmonat';
   if( $resultmonat = $db->sql_query($sqlmonat) )
   {
         while ($monat = $db->sql_fetchrow($resultmonat))
      {    $curmonat = $monat[curmonat]; }

      }

   $sql = 'SELECT DAYOFMONTH(CURDATE()) as curtag';
   if( $result = $db->sql_query($sql) )
   {
         while ($row = $db->sql_fetchrow($result))
      {    $curtag = $row[curtag]; }

      }

   $sqljahr = 'SELECT YEAR(CURDATE()) as curjahr';
   if( $resultjahr = $db->sql_query($sqljahr) )
   {
         while ($jahr = $db->sql_fetchrow($resultjahr))
      {    $curjahr = $jahr[curjahr]; }

      }


$current_datum = $curjahr . '-' . $curmonat . '-' . sprintf('%02d', $curtag) . ' 00:00:00';

    if( isset($HTTP_GET_VARS['monat']) || isset($HTTP_POST_VARS['monat']) )
    {
       $cal_monat = ( isset($HTTP_POST_VARS['monat']) ) ? intval($HTTP_POST_VARS['monat']) : intval($HTTP_GET_VARS['monat']);
    }

    else if( isset($HTTP_GET_VARS['month']) || isset($HTTP_POST_VARS['month']) )
    {
       $cal_monat = ( isset($HTTP_POST_VARS['month']) ) ? intval($HTTP_POST_VARS['month']) : intval($HTTP_GET_VARS['month']);
    }

    else
    {
    $cal_monat = $curmonat;
    }


    if( isset($HTTP_GET_VARS['jahr']) || isset($HTTP_POST_VARS['jahr']) )
    {
       $cal_jahr = ( isset($HTTP_POST_VARS['jahr']) ) ? intval($HTTP_POST_VARS['jahr']) : intval($HTTP_GET_VARS['jahr']);
    }

    else
    {
    $cal_jahr = $curjahr;
    }


    if( isset($HTTP_GET_VARS['tag']) || isset($HTTP_POST_VARS['tag']) )
    {
       $cal_tag = ( isset($HTTP_POST_VARS['tag']) ) ? intval($HTTP_POST_VARS['tag']) : intval($HTTP_GET_VARS['tag']);
    }

    else
    {
    $cal_tag = $curtag;
    }






// determine the information for the current date
list($today['year'], $today['month'], $today['day']) = explode('-', create_date('Y-m-d', time(), $board_config['board_timezone']));

// get the month/year offset from the get variables, or else use first day of this month
if (isset($HTTP_GET_VARS['month']) && isset($HTTP_GET_VARS['year'])) {
    $view_isodate = sprintf('%04d', $HTTP_GET_VARS['year']) . '-' . sprintf('%02d', $HTTP_GET_VARS['month']) . '-01 00:00:00';
}
// get the first day of the month as an isodate
else {
    $view_isodate = $today['year'] . '-' . $today['month'] . '-01 00:00:00';
}

// setup the current view information
$query = "SELECT
             MONTHNAME('$view_isodate') as monthName,
             DATE_FORMAT('$view_isodate', '%m') as month,
             DAYOFWEEK('$view_isodate') as cal_weekday,
             YEAR('$view_isodate') as year,
             DATE_FORMAT(CONCAT(YEAR('$view_isodate'), '-', MONTH('$view_isodate' + INTERVAL 1 MONTH), '-01') - INTERVAL 1 DAY, '%e') as numDays,
             WEEKDAY('$view_isodate') as offset";
$result = $db->sql_query($query);
$monthView = $db->sql_fetchrow($result);
$monthView['monthName'] = $lang['datetime'][$monthView['monthName']];


$l_monat = "Events im ".$monthView['monthName']."</b>";


// [*] is this going to give us a negative number ever?? [*]
if (!$lang['Calendar_start_monday']) {
    $monthView['offset']++;
}

// set the page title and include the page header
$page_title = $lang['View_calendar'];
include ($phpbb_root_path . 'includes/page_portal.'.$phpEx);

$template->set_filenames(array(
    'body' => 'mycalendar_body2.tpl')
);

// prepare the loops for running through the calendar for the current month
$numRows = ceil(($monthView['numDays'] + $monthView['offset']) / 1);
$day = 1;
$weekday = $monthView['cal_weekday'];
$weekday = ( $weekday - 1 );
$eventStack = array();
$topicCache = array();
foreach(range(1, $numRows) as $row) {

    $template->assign_block_vars('date_row', array());
    foreach (range(1, 1) as $weekIndex) {






        // we are before the first date
        if ( ($row == 1 && $weekIndex <= $monthView['offset']) ) {
            if ( $weekIndex == 1 ) {
                $template->assign_block_vars('date_row.date_cell', array(
                    'BLANK_COLSPAN' => $monthView['offset'])
                );
                $template->assign_block_vars('date_row.date_cell.switch_blank_cells', array());
            }
        }
        // we are after the last date
        elseif ($day > $monthView['numDays']) {

            if ($day == ($monthView['numDays'] + 1)) {
                $template->assign_block_vars('date_row.date_cell', array(
                    'BLANK_COLSPAN' => ($row * 1) - ($monthView['numDays'] + $monthView['offset']))
                );
                $template->assign_block_vars('date_row.date_cell.switch_blank_cells', array());

                // We have to now increment the day so that we don't repeat this cell
                $day++;

            }



        }
        // we are on a date
        else {

if ( $weekday == '7' )
{ $weekday = '1';  }
else
{ $weekday++; }




            $template->assign_block_vars('date_row.date_cell', array(
                'TODAY_STYLE' => $today_style,
                'DATE_CLASS' => ($row % 2) ? 'row2' : 'row3',
                'DATE' => $day,
      'WEEKDAY' => $lang['mini_cal']['f_day'][$weekday],
                'MONTH' => $monthView['monthName'])
            );
            $template->assign_block_vars('date_row.date_cell.switch_date_cells', array());

            // allow the template to handle how to treat the day
            if ($today['day'] == $day && $today['month'] == $monthView['month'] && $today['year'] == $monthView['year']) {
                $template->assign_block_vars('date_row.date_cell.switch_date_cells.switch_date_today', array());
            }
            else {
                $template->assign_block_vars('date_row.date_cell.switch_date_cells.switch_date_otherday', array());
            }

            // set the isodate for our current mark in the calendar (padding day appropriately)
            $current_isodate = $monthView['year'] . '-' . $monthView['month'] . '-' . sprintf('%02d', $day) . ' 00:00:00';

            $query = "SELECT
                          c.*,
             DAYOFWEEK(c.cal_date) as cal_weekday,
                          t.topic_title,
           l.cat_id,
                          t.topic_views,
                          t.topic_replies,
                          f.forum_name,
                          f.auth_read,
                          (cal_interval_units = 'DAY' && cal_interval = 1 && '$current_isodate' = INTERVAL (cal_interval * (cal_repeat - 1)) DAY + cal_date) as block_end
                      FROM
                          " . MYCALENDAR_TABLE . " as c,
                          " . TOPICS_TABLE . " as t,
                          " . FORUMS_TABLE . " as f,
                          " . POSTS_TEXT_TABLE . " as pt
      LEFT JOIN locations l ON l.location_name = c.location
                      WHERE
                          c.forum_id = f.forum_id
                          AND
                          c.topic_id = t.topic_id
                          AND
                          f.events_forum > 0
                          AND
                          pt.post_id = t.topic_first_post_id
                          AND
                          '$current_isodate' >= cal_date
                          AND
                          (
                              # If the repeat is forever just continue here
                              cal_repeat = 0
                              OR
                              (
                                  # If the repeat is limited, then make sure we are not past the end
                                  cal_repeat > 0
                                  AND
                                  (
                                      (cal_interval_units = 'DAY' AND ('$current_isodate' <= INTERVAL (cal_interval * (cal_repeat - 1)) DAY + cal_date))
                                      OR
                                      (cal_interval_units = 'WEEK' AND ('$current_isodate' <= INTERVAL ((cal_interval * (cal_repeat - 1)) * 7) DAY + cal_date))
                                      OR
                                      (cal_interval_units = 'MONTH' AND ('$current_isodate' <= INTERVAL (cal_interval * (cal_repeat - 1)) MONTH + cal_date))
                                      OR
                                      (cal_interval_units = 'YEAR' AND ('$current_isodate' <= INTERVAL (cal_interval * (cal_repeat - 1)) YEAR + cal_date))
                                  )
                              )
                          )
                          AND
                          (
                              (
                                  cal_interval_units = 'DAY'
                                  AND
                                  (TO_DAYS('$current_isodate') - TO_DAYS(cal_date)) % cal_interval = 0
                              )
                              OR
                              (
                                  cal_interval_units = 'WEEK'
                                  AND
                                  (TO_DAYS('$current_isodate') - TO_DAYS(cal_date)) % (7 * cal_interval) = 0
                              )
                              OR
                              (
                                  cal_interval_units = 'MONTH'
                                  AND
                                  DAYOFMONTH(cal_date) = DAYOFMONTH('$current_isodate')
                                  AND
                                  PERIOD_DIFF(DATE_FORMAT('$current_isodate', '%Y%m'), DATE_FORMAT(cal_date, '%Y%m')) % cal_interval = 0
                              )
                              OR
                              (
                                  cal_interval_units = 'YEAR'
                                  AND
                                  DATE_FORMAT(cal_date, '%m%d') = DATE_FORMAT('$current_isodate', '%m%d')
                                  AND
                                  (YEAR('$current_isodate') - YEAR(cal_date)) % cal_interval = 0
                              )
                          )
                      ORDER BY
                          cal_interval_units ASC,
                          cal_repeat DESC,
         cal_date ASC";
            if (!$result = $db->sql_query($query)) {
                message_die(GENERAL_ERROR, 'Error querying dates for calendar.');
            }

            $numEvents = 0;
            while ($topic = $db->sql_fetchrow($result)) {

                $is_auth = array();
                $is_auth = auth(AUTH_ALL, $topic['forum_id'], $userdata);
                if ( $is_auth['auth_read'] ) {
                    $topic_id = $topic['topic_id'];
                    // prepare the first post text if it has not already been cached
                    if (!isset($topicCache[$topic_id])) {
                        $post_text = $topic['post_text'];
                        // if we are spilling over, reduce size...[!] should be configurable [!]
                        if (strlen($post_text) > 2) {
                            $post_text = substr($post_text, 0, 0) . 'Tip: Klicke auf den Event um alle Infos & Kommentare zu lesen';
                        }
                        $post_text = bbencode_second_pass($post_text, $topic['bbcode_uid']);
                        $post_text = smilies_pass($post_text);
                        $post_text = preg_replace("/[\n\r]{1,2}/", '<br />', $post_text);

                        // prepare the popup text, escaping quotes for javascript
                        $title_text = '<b>' . $lang['Topic'] . ':</b> ' . $topic['topic_title'] . '<br /><b>' . $lang['Forum'] . ':</b> <i>' . $topic['forum_name'] . '</i><br /><b>' . $lang['Views'] . ':</b> ' . $topic['topic_views'] . '<br /><b>' . $lang['Replies'] . ':</b> ' . $topic['topic_replies'];
                        // tack on the interval and repeat if this is a repeated event
                        if ($topic['cal_repeat'] != 1) {
                            $title_text .= '<br /><b>' . $lang['Calendar_interval'] . ':</b> ' . $topic['cal_interval'] . ' ' . (($topic['cal_interval'] == 1) ? $lang['interval'][strtolower($topic['cal_interval_units'])] : $lang['interval'][strtolower($topic['cal_interval_units']) . 's']). '<br /><b>' . $lang['Calendar_repeat'] . ':</b> ' . ($topic['cal_repeat'] ? $topic['cal_repeat'] . 'x' : 'always');
                        }

                        $title_text .= '<br />' . $post_text;
                        $title_text = str_replace('\'', '\\\'', htmlspecialchars($title_text));
                        // make the url for the topic

                        $topic_url = append_sid('viewtopic.php?topic_id=' . $topic_id);
                        $topicCache[$topic_id] = array(
                            'first_post' => $title_text,
                            'topic_url'  => $topic_url,
                        );
                    }

                    // if we have a block event running (interval = 1 day) with this topic ID, then output our line

//                    if (isset($eventStack[$topic_id])) {
//                        $first_date = '';
//         }
//      else {
                        $topic_text = strlen($topic['topic_title']) > 137 ? substr($topic['topic_title'], 0, 137) . '...' : $topic['topic_title'];
         $topic_text = "$topic_text<br>";

         if ( !empty($topic['url']) )
         {
         $topic['url'] = "<a href=\"".$topic['url']."\" target=_blank><img src=/images/homepage.gif border=0></a>";
         }
         else
         { $topic['url'] = ''; }



         if ( !empty($topic['cat_id']) )
          {
             $cal_location = "<a href=/cam/categories.php?cat_id=".$topic['cat_id'].">".$topic['location']."</a>";
          }

         else
          {
           $cal_location = $topic['location'];
          }

         if ( !empty($cal['location']) && $cal['location'] != 'sonstige')
          {
             $cal_location = "<a href=/cam/categories.php?cat_id=".$cal['cat_id']."><font color=#dddddd>".$cal['location']."</font></a> :: ";
          }


                    $template->assign_block_vars('date_row.date_cell.switch_date_cells.date_event', array(
                        'U_EVENT' => $topic_text,
                   'C_LOCATION' => $cal_location, 'C_REPLIES' => $topic['topic_replies'],
                   'C_STADT' => $topic['stadt'],
                   'C_EINTRITT' => $topic['eintritt'],
                   'C_URL' => $topic['url'],
                   'C_URL_C' => "</a>"
)
                    );


// }
                    $numEvents++;

                    // Here I use a stack of sorts to keep track of block events which are
                    // still running...I sort the block start dates by date, so the overlaps
                    // will always appear in the same order...if a block ends while a lower block
                    // continues, I keep a place holder so that the line continues along the same
                    // path

                    // we are at the end of a block event
                    if ($topic['block_end']) {
                        unset($eventStack[$topic_id]);
                    }
                    // we place an entry in the event stack, key as the topic, value as the row
                    // number the event should fall in, for visual block events (interval = 1 day)
                    elseif (!isset($eventStack[$topic_id]) && $topic['cal_interval_units'] == 'DAY' && $topic['cal_interval'] == 1) {
                        $eventStack[$topic_id] = empty($eventStack) ? 0 : sizeof($eventStack);
                    }
                }
            }

            // Increment the day
            $day++;
        }
    }
}

if ($monthView['month'] == '12') {
    $nextmonth = 1;
    $nextyear = $monthView['year'] + 1;
}
else {
    $nextmonth = sprintf('%02d', $monthView['month'] + 1);
    $nextyear = $monthView['year'];
}

if ($monthView['month'] == '01') {
    $previousmonth = '12';
    $previousyear = $monthView['year'] - 1;
}
else {
    $previousmonth = sprintf('%02d', $monthView['month'] - 1);
    $previousyear = $monthView['year'];
}

// prepare images and links for month navigation
$url_prev_month = append_sid('events.' . $phpEx . "?month=$previousmonth&amp;year=$previousyear");
$url_next_month = append_sid('events.' . $phpEx . "?month=$nextmonth&amp;year=$nextyear");

$url_prev_year = append_sid('events.' . $phpEx . '?month=' . $monthView['month'] . '&amp;year=' . ($monthView['year'] - 1));
$url_next_year = append_sid('events.' . $phpEx . '?month=' . $monthView['month'] . '&amp;year=' . ($monthView['year'] + 1));

if ($lang['Calendar_start_monday']) {
    $template->assign_block_vars('switch_sunday_end', array());
}
else {
    $template->assign_block_vars('switch_sunday_beginning', array());
}



$template->assign_vars(array(
    'L_SUNDAY' => $lang['datetime']['Sunday'],
    'L_MONDAY' => $lang['datetime']['Monday'],
    'L_TUESDAY' => $lang['datetime']['Tuesday'],
    'L_WEDNESDAY' => $lang['datetime']['Wednesday'],
    'L_THURSDAY' => $lang['datetime']['Thursday'],
    'L_FRIDAY' => $lang['datetime']['Friday'],
    'L_SATURDAY' => $lang['datetime']['Saturday'],
    'L_CURRENT_MONTH' => $monthView['monthName'],
    'L_CURRENT_YEAR' => $monthView['year'],
    'I_PREV_MONTH' => $image_prev_month,
    'I_NEXT_MONTH' => $image_next_month,
    'U_PREV_MONTH' => $url_prev_month,
    'U_NEXT_MONTH' => $url_next_month,
    'I_PREV_YEAR'  => $image_prev_year,
    'I_NEXT_YEAR'  => $image_next_year,
    'U_PREV_YEAR'  => $url_prev_year,
    'U_NEXT_YEAR'  => $url_next_year,
          // Recent Topics
   'L_RECENT_TOPICS' => $lang['Recent_topics'],
    )
);

if ( $cal_monat == 1
|| $cal_monat == 3
|| $cal_monat == 5
|| $cal_monat == 7
|| $cal_monat == 8
|| $cal_monat == 10
|| $cal_monat == 12 )

{
$number_days = '31';

$cal_tage = '';

$i=0;
while ($i < $number_days)
{
$i++;


$cal_tage = "".$cal_tage." | <a href=#".$i.">".$i."</a>";

$template->assign_vars(array(
      'L_MINI_KAL' => $cal_tage )
             );

}

}

if ( $cal_monat == 4
|| $cal_monat == 6
|| $cal_monat == 9
|| $cal_monat == 11 )

{
$number_days = '30';

$cal_tage = '';

$i=0;
while ($i < $number_days)
{
$i++;


$cal_tage = "".$cal_tage." | <a href=#".$i.">".$i."</a>";



$template->assign_vars(array(
      'L_MINI_KAL' => $cal_tage )
             );

}

}


if ( $cal_monat == 2 )

{
$number_days = '28';

$cal_tage = '';

$i=0;
while ($i < $number_days)
{
$i++;


$cal_tage = "".$cal_tage." | <a href=#".$i.">".$i."</a>";

$template->assign_vars(array(
      'L_MINI_KAL' => $cal_tage )
             );

}

}





 $sql = "SELECT    SUM(t.topic_replies) as cal_topic_replies
                      FROM
                          " . MYCALENDAR_TABLE . " as c,
                          board_topics as t
                      WHERE c.topic_id = t.topic_id";
$result = mysql_query($sql);
while($array1=mysql_fetch_array($result))
{
$cal_topic_replies = $array1['cal_topic_replies'];
}

 $sql = "SELECT COUNT(cal_date) as kommende_events
                      FROM
                          " . MYCALENDAR_TABLE . "
                      WHERE
                          '$current_datum' <= cal_date";
$result = mysql_query($sql);
while($array2=mysql_fetch_array($result)) {
$kommende_events = $array2['kommende_events'];
}

 $sql = "SELECT COUNT(cal_date) as vergangene_events
                      FROM
                          " . MYCALENDAR_TABLE . "
                      WHERE
                          1";
$result = mysql_query($sql);
while($array3=mysql_fetch_array($result)) {
$vergangene_events = $array3['vergangene_events'];
}


$L_ALL_EVENTS_MORGEN = '<a href=event.php?type=detailed&monat=' . $curmonat . '&tag=' . ( $curtag + 1) . '&jahr=2003>Morgen (' . ( $curtag + 1) . '.' . $curmonat . '.)</a>';
   $template->assign_vars(array(
      'L_MONATSNAME' => $l_monat,
      'KOMMENDE_EVENTS' => $kommende_events,
      'VERGANGENE_EVENTS' => $vergangene_events,
      'EVENT_COMMENTS' => $cal_topic_replies,
      'L_CLUBBING' => '<a href=event.php?monat=' . $cal_monat . '&type=clubbing>Discos & Clubs</a>',
      'L_EVENTS' => '<a href=event.php?monat=' . $cal_monat . '&type=party>off|location events</a>',
      'L_ALL_EVENTS' => '<a href=event.php?monat=' . $cal_monat . '>Alle Events</a>',
      'L_ALL_EVENTS_HEUTE' => '<a href=events.php#heute>Was geht heute (' . $curtag . '.' . $curmonat . '.)</a>',
      'L_ALL_EVENTS_MORGEN' => $L_ALL_EVENTS_MORGEN,
      'L_MINI_CAL_MONTH' => $lang['datetime'][$mini_cal->day[0][3]] . " " . $mini_cal->day[0][5],
      'L_MINI_CAL_ADD_EVENT' => $lang['Mini_Cal_add_event'],
      'L_MINI_CAL_CALENDAR' => $lang['Mini_Cal_calendar'],
      'L_MINI_CAL_EVENTS' => $lang['Mini_Cal_events'],
      'L_MINI_CAL_SUN' => $lang['mini_cal']['day'][1],
      'L_MINI_CAL_MON' => $lang['mini_cal']['day'][2],
      'L_MINI_CAL_TUE' => $lang['mini_cal']['day'][3],
      'L_MINI_CAL_WED' => $lang['mini_cal']['day'][4],
      'L_MINI_CAL_THU' => $lang['mini_cal']['day'][5],
      'L_MINI_CAL_FRI' => $lang['mini_cal']['day'][6],
      'L_MINI_CAL_SAT' => $lang['mini_cal']['day'][7],
      'U_MINI_CAL_CALENDAR' => append_sid($phpbb_root_path . 'mycalendar.' . $phpEx),
      'U_MINI_CAL_ADD_EVENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=newtopic&f=' . MINI_CAL_EVENTS_FORUM ),

        )
    );




$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>


Zurück zu „phpBB 2.0: Mods in Entwicklung“