News:

Join the Facebook Fan Page.

Main Menu

Calendar Settings

Started by tumbleweed, July 08, 2010, 06:56:55 PM

Previous topic - Next topic

tumbleweed

Hi,

I would like two.
#1 remove the 3 months on the left hand side.
#2 Show Calendar for only 7 days (one week)

Is this possible?

Thanks
Frank
G.C. SOLUTIONS - Hosting Quality Sites Since 2006. Experience Your Forums On A Whole New Level
Elastic Sites Stress Fast CPU/Ram Upgrades- More Info Here.
Reviews By SMF Forum Owners - Read Our Rev

Chas Large

To do option # 1 Edit the files Sources/Calendar.php

Find:

// Load up the previous and next months.
$calendarOptions['show_birthdays'] = $calendarOptions['show_events'] = $calendarOptions['show_holidays'] = false;
$calendarOptions['short_day_titles'] = true;
$calendarOptions['show_next_prev'] = false;
$calendarOptions['show_week_links'] = false;
$calendarOptions['size'] = 'small';
$context['calendar_grid_current'] = getCalendarGrid($curPage['month'], $curPage['year'], $calendarOptions);
// Only show previous month if it isn't pre-January of the min-year
if ($context['calendar_grid_current']['previous_calendar']['year'] > $modSettings['cal_minyear'] || $curPage['month'] != 1)
$context['calendar_grid_prev'] = getCalendarGrid($context['calendar_grid_current']['previous_calendar']['month'], $context['calendar_grid_current']['previous_calendar']['year'], $calendarOptions);
// Only show next month if it isn't post-December of the max-year
if ($context['calendar_grid_current']['next_calendar']['year'] < $modSettings['cal_maxyear'] || $curPage['month'] != 12)
$context['calendar_grid_next'] = getCalendarGrid($context['calendar_grid_current']['next_calendar']['month'], $context['calendar_grid_current']['next_calendar']['year'], $calendarOptions);


Change to:

// Load up the previous and next months.
//$calendarOptions['show_birthdays'] = $calendarOptions['show_events'] = $calendarOptions['show_holidays'] = false;
//$calendarOptions['short_day_titles'] = true;
//$calendarOptions['show_next_prev'] = false;
//$calendarOptions['show_week_links'] = false;
//$calendarOptions['size'] = 'small';
//$context['calendar_grid_current'] = getCalendarGrid($curPage['month'], $curPage['year'], $calendarOptions);
// Only show previous month if it isn't pre-January of the min-year
//if ($context['calendar_grid_current']['previous_calendar']['year'] > $modSettings['cal_minyear'] || $curPage['month'] != 1)
// $context['calendar_grid_prev'] = getCalendarGrid($context['calendar_grid_current']['previous_calendar']['month'], $context['calendar_grid_current']['previous_calendar']['year'], $calendarOptions);
// Only show next month if it isn't post-December of the max-year
//if ($context['calendar_grid_current']['next_calendar']['year'] < $modSettings['cal_maxyear'] || $curPage['month'] != 12)
// $context['calendar_grid_next'] = getCalendarGrid($context['calendar_grid_current']['next_calendar']['month'], $context['calendar_grid_current']['next_calendar']['year'], $calendarOptions);


There is no option #2 to change to week only view.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

OCJ

#2
This works - removes the side mini calendar but does not free up the space for the main calendar - do you know the edit for this. ... css file?
Andy

Deleting the month_grid  css didnt expand the main calendar out to 100% . :-\


#month_grid
{
   width: 200px;
   text-align: left;
   float: left;
}
#month_grid div.cat_bar
{
   height: 25px;
}
#month_grid h3.catbg
{
   height: 25px;
   line-height: 27px;
}
#month_grid table
{
   width: 200px;
}

OCJ

Got it ...  :)

Default theme; calendar.template.php
Remove red and set 220px to 0px.


echo '
      <div id="calendar">
         <div id="month_grid">
            ', template_show_month_grid('prev'), '
            ', template_show_month_grid('current'), '
            ', template_show_month_grid('next'), '
         </div>

         <div id="main_grid" style="', $context['browser']['is_ie'] && !$context['browser']['is_ie8'] ? 'float: ' . ($context['right_to_left'] ? 'right; padding-right' : 'left; padding-left') . ': 20px;' : 'margin-' . ($context['right_to_left'] ? 'right' : 'left') . ': 220px; ', '">
            ', $context['view_week'] ? template_show_week_grid('main') : template_show_month_grid('main');

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

OCJ

Its a real estate thing - just need the space on the webpage for the cramped text in the monthly calendar view (need the monthly view).
At the moment the board is wrapped in a CMS page - still lots of issues with the SMF portals and multi language site.

The side calendar is not really so useful - doesnt show if there is an event on a day - like a bold link. I can click the main month to go backwards or forwards so not needed in that respect. Most people have a calendar on the wall in front of them and on the PC task bar.
::)

But now I have SMF pretty much working the way I want it.

Chas Large

@Tumbleweed,

Is this issue solved or do you still require assistance?

My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

OCJ

Getting my threads crossed, even more ... Im fine - the calendar is looking good now.

Chas Large

Quote from: igirisjin on May 18, 2011, 10:17:50 AM
Getting my threads crossed, even more ... Im fine - the calendar is looking good now.
OK, thanks for coming back to me. I'll close this topic. :)
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Illori

Just a sec igirisjin is not the op of this thread? should we wait for the op to reply about the status?

Chas Large

Quote from: Illori on May 18, 2011, 10:32:30 AM
Just a sec igirisjin is not the op of this thread? should we wait for the op to reply about the status?
Oh yes how silly of me, good job you're checking up on my work. I'll change it to Not solved.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Illori

great, i did the same thing before i checked the op as well.

Advertisement: