Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2008-09-02 01:03:30

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [plugin] [ORPHAN] mdp_calendar

A number of people have reported problems with the day heading being one out: #50, #107, #121

I hadn’t seen this problem until, as misfortune would have it, the site went live & my client reported it! The dates/articles were all correct but the day name headings were being displayed as Tue-Mon rather than Mon-Sun (I’m using firstday=“1”). At first I thought it was only occuring on certain days but the browser cache was masking the fact that it was happening every day between midnight and 10:00am. The time is significant because I’m in a GMT+10 timezone. Problem occurs both on the live site AND on my Mac.

The fix described in #117 & #118 didn’t do anything for me. And I must admit I haven’t noticed a problem where articles on the first day of month are not displayed or where article title rollovers are wrong.

I’m using a modified version 1.1 on TXP 4.0.6.

The code to generate the days of the week uses a magic number which is fed into PHP date functions and back out again to get the day names in the correct locale. Unfortunately the magic number is massaged according to some server offset which is either +10 hours or -14 hours, depending on the time of day.

To fix the problem, I took a different approach. I picked a date that is/was/will always be Sunday, i.e. 4th Jan 1970.

Find the dspDayNames function (it’s near the end of the plugin). After the block of code:

for($i=$start; $i<$end; $i++) {
    // Remove the tz_offset because safe_strftime adds it, but we get locale support
    $names[] = ucfirst(safe_strftime($this->dayNameFmt, 86400*$i - tz_offset() ));
    }

insert the following:

$names = array();
$sunday = strtotime("1970-01-04");
for($i=0; $i<7; $i++) $names[] = ucfirst(safe_strftime($this->dayNameFmt,$sunday + 86400 * $i));

You could probably delete the lines before but to be on the safe side, this way the mod simply resets the $names array.

Offline

#146 2008-09-02 04:49:29

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] mdp_calendar

gomedia wrote:

Hi net-carver, my change is a change of someone elses change … if that makes sense. See post #130.

Ok, now I see it. I’m merging all these changes together and will post the combined source on my GitHub account when it’s done.

Thank you!

Last edited by net-carver (2008-09-02 04:49:57)


Steve

Offline

#147 2008-09-02 06:14:24

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] mdp_calendar

All

I’ve merged all the recent changes posted here into the code. If you are interested, you can…

  • grab the latest php file and compile it yourselves or…
  • grab the compiled version from Gist.

This is based on Marshall’s v1.1 plugin and includes patches by Adi, Brun and LeonNet.

If you spot any mistakes in the merging of those patches — or if I’ve generally broken things — let me know.

Last edited by net-carver (2008-09-02 06:18:30)


Steve

Offline

#148 2008-09-09 12:22:32

richardjkeys
New Member
From: Barnsley/Halifax UK
Registered: 2008-09-09
Posts: 3
Website

Re: [plugin] [ORPHAN] mdp_calendar

First let me say excellent work to everyone who’s ever had anything to do with this plugin.

Now then, down to business.

My install is running in a Sub Dir for development on my machine. Because of this the calendar’s nav was broken, and it took me to the root of my server (which is where you’d be on a live site)

To “fix” this I removed the “/” from the return and $r variables of the navigation method in the PHP. (lines 266 and 269 on Github).

I imagine this will have consequences when my site is in the root of a server.

Now for another problem…

My calender correctly displays days with events on them, and past events can be viewed by clicking the date. Ace!

However, although the calendar identifies dates with future events, clicking on it gives me a blank page!

Anyone have any idea why?

To fix this I simply added time=“any” to the txp tag in my page template

<div class="hfeed"><txp:article limit="5" /></div>

so that it reads:

<div class="hfeed"><txp:article limit="5" time="any"/></div>

Daft of me really! Hopefully this will help someone out there!

Also my title attributes for these links are a day off…I think I read somewhere that there is a fix, so if anyone can point me in the right direction I’d be greatful :)

fixed this, ta jagorny

Sorry if any of this has been covered extensively already, but the forums surrounding textpattern calendars are getting a little difficult to follow!

Last edited by richardjkeys (2008-09-09 13:07:17)

Offline

#149 2008-09-14 13:31:48

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: [plugin] [ORPHAN] mdp_calendar

multiply sections not allowed, just one, am i right?

Offline

#150 2008-09-14 22:47:22

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [plugin] [ORPHAN] mdp_calendar

Gallex wrote:

multiply sections not allowed, just one, am i right?

Yes, you’re right but it’s not compulsory – you can specify a category or author instead.

Offline

#151 2009-01-05 14:06:41

quemultimedia
Member
From: Nairobi
Registered: 2008-12-31
Posts: 42
Website

Re: [plugin] [ORPHAN] mdp_calendar

How does one apply CSS styles to the calendar?

Just installed it, using bc mdp_calendar_small on my ‘test’ homepage, so far, displaying okay, now just for some cool styling [still new with Textpattern, doing offline ‘tests’ first before pulling down my current site.

Ideas, anyone?


Que,
Que-Multimedia

Offline

#152 2009-01-05 14:37:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: [plugin] [ORPHAN] mdp_calendar

quemultimedia wrote:

How does one apply CSS styles to the calendar?

Since I’ve pretty much rewritten this entire plugin I feel qualified to answer: it’s limited. You have 4 classes available:

  1. the entire table (if you used the plugin’s class attribute)
  2. if a cell contains an event it is tagged with class hasarticle
  3. if the cell is today’s date it is tagged with class today
  4. if the cell is empty (i.e. the blank cells at the start/end of the month) the cell has a class of invalidDay

That’s it. The rest you’ll have to do with CSS selectors. If that’s not enough and you want complete control over the cells and classes, wait a tiny while for smd_calendar to be officially released, which gives you the freedom to build a calendar and manage events exactly how you want to.

Last edited by Bloke (2009-01-05 14:38:29)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#153 2009-01-06 09:59:57

quemultimedia
Member
From: Nairobi
Registered: 2008-12-31
Posts: 42
Website

Re: [plugin] [ORPHAN] mdp_calendar

have used those to bring about some slight alterations to the look and feel of the calendar, however, would like to ‘tweak’ and ‘tune’ it some more….


Que,
Que-Multimedia

Offline

#154 2009-01-20 00:12:44

zipside
New Member
Registered: 2009-01-20
Posts: 1

Re: [plugin] [ORPHAN] mdp_calendar

Nevermind, I see the new calendar!

Last edited by zipside (2009-02-02 19:33:10)

Offline

#155 2010-08-26 05:30:32

playzea
New Member
Registered: 2010-08-25
Posts: 3

Re: [plugin] [ORPHAN] mdp_calendar

my calendar does not link to article

how do i fix it?

Offline

#156 2010-08-26 06:33:46

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] mdp_calendar

This plugin is not supported anymore. Have a look at smd_calendar.

Offline

Board footer

Powered by FluxBB