Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
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.

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: 11,448
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.

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: 11,448
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.

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

#286 2009-05-29 15:46:45

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

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

alexandra wrote:

Wonder if it wouldn´t be a good time right now to drop the small cal

Glad it’s working for you now. I’m sorely tempted to remove the minical one day. It’s really annoying me and adds to a lot of code duplication in the plugin. Will have to see how easy it is to remove. Watch this space.


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

#287 2009-05-31 06:20:21

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

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

haven’t fully grokked the plugin…… any advice?

in a sidebar, I’m using a large calender as a small calendar – using Bloke’s form miniclone … in the main content area, I want to show either individual events or listings

1. at /events I want to just show all future events – easily done using txp:article time="future" – should I use chs_if_urlvar to see if there’s a date range in the URL?

2. at /events?m=6&y=2009 I want to list all events in June 2009 … how?

I’ve followed example 6 but only having success in the current month /events?m=5&y=2009…? the individual events in april & june don’t appear when accessing /events?m=6&y=2009 for example, altho they can be accessed individually when the day is added to the URL /events?d=27&m=6&y=2009… could it be something related to working on a local xampp install?

(I’m getting the current date no problem using txp:smd_cal_now)

Thanks!

Offline

#288 2009-05-31 11:18:57

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

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

Hi there,

for me Example 6 does not work at all on my events archive.

As well format="01-%m-%Y" is not working at all – i have to use format="%d %B %Y"

For Example:

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

Now i like to list all event articles from Feb of current year till today + 1 month (1st of Feb 09 – today + 1 month) so i changed the above code to:

from='<txp:smd_cal_now now="01-?02-?year" format="%d %B %Y" />'

but this will NOT work. Still the January 09 event is listed.

I wonder how i can teach the system to list event articles from the 1st of a certain month?

Last edited by alexandra (2009-05-31 11:24:37)

Offline

Board footer

Powered by FluxBB