Textpattern CMS support forum

You are not logged in. Register | Login | Help

#191 2009-03-10 16:13:41

woof
Member
Registered: 2004-08-01
Posts: 128

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

I’m using <txp:smd_article_event /> and time=“future” to display a list of current and upcoming events, however it seems that articles where the date posted has passed but date expired is still in the future (ie spanned events) are not included in the output – is there any way around this? The behaviour I need is for the article to disappear once the expired date has passed as opposed to the posted date. cheers

Offline

#192 2009-03-13 15:00:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

v0.42 is out [ uncompressed ]

Features:

  • datefields added (thanks merz1 / progre55 /woof)
  • added date ranges and allspanned (thanks woof)
  • fixed remap (thanks Els)
  • fixed empty classes and class name padding (thanks jakob)

This is an interim release. More to come when I get time.


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

#193 2009-03-13 15:42:30

woof
Member
Registered: 2004-08-01
Posts: 128

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

Thanks Bloke!

Offline

#194 2009-03-13 18:46:49

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

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

Wondering why you should thank people who cause you headaches… ;) Thank you Stef! :)

Offline

#195 2009-03-13 19:12:03

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Stef;

If I have not said it before, you are awsome and I personally believe that you are a driving factor on why TXP is wheer it is today …

Offline

#196 2009-03-13 19:26:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

Aww shucks, thanks for all the thanks everyone :-) Just doing my bit.

I think this version should help out quite a few people. I’d be especially interested to hear if using datefields to specify start and end dates solves the DST / time zone conundrum. Since the values in your nominated custom field(s) are simply just seen as text to TXP, it has no notion of its ‘data type’ and therefore cannot apply any automatic correction to it.

Thus (I hope) that a start date of 30-Jul-2009 14:00:00 remains that way no matter what your server / country / TXP claims the real time is — both at the time a visitor views your site, and from your article’s perspective. Whether that’s a good thing or not remains to be seen. If anything. it’s not a true solution. But if it’s a workaround at least it’s something to work with / refine.

Last edited by Bloke (2009-03-13 19:27:58)


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

#197 2009-03-15 00:33:44

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

Grmpff, looks like I have to start working on the calendar on my site because of missing long lasting British developer resistence. Thanks for that extra work still to do dear Stef!

Did we talk about fully featured iCal subscriptions and iCal offerings yet :-)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#198 2009-03-15 11:15:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

merz1 wrote:

Did we talk about fully featured iCal subscriptions and iCal offerings yet :-)

Kind of. It works one way at least. Syncing a TXP calendar to other people’s iCals — which I don’t think is possible in a useful manner, though I haven’t looked into the feasibility yet, and know nothing about the iCal spec — would have to wait until the increased plugin size limit becomes mainstream. I’m fresh out of space.

But during my cursory think-through, I’m of the opinion it shoud be a companion plugin because I don’t think I’m clever enough to implement it. Unless I’m mistaken (wouldn’t be the first time!), it would have to read an iCal XML document and create articles based on the content, right? That is, some kind of ‘import’ functionality, yes? It would have to offer a shedload of configuration options to deal with the following situations (and more — these are off the top of my head) :

1) How you want the start and end times imported (into your own datefields or the TXP date fields)
2) How to deal with invalid dates (if present — might not need to worry if the iCal spec performs error checking already)
3) How to deal with duplicate URL titles
4) More specifically, how to work out the frequency if an event occurs more than once in the XML document. e.g. if the importer code saw:

SUMMARY:event1 DTSTART=15-03-2009 21:00:00 DTEND=15-03-2009 22:00:00
SUMMARY:event1 DTSTART=22-03-2009 21:00:00 DTEND=22-03-2009 22:00:00
SUMMARY:event1 DTSTART=29-03-2009 21:00:00 DTEND=29-03-2009 22:00:00
...

it assumes (rightly? wrongly?) it is the same event because the title is the same, but how does it know to set the frequency field to 1 week? And what if there’s one date that’s ‘off’ by a day or two and needs to be manually added? Do you tell the importer to put ‘weird’ dates in a particuar custom field (your extrafield)? How do you define ‘weird’ programmatically? :-s

So currently — and I know it seems that every time you come up with some idea I shoot it down, it’s not personal! — unless someone can show me otherwise, I’d like to brush this feature request under the carpet and forget it exists :-) Maybe you can convince me otherwise or convince someone better at coding than I am to tackle it, because it looks like a whole heap of work to me that I have neither the energy to write, nor a Mac to test.

Last edited by Bloke (2009-03-15 11:16:19)


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

#199 2009-03-16 11:50:43

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

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

Hi Stef,

Thanks again for the great plug-in.

I’ve just uploaded the new version of the plug-in and I’m getting a completely blank site with the following error –
Fatal error: Call to undefined function smd_expand_daterange() in /var/www/vhosts/enfieldbeekeepers.org.uk/httpdocs/textpattern/lib/txplib_misc.php(570) : eval()'d code on line 1666

Not sure if I’ve created the error somewhere along the way.

Offline

#200 2009-03-16 12:05:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

decoderltd wrote:

@Fatal error: Call to undefined function smd_expand_daterange()

Yowzers. I was running perilously close to the (current) maximum size of a plugin and developing in the newer SVN environment with the lifted size restriction. I thought it was just fine, but could you please make sure that the plugin has not been cut short by accident. Check the source code. It should end with:

...
	} else {
		$out[] = strftime($fmt, strtotime($rng[0]));
	}
	return $out;
}

EDIT: and did you install the compressed plugin?

Last edited by Bloke (2009-03-16 12:06:08)


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