Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2009-02-05 19:54:38

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

Re: smd_calendar: complete schedule / event / calendar / diary

decoderltd wrote:

category="Calendar-course"

The use of uppercase in the category name?

Offline

#74 2009-02-06 10:44:32

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Hi Julián and Els,

Thank you for your replies, and for spotting some sloppy coding on my part! I’ve now amended both those points but it still behaving in the same way. It’s very odd and not sure where to look next…

Offline

#75 2009-02-06 11:26:26

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

Re: smd_calendar: complete schedule / event / calendar / diary

decoderltd wrote:

Whenever I include the Courses output I get horrendous lag –

Ouch! That’s not natural. I’ve copied your code (thanks for the detailed description of the problem, btw) and put it on my test server and it renders without lag so I have a couple of questions to try and help me track this down:

  1. Roughly how many articles do you have a) in total on your site, b) in the respective categories? No need for complete accuracy, just a guide so I can rule out pure volume as the driving factor in this problem
  2. What is your frequency set to in custom_1 for a typical article in the calendar-course category? If you have a few different event frequencies, can you post the ones you are using please, because one or two of them may be things I’ve not considered/catered for in the code and may be causing breakage

I have found a subtle bug in the plugin which I just fixed in my development version. It only occurs if your frequency is set to 1 month (or 2 months, or 3 months, etc). If you have used this frequency, try replacing it with something like 30 days or 4 weeks and see if the problem goes away. If that is the issue I’ll post you the two-line fix until I can get v0.41 into order.

Having said that, even with the buggy version, my test results come back pretty quickly with 3 smd_article_event tags on the same page pulling stuff from 3 different categories.

This is a puzzler for sure.

EDIT: oh, also, if the problem persists, try adding debug="1" (or 2 or 3) to the tag and see what you get out. Mail some of it to me if you like and I’ll see if it gives any clues.

Last edited by Bloke (2009-02-06 11:31:35)


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

#76 2009-02-06 11:55:48

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Hi Stef,

Many thanks for your quick reply. It was indeed the frequency that was causing the problem (doh, I should have checked this first), I had used a day frequency without a corresponding number and once I removed it everything was fine. Apologies, it was my fault and your fine plug-in is completely blameless.

On the subject of the frequency custom_field, is it possible to use actual dates – I have an multi-day event which doesn’t fall on neat intervals. I tried a chain of intervals (7 days,10 days,15 days…) but that didn’t seem to work.

Offline

#77 2009-02-06 11:58:28

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

Re: smd_calendar: complete schedule / event / calendar / diary

decoderltd wrote:

It was indeed the frequency that was causing the problem

Cool, glad it’s working now.

the frequency custom_field, is it possible to use actual dates

Can you use extrafield for this instead? i.e. make up a standard or spanned event and then use the extrafield to tell the pugin the specific dates upon which it recurs? Chains of frequencies do add more than one date to the same event, but as you found they must all be regular intervals for it to work.

EDIT: Alternatively, use a frequency of the best fit, then specify a skipfield to cancel the ‘weird’ dates and add the rescheduled dates in the extrafield.

Last edited by Bloke (2009-02-06 12:05:37)


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

#78 2009-02-06 12:03:43

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Thanks Stef, stellar support as always.

Offline

#79 2009-02-08 18:50:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,577
Website

Re: smd_calendar: complete schedule / event / calendar / diary

HI Stef, after trying out smd_tags yesterday, I’ve been playing with smd_calendar today. Loving it’s tailorability though the docs are daunting (copied them to a word-doc and printed them out so I can follow them while working and it was 20 pages!).

Back to my question:

  1. How should I best do multi-day (spanned) events that are offered a couple of times a year at irregular intervals? For example, a weekend workshop that is offered in May, July and August. I used the posted and expire dates for the first instance (3 days Fri-Sun), then entered the begin dates for July and August in an extrafield as follows 2009-07-17,2009-08-21 specified as extrafield="custom_4" in the tag. The calendar and the event list include the event three times over perfectly, but the extra dates are only a single day, rather than 3-days. Is there a special notation for specifying from-to dates in the extrafield? I tried adding all three days in the extra-field but that results in three single-day entries in both the event list and calendar.
  2. Finally, what do I need to enter to force language display without changing the backend. I’ve tried de, de_DE, deu, ger, de_deu and variations for the lang="de_DE" attribute but with no luck. It does work when changing the system prefs. I tried my luck with specifying explicitly using monthformat like you have for dayformat but to no avail [all this is not so important].

TXP Builders – finely-crafted code, design and txp

Offline

#80 2009-02-08 19:26:08

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

Re: smd_calendar: complete schedule / event / calendar / diary

jakob wrote:

the docs are daunting

Yeah, sorry about that. A screw up I made with ied_plugin_composer left me with a false sense of security about how much actually fits in a full HTML help doc. The last few, ummm, ‘pages’ shall we say are unceremoniously missing and that included the style information :-( v0.41 has fixed this. I might rush it out this evening if I can, in lieu of a full release just to fix this and a couple of other nigglets.

How should I best do multi-day (spanned) events that are offered a couple of times a year at irregular intervals?

Hmmmmm, that’s what I’d consider a bug. If not a syntactical one, a logical one.

The extra dates were designed for one-offs to re-schedule cancelled dates, but your scenario seems equally logical — that you would want the entire event copied to the new date, no matter how many days it spanned. I’ll have to see if that’s possible. Not sure if I can do it but I’ll try and make it work alongside the existing method (since you may wish to cancel one day of a spanned event, for example, and reschedule it, you may not want the whole event duplicated in this instance).

what do I need to enter to force language display without changing the backend… It does work when changing the system prefs.

For the same reason I noted to Rick I’ve actually all-but taken out the gmt/lang attributes pending their probable removal. Though they might make it back in again if I end up relying on safe_strftime(). Either way, the gmt and lang are only for the display of dates; the same way they are used in <txp:posted />.

Currently, the only way to change the month names is via the admin-side language. I have not implemented the same system as with day names (though I probably could… I think, would have to check). Are you essentially asking for MLP compatability so that the calendar automatically changes based on browser language? That would be much more tricky, since all the month names and dates are rendered directly from PHP’s own date functions. I don’t know if there’s a way of specifying how to render those in a different language. If you know of a way, please let me know!

Last edited by Bloke (2009-02-08 19:26:38)


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

#81 2009-02-08 20:52:28

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,577
Website

Re: smd_calendar: complete schedule / event / calendar / diary

the docs are daunting – Yeah, sorry about that

Oh, no need to apologise – I meant that they were already impressive! Just easier to digest on paper. I hadn’t realised something was missing as they were complete right up to the changelog.

multi-day (spanned) events that are offered a couple of times a year at irregular intervals … I’ll have to see if that’s possible.

That would be great. It was pure chance that the first real infos that I had to test with happened to present that situation. I’m just testing bit by bit for the moment.

Are you essentially asking for MLP compatability so that the calendar automatically changes based on browser language?

No, that’s no problem. I have no need for MLP, I was just trying it out because it was in the docs :-) As an Englishman living in Germany I happen to prefer developing with the back-end set to English but the site would be in German. Maybe a simple solution would be to implement what you have for the dayformat for monthformat too, so that one can specify twelve strings for the months? Again, no hurry – it’s no problem to switch the back-end to German when the time comes.


TXP Builders – finely-crafted code, design and txp

Offline

#82 2009-02-08 21:16:36

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

Re: smd_calendar: complete schedule / event / calendar / diary

jakob wrote:

…they were complete right up to the changelog.

Did it get that far? It’s not as bad as I thought then. I’ve dropped the changelog in the official docs, which helped immensely, and will just put them online and in this thread. But the documentation is eased with the styles in place. I’ve fixed ied_plugin_composer btw so it won’t render help that is too big for the database. Curiously enough, it’s only my plugins that are affected… I wonder why :-p

I have no need for MLP

Phew! That would be tricky to implement.

I was just trying it out because it was in the docs :-)

Yeah the plugin and docs don’t quite mesh up while the fate of those two attributes hangs in the balance. On one hand they should be there because they’re useful when using safe_strftime(). On the other, I can’t make the plugin work with safe_strftime() so the two attributes are nigh-on useless!

Mind you, according to Rick it’s not quite working with vanilla strftime() either, so something’s definitely up with the time zone calculations. I thought it was OK after mrdale and I thrashed out a solution but clearly it’s not and I need to do some more testing in non-GMT mode.

Maybe a simple solution would be to implement what you have for the dayformat for monthformat too

Yes, and for the life of me I can’t remember why I didn’t do that at the time. I vaguely remember attempting it and giving up, but maybe I didn’t try hard enough or just dreamed that bit. Is it sad when you start dreaming about TXP code? Probably…

Last edited by Bloke (2009-02-08 21:18:32)


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

#83 2009-02-09 02:32:24

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: smd_calendar: complete schedule / event / calendar / diary

To be clear, I’ve no complaint here nor any need to have anything by the end of the day, or the month for that matter, this work just has such elegant potential that I would like to see it get the support and feedback that it rates.

according to Rick it’s not quite working with vanilla strftime()

Actually, what I did was leave the calls to safe_strftime() in and tried to set site and such to GMT and build tags to manually apply time zone offsets to display tags, this experience being much like getting ones’ tongue frozen to the play ground tether pole – I have since abandoned the idea. (One has to love time handling in TXP)

I have tried changing the calls to safe_strftime() to strftime(), with one exception, and I can get things working localhost as I would like that way – though not on a live server with a time offset, (so I may take another stab at the tether pole).

I’ve read the threads, any I could find, and the docs and haven’t found a workaround that suits me yet, so I’ll await the next version and see what of constructive value I can come up with then.

Offline

#84 2009-02-09 09:06:51

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

Re: smd_calendar: complete schedule / event / calendar / diary

rsilletti wrote:

To be clear, I’ve no complaint here

Sorry, didn’t mean to imply you had. Bad wording on my part when I read it back in the cold light of day. Apologies if it sounded critical; I’m incredibly grateful for the attention you have given this because I’m at my wits end with time/time zone handling!

I think I did pretty much the same as you: started off with leaving safe_strftime() as they were in the original mdp_calendar. When I/mrdale realised that wasn’t working I swapped all but one out for strftime() and that “worked” for mrdale on GMT-08 so I just figured it was OK across time zones and all was well. Clearly not quite… :-(

After reading up on date handling, including saccade’s excellent posts on the subject, I’m also at a loss as to how to handle it “properly”. I hope there is a fix to allow this plugin to work consistently, but at the rate things are going it might end up being easier to work on patching TXP so it doesn’t adjust the dates in the first place!

I’m at the major disadvantage that I have a GMT host and live in the GMT zone so it is very difficult for me to simulate potential problems around the world (“Dear Mr Host, please would you adjust your time zone setting on the server so I can test something…”). Any assistance or test reports anyone can offer in other parts of the globe are very, very welcome.


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

Board footer

Powered by FluxBB