Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#271 2009-05-19 21:32:41

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

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

Still playing with this magic plugin. Have a lot of comments, questions and requests ;)

But now, I’m just coming to report a… bug?

If you are following Example 6, then, inside the smd_article_event, you have this attribute (slightly modified code, added explicit format):

to='<txp:smd_cal_now now="?month-?year" offset="1 month" format="01-%m-%Y" />'

The rendered value for to is 01-02-1970, and that’s wrong.
If you change the now attribute so the thing becomes this:

to='<txp:smd_cal_now now="01-?month-?year" offset="1 month" format="01-%m-%Y" />'

Now, it works as expected. :)

BTW, if you are using another language (!= en), or if you are using some “weird” format on Basic Prefs for date, I suggest you to explicitly set the format attribute.

Finally, this plugin is pure magic: it even let you use negative values for the offset attribute. like this: <txp:smd_cal_now now="01-?month-?year" format="%d-%m-%Y" offset="2 month -1 day" />.
This way, you will get the latest day of previous month (it could be 30, or 31, or 28/29), so for example, you can tell smd_article_event to list evens from 1st May to 30th June, and not to 1st July.

Last edited by maniqui (2009-05-20 13:54:17)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#272 2009-05-19 23:24:50

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

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

More things to report.
Possible bug: the small calendar is displaying recurring events with an expiry date as multi-day (spanned) events.

I noticed this after taking a look at a small calendar… and noticing that every sell in the calendar (every cell in the calendar after the very first recurring event with an expiry date) was being linked to its correspondent date.

Looks like a bug, right?
Bloke, please, tell me if you need more info.

Last edited by maniqui (2009-05-20 13:54:35)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#273 2009-05-20 13:03:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

maniqui

Thanks for the reports on your progress. I’m not ignoring you, honest!

RE: wraptag, I deliberately left it out for the reason you stated: the calendar is a table, it will always be a table (ever tried coding a calendar with divs/floats?!) and as you know, tables have at least three attributes: wraptag (table) break1 (tr) and break2 (td) — and possibly th as well. So it gets very messy. I chose to focus the plugin on the cell content rather than the cell make-up itself. Even cellform formats the content; everything is assumed to be inside a <td>. I can look into your request for wrapping event list content better.

Interesting thing about the single quotes around {events}, thanks for pointing it out. I would mention that in the docs if I had space! I guess the reason is that {events} (and other such replacement tags) are usually made up of HTML tags like <a href="link">... </a> so the variable tag sees the double quotes in the anchor as the end of the variable’s value and it causes a problem. Equally, if you also had single quotes in your link e.g. <a href="link">I'm an article</a> then you’d really be stuffed :-(

I think Example 6 is wrong: well spotted, thanks. It should probably have the day in it, but having said that it depends on what you expect the definition of “1 month” is! For example, is 6th Feb -> 6th March one month, even though feb is shorter? Or is 1 month really always 30 or 31 days? Hmmmm. I’ll see if the example really is wrong or the ?month/?year thing is not working properly.

the small calendar is displaying recurring events with an expiry date as multi-day (spanned) events.

I’ll check that out. May well be a bug: I don’t use the small calendar much so it hasn’t been tested as rigorously.

Thanks for giving the plugin a good run for its money :-) I’ll try and make time to fix all the outstanding issues (that is, issues that have been mentioned since the last release, not that the issues themselves stand out from the crowd!) early next month after I have finished the latest glut of site housekeeping / plugin development.

Incidentally, have you played at combining smd_calendar with smd_horizon? You can do some mental navigation; for example keeping your calendar focused on any given month, showing events from particular categories and stepping through events in those categories one by one to see the full event details — even for future events!

Last edited by Bloke (2009-05-20 13:05:18)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#274 2009-05-20 15:01:37

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

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

Hi Bloke,
thanks for your replied, and sorry (everybody) for some of my posts, which were full of typos or unclosed sentences, hehe.

Bloke wrote:

(ever tried coding a calendar with divs/floats?!)

No, never, although once I was sold on the idea of “a calendar is a list (ordered list), not a table”. Thankfully, I left those [über|wrong]-semantic über-OCD ideas behind. Others didn’t.

I’ll check that out. May well be a bug: I don’t use the small calendar much so it hasn’t been tested as rigorously.

What do you think about deprecating the small calendar and replacing it by a large calendar tuned to look/work as an small calendar? (as mrdale has done here)
Although I haven’t tested it yet, I think the small calendar is fully replicable using the large callendar + forms.

Incidentally, have you played at combining smd_calendar with smd_horizon?

Not yet (and didnt test smd_horizon standalone either). Still wrapping my head around smd_calendar.
As I said somewhere else, we all have to be careful when using smd_calendar + tags-in-tags. Wouldn’t like to create some kind of perturbation on the space-time continuum.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#275 2009-05-20 19:39:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

maniqui

Blmey! Someone persevered with a table-less calendar. They’ve got more patience than me; I tried it and gave up after half a day of testing in smd_calendar and just stuck with a table! The attributes were a nightmare to get right.

What do you think about deprecating the small calendar and replacing it by a large calendar tuned to look/work as an small calendar? (as mrdale has done

Yeah, that rotiecellars site was a real hack-fest in the calendar department. It took an evening of back and forth emails and instant message ‘how about this’ testing before we got it to work properly.

I have considered dropping the minical. It’s a real pain for any serious event work, and is only in there as a leftover legacy from the plugin’s mdp_calendar roots. The fact that it can only link to ?date= events (which are then internally translated into a standard TXP ?month= URL) was fine in mdp_calendar but is a big drawback given the power of the rest of the attributes in this plugin.

But it does fill a hole and if I dropped it — even if it was implemented internally as a fake full-size calendar — I’d probably miss something and would break existing minical sites. Perhaps it could be a long-term goal of the plugin post-4.0.9 when I get some more plugin space. Will chew it over some more.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#276 2009-05-22 14:30:06

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

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

Hi Bloke,
thanks for your reply.

I’ve this question: what’s the difference between skipfield and omitfield? Could there be any problem if both are used? (ie. if the skipped/omitted date is filled in on both)

A few more things/bugs to report:

  • on small calendar: omitted/canceled events are being displayed.
  • on a smd_article_event list, an extra date (for a recurring event) isn’t being displayed (fyi, the event doesn’t have an expiry date).

Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#277 2009-05-22 16:14:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

maniqui wrote:

what’s the difference between skipfield and omitfield?

Semantics!

  • skipfield is for events that are cancelled, e.g. “Very sorry but the Women’s Institute meeting on 22nd May is cancelled due to a siege in the church”. Such events are flagged as cancelled so you can style the cell accordingly
  • omitfield is for preventing an event appearing at all on the calendar on a particular date. No flag is set, except in one special circumstance that is documented in the plugin help. The most common use for this is if you have a spanned event that runs for 3 weeks on weekdays only. You can specify the 3 weekend dates as ‘omitted’ because the event really doesn’t happen on those days (it’s not technically “cancelled”)

Could there be any problem if both are used?

Nope. Can’t remember what happens if you specify the same date in both fields and use cellplus mode. One will take precedence and I can’t remember which that is. Your CSS rule order will determine which you see.

on small calendar: omitted/canceled events are being displayed.

Nuts. I think I know why it’s doing it. The code for checking cancellations/omissions isn’t being honoured properly. Changing it means duplicating tonnes of code for the small calendar. Maybe I will make the small one a ‘fake’ large cal after all!

on a smd_article_event list, an extra date (for a recurring event) isn’t being displayed (fyi, the event doesn’t have an expiry date).

Weird, can you give me some specifics for this one please, like some tags and a bit of info on what field values you have set in the article. I’m sure it worked when I tested it, but maybe I missed something. Thanks.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#278 2009-05-22 19:14:02

XcomeX
New Member
Registered: 2009-05-22
Posts: 2

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

Hi Bloke,

I want ask you for help.

I am trying use your plugin but I still getting this error message:

Tag error: <txp:smd_calendar section=“Events”> -> Textpattern Warning: tag does not exist on line 1104

I was looking for any solution over the internet but I got just know it should be something about improved tag parser in TXP 4.0.7 but I do not know how to solve this problem with your plugin.

I tried to use this code from your Example 1 in TXP 4.0.8:
<txp:smd_calendar section="Hudba">
<div>
Event: <txp:permlink><txp:title /></txp:permlink>
<br /><txp:excerpt />
</div>
</txp:smd_calendar>

Can you help me?..what I am doing wrong?

Thanks.

Last edited by XcomeX (2009-05-22 19:14:28)

Offline

#279 2009-05-22 19:17:08

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

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

XcomeX,
could you please confirm the plugin is installed and activated?

Also, your section name should be in lowercase. You can use uppercase on your section title (take a look at “Presentation -> Sections” in your TXP admin).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#280 2009-05-22 19:43:41

XcomeX
New Member
Registered: 2009-05-22
Posts: 2

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

maniqui wrote:

XcomeX,
could you please confirm the plugin is installed and activated?

Hi maniqui and thanks for so fast reaction,

and yes the plugin smd_calendar 0.42a is installed and activated.

Also thanks you remind me the lowercase name. I have changed it so now the code is:

<txp:smd_calendar section="hudba">
<div>
Event: <txp:permlink><txp:title /></txp:permlink>
<br /><txp:excerpt />
</div>
</txp:smd_calendar>

… but still not working.

And I tried to run this plugin on TXP v4.0.6. and the Tag error on line 1104 was OK.
There was some other error but I thing that because this plugin need v4.0.7+ so it is not important for this case.

Last edited by XcomeX (2009-05-22 19:44:07)

Offline

#281 2009-05-23 08:10:58

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

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

Hi Bloke & everybody, this is truely an amazing plugin and it´s great fun to play with :). Ahead of that i am impressed by the 16 pages manual wow…

maniqui did mention an issue he an i have on an event article list:

on a smd_article_event list, an extra date (for a recurring event) isn’t being displayed (fyi, the event doesn’t have an expiry date).

Weird, can you give me some specifics for this one please, like some tags and a bit of info on what field values you have set in the article. I’m sure it worked when I tested it, but maybe I missed something. Thanks.

Here is the code we use on this test site. We have a section called termine where all events of the current year shall be listed ash.kbbu.de/termine
additionally we have section where you´ll find the big event calendar and below all events for the current 2 months shall be listed ash.kbbu.de/terminkalender.

On both event article lists the omitted/skipped event article of the recurring event “Walkin on the Moon” “ I go nuts here!” has not the correct date. It is cancelled and omitted for the 1st of June and shifted (per extrafield) to the 2. june On the list and the calendar 1st is displayed (which shouldn´t) – 2. june does not appear though it should.

Here is the code for the section termine: ash.kbbu.de/termine

<!-- EVENTS ARTICLE LIST -->
<h2>All Events List for 2009</h2>
<txp:smd_article_event section="termine" time="any" stepfield="custom_1" skipfield="custom_2" omitfield="custom_3" extrafield="custom_4" paging="1">
<txp:if_different>
<txp:posted format="%B %Y" />
</txp:if_different>
Event starts: <txp:posted />
Event cat: <txp:category1 title="1" link="1" />
<txp:permlink><txp:title /></txp:permlink>
<txp:body />
</txp:smd_article_event>
<!-- END OF EVENTS ARTICLE LIST -->

The code for section ash.kbbu.de/terminkalender differs only slightly

<txp:smd_article_event section="termine" stepfield="custom_1" skipfield="custom_2" omitfield="custom_3" extrafield="custom_4" time="any" from='<txp:smd_cal_now now="01-?month-?year" format="%d-%m-%Y" />' to='<txp:smd_cal_now now="01-?month-?year" format="%d-%m-%Y" offset="2 month -1 day" />'  paging="1" sort="Posted asc">

I tryed all and everything to get the events article list to work propperly to no avail (removed omitfield, skipfield… added them step by step and so on…)
On the big calendar the dates are all correct for this recurring event.

Anybody any idea?

Last edited by alexandra (2009-05-29 09:08:22)

Offline

#282 2009-05-29 10:02:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

alexandra wrote:

On both event article lists the omitted/skipped event article of the recurring event “ I go nuts here!” has not the correct date. It is cancelled and omitted for the 1st of June and shifted (per extrafield) to the 2. june On the list and the calendar 1st is displayed (which shouldn´t) – 2. june does not appear though it should.

Sorry about the delay getting back to you. It’s weird though: your example works fine for me on my test site. I copied your code (just changed the section to match the one on my site) and set up an event like this:

  • Start: 29-may-09 (midday)
  • End: 29-Jun-09 (midday)
  • Step: 3 day
  • Skip: 01-jun-2009
  • Omit: 01-jun-2009
  • Extra: 02-jun-2009

It missed out the 1st june and put the event on the 2nd june in both the big calendar and the event list. It also listed the dates correctly.

Of course, due to the small calendar bug that maniqui found, it will be rendered incorrectly (1st AND 2nd June) on the minical. But the custom fields are working for me so it’s probably something to do with your setup/server; espcecially if it is showing up correctly on the calendar but not the event list. Can you check a couple of things please:

  1. The times of your event start / end. Until we can propose a patch for either smd_calendar or the core, timezone shifts and DST settings mean that sometimes events move a day if you use times at the start/end of the day. That’s why I set midday as the start of spanned events — it’s not pretty but it works
  2. The format of your dates in the custom fields. If you use 01-06-09 (or something like that) then perhaps one of the tags (smd_calendar or smd_event_list) is interpreting it as 6th Jan 2009 or 6th September 2001 or 9th June 2001. As mentioned in the docs, I always try to stick to dd-AbbreviatedMonthName-yyyy for that reason

If it’s neither of those, I may have to ask for a login to your site to see if I can figure it out (if you don’t mind).


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#283 2009-05-29 11:26:04

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

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

Bloke schrieb:

If it’s neither of those, I may have to ask for a login to your site to see if I can figure it out (if you don’t mind)

Hi Bloke,

i did performe all tests i can think of: changed dateformats for the fields to 29-jun-2009, set time to 12:00:00, changed DST to NO and GMT=0 changed it back and published a completely new event article…. it will not work expecially not if i change DST + GMT. Right now it did even add an event article for 30 November 20018 – perhaps the day the first UFO lands on cologne cathedral?

Would be very kind if you can put an eye on our code.. i will send you a login via PM ….

Offline

#284 2009-05-29 12:42:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

alexandra

Thanks for the login. It’s an obscure PHP bug / feature. The PHP function strtotime() converts a “human-readable” date to a timestamp which my plugin can use. I tested it under your PHP version (4.4.8) by converting a human-looking date string to a timestamp and then back to a date. This:

date("d M Y", strtotime("13 Jun 2009"))

produces 13 Jun 2009 as expected, but this:

date("d M Y", strtotime("2009 Jun 13"))

produces 30 Nov 2018!

For reasons I cannot recall, smd_calendar was using the latter syntax for extra dates.

The fix

Please, everyone who has this plugin installed (except alexandra as I’ve done it already), go and do this now until I get a chance to release a proper patch: search for "%Y-%b-%d" in the plugin (it occurs once quite near the bottom of the file) and change it to "%d %b %Y".

Go figure! Thanks again alexandra for the report and letting me diagnose it on your server. Sorry it took so long.

EDIT: I’ve made a cheeky fix to the version on my site to take it to v0.42b. So you can download that and install it if you prefer to avoid seeing the ‘Modified’ thing in your plugin list.

Last edited by Bloke (2009-05-29 12:52:49)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#285 2009-05-29 15:40:27

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

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

Hi Bloke,

thanks soooo much for fixing this… maniqui and i did nearly slide into a deeper depression (maniqui more than i as it is nearly grey winter over in Argentina). We tested so much … day and night, year by year till today ;)

Wonder if it wouldn´t be a good time right now to drop the small cal and instead adding a faked big one to the plugin? We work on a faked small one and mrdale did already put this all together. So perhaps it wouldn´t be so much to get it all together? What you think? It´s just a question and i believe your time is limited …

Again many thanks, alex

Offline

Board footer

Powered by FluxBB