Features Suggestions

Support for the WordPress Calendar plugin
stvwlf
Posts: 2
Joined: Fri Sep 05, 2008 8:21 am

Features Suggestions

Unread post by stvwlf » Fri Sep 05, 2008 8:34 am

Hi

Your calendar is wonderful. Just got the latest version today.

I would find it useful if a future version included these two features:

1) on the options page: a field to indicate an external stylesheet filename, which would be located in the current theme folder. (This intended for people who know what they are doing) If a stylesheet was entered and it existed, the styling from this stylesheet would be used instead of the styling from the option screen styling field. This would reduce the size of the header on each page, allow CSS manipulation outside of the options screen, and allow the user to have a backup of the stylesheet they'd created.

2) presently the option screen CSS code is being added to the header on every page. Most sites will only need this calendar displayed on a small # of pages. Thus this CSS is unnecessary code on the majority of pages.
It would be helpful if there was a field on the options page to allow entry of page ID #'s on which the CSS should be added to the header. If my suggestion #1 about external style sheet is implemented, if an external style sheet has been indicated, this would be added to the header on those pages. Otherwise the option page CSS would be added on those pages.

Thank you for considering these suggestions
Steve

User avatar
Kieran
Posts: 2059
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: Features Suggestions

Unread post by Kieran » Fri Sep 05, 2008 8:48 am

That is actually a very well thought out and all together excellent suggestion.

I will make sure it is implemented in the next release :)

Martin
Posts: 3
Joined: Sat Sep 06, 2008 9:47 am
Contact:

Re: Features Suggestions

Unread post by Martin » Sat Sep 06, 2008 3:12 pm

Hey Kieran,

I changed the next_link and prev_link function to display the abbreviation of the months for navigating. So instead of prev and next. I think you get the picture, if not, take a look at my website

Code: Select all

function next_link($cur_year,$cur_month)
{
  $mod_rewrite_months = array(1=>'jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec');
  $nl_months = array(1=>'jan','feb','mrt','apr','mei','jun','jul','aug','sept','okt','nov','dec');
  $next_year = $cur_year + 1;

  if ($cur_month == 12)
    {
      return '<a href="' . permalink_prefix() . 'month=jan&yr=' . $next_year . '">jan &raquo;</a>';
    }
  else
    {
      $next_month = $cur_month + 1;
      $month = $mod_rewrite_months[$next_month];
      return '<a href="' . permalink_prefix() . 'month='.$month.'&yr=' . $cur_year . '">' . $nl_months[$next_month] . ' &raquo;</a>';
    }
}
Actually pretty simple. I made the $nl_months array because of the months in Dutch being a little different.

I hope it is of any use.

User avatar
Kieran
Posts: 2059
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: Features Suggestions

Unread post by Kieran » Sat Sep 06, 2008 6:45 pm

Given that the current month is displayed in between the next/prev links, I can't personally see a use for highlighting which month next/prev would take you to - surely its obvious?

Still each to their own - thats the whole idea of open source - while I can't see myself adding your modification to the next release, modifications in individual installs are most welcome and I'm sure others will try your code :)

Martin
Posts: 3
Joined: Sat Sep 06, 2008 9:47 am
Contact:

Re: Features Suggestions

Unread post by Martin » Sat Sep 06, 2008 7:37 pm

Yeah, I'm well aware of that. I just thought it might be of any use to someone out there.

By the way, maybe you could add a feature to the next version what blocks the past. So past days get the same look as a 'day-without-date' cells, past events get auto-deleted and you can't navigate into the past.

Regards.

User avatar
Kieran
Posts: 2059
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: Features Suggestions

Unread post by Kieran » Sun Sep 07, 2008 12:02 am

Yeah that could be added as a tick box style option on the calendar config screen.

Martin
Posts: 3
Joined: Sat Sep 06, 2008 9:47 am
Contact:

Re: Features Suggestions

Unread post by Martin » Mon Sep 08, 2008 1:55 pm

Hey Kieran,

I allready haxxxed the navigation so that one cannot navigate into the past.
So, if anyone want to use this feature, hax calendar.php as follows.

Replace the function prev_link() with this one:

Code: Select all

function prev_link($cur_year,$cur_month)
{
  $mod_rewrite_months = array(1=>'jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec');
  $last_year = $cur_year - 1;

  if ($cur_year == date("Y") && $cur_month == date("m"))
  	{
  		return '';
  	}
  elseif ($cur_month == 1)
    {
      return '<a href="' . permalink_prefix() . 'month=dec&yr='. $last_year .'">&laquo; dec</a>';
    }
  else
    {
      $next_month = $cur_month - 1;
      $month = $mod_rewrite_months[$next_month];
    return '<a href="' . permalink_prefix() . 'month='.$month.'&yr=' . $cur_year . '">&laquo; ' . $mod_rewrite_months[$next_month] . '</a>';
    }
}
You might want to find these lines:

Code: Select all

    // Years get funny if we exceed 3000, so we use this check
    if ($_GET['yr'] <= 3000 && $_GET['yr'] >= 0)
And replace them with:

Code: Select all

    // Years get funny if we exceed 3000, so we use this check
    // We dont want navigation in the past, so we block any year earlier than today's year
    if ($_GET['yr'] <= 3000 && $_GET['yr'] >= date("Y"))
But it's all up to you!

Regards.

Post Reply