Textpattern Forum

You are not logged in. Register | Login | Help

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,713
Website

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.

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: 5,713
Website

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.

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: 5,713
Website

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.

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: 700

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

#49 2009-01-24 10:09:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,713
Website

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

rsilletti wrote:

The link mode from the txp:popup section navigation uses messy urls when the rest of the site uses clean.

I didn’t know that. Humbug, that will cause problems because the plugin only looks at permlink_mode and assumes all your URLs are fashioned thusly. I wonder why txp:popup doesn’t take the permlink mode into account? Must be a reason. Anyone?

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?

Yes. Thats what’s supposed to happen. In fact, even if you’re not in the ‘events’ section, if you show a calendar and you have explicitly specified a section attribute in it, the calendar navs should force you to the named section. That’s what it’s (supposed to be) for!

Hmmmmm. I’ll do some testing with txp:popup and check the plugin logic later, because I did mess around with the URL rewriting bit — and the way sections are handled — in v0.4. It could be because I take $pretext['s'] into account when I build the internal section list and, in this case, it’s erroneously reading what’s coming back from txp:popup instead of from the URL’s section, or the one you specified in the attributes.

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

It won’t: it was stupid. But perhaps that was a good thing after all… d’oh :-(

Thanks for the report. BTW, I’m assuming you’re on TXP 4.0.8?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#50 2009-01-24 21:48:57

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

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

Hi Stef – I just noticed that after an upgrade to 4.0 the Plugin Help content now seems to be abruptly cut off somewhere just before Example 6 and the Changelog. Have you run out of space? No big deal as I can refer to the docs on your site, just thought I’d let you know.

Last edited by woof (2009-01-24 21:49:31)

Offline

Board footer

Powered by FluxBB