Textpattern CMS support forum

You are not logged in. Register | Login | Help

#71 2009-02-05 16:34:34

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

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

Hi Stef,

I’m having a strange performance issue with smd_calendar. On a holding page I have a three column layout showing Events, Meetings and Courses. Whenever I include the Courses output I get horrendous lag –

<!-- Runtime: 10.473 -->
<!-- Query time: 0.006517 -->
<!-- Queries: 17 -->
<!-- Memory: 5492Kb, end of textpattern() -->

If I exclude it, the page loads very quickly. I’ve tried various permutations and it seems particular to that category. Apart from a change of category= it’s exactly the same code as the other two…

<div class="grid_5">
<h2>Upcoming courses</h2>
<txp:smd_article_event stepfield="custom_1" wraptag="dl" time="future" category="Calendar-course" eventlimit="25" expired="0">
<txp:if_different>
</br><dt><txp:posted format="%B %Y" /></dt>
</txp:if_different>
<dd><txp:permlink><txp:title/></txp:permlink></dd>
<dd><i><txp:posted /></i></dd>
</txp:smd_article_event>
</div>

…so I’ve no idea why it’s causing problems, is it possible for something to get corrupted?

Offline

#72 2009-02-05 18:00:26

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

I doubt it’s related to your issue, but you have a </br > that not only is mistyped ( should be <br />) and it’s also in a wrong place.

So, maybe it’s not a server-side performance issue but a rendering performance issue on the browser side.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

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

Els
Admin
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: 8,524
Website

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: 8,524
Website

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
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,253
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: 8,524
Website

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

Board footer

Powered by FluxBB