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,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 400
  • Total: 400

SMF Calendar Block

Started by Lesmond, September 03, 2005, 11:30:42 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

brianjw

Nonclickable... If I were you I would get on google and search for calendars. There are many calendars that show the date and everything but do not link anywhere. Half the code of this one was used to make it get and link events to the calendar in SMF ;)

mrbean17

Is it possible to have the current month show all events for the month vs. just the current week?

Looking at the events section, I'm not even sure how its pulling the information back based on a date range...


/////////////////////////////////////////////////////////////////
//   EVENTS SECTION
//
if (!empty($context['calendar_events']))
{
    echo '<tr><td colspan="2"><hr></td><td colspan="3" class="smalltext" align="center" style="font-weight: bold; color: #' . $modSettings['cal_eventcolor'] . ';">Events</td><td colspan="2"><hr></td></tr><td colspan="7" class="smalltext">';

    foreach ($context['calendar_events'] as $event)
    {
        $query = db_query(
            "SELECT startDate
            FROM {$db_prefix}calendar
            WHERE ID_EVENT='".$event['id']."'", __FILE__, __LINE__);

        $row = mysql_fetch_assoc($query);
        $startdate = strtotime($row['startDate']);

        mysql_free_result($query);

        echo '<div align="center">';
        echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") . ';month=' . date("n",$startdate) . '"><strong>' . date("M j",$startdate) . '</strong></a>';
        echo ' - ';
        echo $event['link'] ;
        echo '</div>';
    }
    echo '</td></tr>';
}


Thanks

jacortina

You're just going to keep bustin' my chops, eh Mr. Bean? ;)

This uses the standard 'lookahead' set for the SMF calendar events (as noted earlier in this thread; yes, I know, this is page 30!!!).

You set that in you Admin Control Panel.

Forum/Calendar -> "Max days in advance on board index:"

This will still only show upcoming events, but you can set it to 30/31 to have a full month's worth shown.

mrbean17


3nd3r

Awesome mod!

Just a little question:

How can I do to show weekend (I mean Saturday + Sunday) to the end of the week? In Spain, weeks starts on Monday...

jacortina

To start week with Monday, find:
$first_day = 0;

change to:
$first_day = 1;

3nd3r

Thank you! Works perfect! Awesome!  ;) :D

SaD333


ogmios

is there a way to get the 'post event' button to display at the bottom of the calendar i have showing in my php block?

was this already discussed and i missed it?

chep

This calendar kicks ass. Thanks

This website is proudly hosted on Crocweb Cloud Website Hosting.