Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2009-01-21 14:42:04

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

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

Hi Stef,

A really big thank you for this great plug-in, it’s going to be essential for a couple of pro bono sites I’m working on. I had started using zem_event but support pretty much dried up although pebebe had expressed an interest in developing the next version. I did like it’s integration into TXP in that it didn’t need to use custom fields, which makes it very easy for clients to use. However, the functionality and options available in smd_calendar is amazing and much appreciated.

A couple of questions; I have one event which falls on the second Tuesday of each month and the only way I get it to work is to use first tuesday +1 week in custom field 1 (second tuesday just wouldn’t work) – is there a more elegant way to achieve this? Secondly, I’m trying to set-up a form to display the title/date/location/excerpt in a block, but I’m confused as to which tags I should be using – could you point me in the right direction?

Thanks again.

Offline

#38 2009-01-21 16:31:35

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

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

decoderltd wrote:

A couple of questions; I have one event which falls on the second Tuesday of each month and the only way I get it to work is to use first tuesday +1 week in custom field 1 (second tuesday just wouldn’t work)

That’s a neat way to sidestep the bug in the current version!

“second tuesday” will in fact repeat the event every 2nd tuesday not on the 2nd tuesday of the month. v0.4 fixes the second/third/fourth/fifth conundrum by officially allowing an undocumented feature that’s been lurking in the plugin for a while now. Namely, in the stepfield you can use ?month and ?year to substitute the current month/year. Thus second tuesday ?month ?year will work as you intended.

Secondly, I’m trying to set-up a form to display the title/date/location/excerpt in a block, but I’m confused as to which tags I should be using – could you point me in the right direction?

Sure, but can I get back to you on that later today? I have a few things to do right now. And first of all I’d like to…


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

#39 2009-01-21 16:38:09

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

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

… officially release v0.4 | zipped which:

  • fixes a few things like the URL rewriting, the front page foible and an infinite loop situation
  • adds the extrafield thing for FireFusion
  • adds realname support
  • adds a whole slew of new {events}
  • adds a few more output options when dealing with select lists
  • IMPORTANT: changes one thing from the 0.3x revs: when using smd_cal_info use s instead of section if you want the current (URL) section. Using section grabs the current article’s section (for example, the section of the current event on the calendar as it is being built inside one of the forms) not the section of the article being viewed next to the calendar itself! If that makes sense…

See how you get on; you know where I live.

Last edited by Bloke (2009-01-21 16:39:34)


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

#40 2009-01-21 17:09:42

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

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

Hi Stef,

Thank you for coming back to me.

I’ve upgraded to 0.4 and used second tuesday ?month ?year but none of the events are now displaying. Is there something else I need to amend?

Offline

#41 2009-01-21 17:34:38

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

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

decoderltd wrote:

I’ve upgraded to 0.4 and used second tuesday ?month ?year but none of the events are now displaying. Is there something else I need to amend?

Shoudn’t be, unless you’re using the calendar on the front page and the section containing your events is not set to Show on front page. Does it work if you specify the section name? If you’re still having trouble, add debug="1" (or 2 or 3) to get a load of stuff out and send me some of it, along with your tag/form/container and I’ll see if I can figure it out.

Last edited by Bloke (2009-01-21 17:37:31)


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

#42 2009-01-21 18:00:51

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

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

Thanks Stef,

If I change the time to, say, second tuesday, I do get an output – my +1 week trick doesn’t seem to work anymore. The tag txp:smd_article_event is set to display on the front page but the section it’s being called from is set to show on front page.

The debug gave me this:
select *, unix_timestamp(Posted) as uPosted, unix_timestamp(LastMod) as uLastMod, unix_timestamp(Expires) as uExpires from textpattern where ( Category1 IN ('Calendar-Regular-meeting') OR Category2 IN ('Calendar-Regular-meeting') ) AND ((custom_1 = '' AND Expires = 0) OR (custom_1 != '') OR (custom_1 = '' AND Expires != 0)) AND Status IN ('4') AND (now() <= Expires OR Expires = 0) ORDER BY Posted asc

My form (you’ll recognise this!) is:
</div>
<h2>Upcoming Events</h2>
<txp:smd_article_event debug="1" stepfield="custom_1" wraptag="dl" form="calendar_eventBlock" time="future" category="Calendar-Event" eventlimit="3" expired="0">
<txp:if_different>
<dt><txp:posted format="%B %Y" /></dt>
</txp:if_different>
<dd>
<txp:permlink><txp:title/></txp:permlink>,
<txp:posted />
</dd>
</txp:smd_article_event>
</div>

<div>
<h2>Upcoming Club Meetings</h2>
<txp:smd_article_event debug="1" stepfield="custom_1"
wraptag="dl" time="future" form="calendar_eventBlock" category="Calendar-Regular-meeting" eventlimit="5" expired="0">
<txp:if_different>
<dt><txp:posted format="%B %Y" /></dt>
</txp:if_different>
<dd>
<txp:permlink><txp:title/></txp:permlink>,
<txp:posted />
</dd>
</txp:smd_article_event>
</div>

…and my page tag:

<txp:article_custom id="1" pgonly="0" />
<txp:output_form form="calendar_events_columns" />

Offline

#43 2009-01-21 18:24:52

FireFusion
Member
Registered: 2005-05-10
Posts: 698

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

Wooo!!!

Thanks for the extra field Bloke!

Offline

#44 2009-01-21 18:45:22

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

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

decoderltd

Sorry, it’s because I’m a gimp.

Find line 1606 in the code:

$ival = str_replace("?year", $curryear, $interval);

and replace it with:

$ival = str_replace("?year", $curryear, $ival);

I’ll very quickly fix this and *cough* reissue 0.4 in the next 10 mins. Sorry about the false start.

P.S. your first opening div starts with a / and you don’t need the form attribute if you are using the container because the container overrides it.

EDIT: OK, reuploaded v0.4. Try that.

Last edited by Bloke (2009-01-21 18:51:28)


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

#45 2009-01-21 19:21:36

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

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

Thanks Stef, that’s done the trick – a nice list of (exciting) events.

And thank you for the code adjustments, sloppy work on my part. One final question, I’m not entirely sure how form functions within the <txp:smd_article_event> tag – I was attempting to set out the way the information was being displayed, but clearly this is not how it works.

Offline

#46 2009-01-21 19:35:53

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

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

decoderltd wrote:

I’m not entirely sure how form functions within the <txp:smd_article_event> tag

You can either use the tag as a container (as you have done above) or use the tag in its self-closing guise, and pass all processing out to a form; the result is the same either way it’s just a matter of taste.

In the form or container, you can use any HTML, TXP article tag or plugin tag as you’d normally use to display whatever you want about your events. Essentially, the tag is just a recurring-aware version of article_custom, so use it exactly as you use that and you shouldn’t go far wrong.


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

#47 2009-01-21 19:39:24

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

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

Great, thanks for your reply. I’m really looking forward to getting into the potential of this plug-in, I fear you may be hearing from me again fairly soon!

Offline

#48 2009-01-24 02:31:55

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

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

I’ve got a behavior that may or may not be a plugin issue here. I’ve got calenders working as expected except when I initially navigate to an off default page section. The link mode from the txp:popup section navigation uses messy urls when the rest of the site uses clean.
The nav arrow with a calender set in section “events” displays:

http://www.quasai.com/?m=2&y=2009&calid=event_cal

when you navigate to the section with:

http://www.quasai.com/?s=events

Tag: <txp:smd_calendar size=“large” author=’<txp:ras_user />’ section=“events” dayformat=“ABBR” id=“event_cal” navid=“event_nav” />

If you use the author search or otherwise set the section in the url as clean, you click about as you wish and you remain in the “events” section, otherwise the nav arrow returns you to the default section as the url dictates.

If you navigate to the “events” section and you have a section attribute set, shouldn’t you remain in that section with the navigation of the calender?

Edit: works as advertised with section_list, anyone have any issues with txp:popup or have I missed something with it?

Edit: also – ver. 0.33 doesn’t do this.

Last edited by rsilletti (2009-01-24 04:20:09)

Offline

Board footer

Powered by FluxBB