Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2009-01-29 02:40:24

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

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

Perhaps something along these lines:

- $thedate = gmmktime(0, 0, 0, $this->month, $theday, $this->year);

+ $thedate = mktime(0, 0, 0, $this->month, $theday, $this->year) + tz_offset();

it may seem a bit inane, or actually be inane to suggest with something this complex, but if you can hard code the change from GMT to settings sensitive code in the class definition; rendering it accessible to attribute settings would be easy?

Last edited by rsilletti (2009-01-30 01:41:58)

Offline

#62 2009-02-01 02:35:59

garbo
Member
From: Montreal, Canada
Registered: 2007-01-02
Posts: 28
Website

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

I’m using it on my church’s website and seems to be pretty great so far. No real issues with the basic functionality. It did take a while to figure out how to get to certain classes to style them, but overall it’s a keeper.

Offline

#63 2009-02-01 10:35:11

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

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

garbo wrote:

It did take a while to figure out how to get to certain classes to style them, but overall it’s a keeper.

Good to hear it’s working. If I can iron out the timezone kinks thanks to rsilletti’s excellent input it should be even better.

Since you had trouble figuring a few things out, please let me know if you can think of a way it could be made simpler or more intuitive (e.g. better default settings). I’m a programmer so I often don’t see the “simple” idea that’s right in front of my face and is obvious to everyone else. 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

#64 2009-02-01 19:50:47

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

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

I have managed a work around for time zone adjustments, at least for display purposes. The site remains in GMT and I hacked up posted and expires to add time zone adjustment as an attribute for display accuracy in the calendar. Given you can deal with the unintuitive process of adjusting posting and expire times for future events from GMT at the time of posting, it’s working well for me. If anyone is interested in the tag set let me know in this thread.

Bah … still doesn’t work as I would like. Still need to be able to move the calendar reference itself into local time to get proper display.

Last edited by rsilletti (2009-02-03 02:17:32)

Offline

#65 2009-02-04 22:40:11

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

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

Hi, and thanks for your great Plugin. I used to use ZemEvent, but I think it died… So I’m giving a try to your plugin and it’s awesome!

1. I don’t know How to show a Category List. In fact I do know, but once clicked it just shows From Today to Past events. But not Future events… How could I do this? <txp:chh_article_custom time=“any”>

2. I don’t understand how to make a Article (event) recurring… Please, could you explain it, like if I’m a dumb?

Thanks in advance.

Last edited by robhert (2009-02-04 23:17:58)

Offline

#66 2009-02-05 00:17:42

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

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

robhert wrote:

it just shows From Today to Past events. But not Future events… How could I do this?

Use <txp:smd_article_event />. It works very much like <txp:article_custom /> but is specific to the calendar plugin because it understands recurring / spanned / extra events.

how to make a Article (event) recurring

You need a spare custom field. So go and make one and call it, I dunno, Frequency. Then in your article, type in that field how often you want the event to occur. For example if you want your event repeated weekly, use 1 week. Or fortnightly, use 2 weeks. Or 10 days. Or 3 months. Or first Monday (of the month). And so on.

All you then need to do when displaying the calendar is tell the plugin the id of your custom field that contains the recurring info. e.g.:

<txp:smd_calendar section="events" stepfield="custom_4" />

(where custom_4 is the one you called “Frequency” earlier). I would love to be able to let you specify the custom fields by name but, well, I suppose I could but it would incur an extra time penalty as the custom field would need to be looked up in the database first. I might look into this as an option later on but for now, remember you need to use “custom_N” when using the stepfield, extrafield or skipfield attributes.

Does that help?


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

#67 2009-02-05 00:30:32

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

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

Thanks for your quick-answer! Now I know how to do that. But talking about the first question, I started to show the Lastest Events with <txp:smd_article_event /> in a Box above, and I show the 10 blog entries too, in the same FrontPage, but when I use pagination of the 10 blog entries, in the url I see: ?pg=2; and the Box above, of the Lastest Events, shows Empty. That’s what I don’t know how to fix it with smd_article_event. If you want to see it in action, please send me PM.

Last edited by robhert (2009-02-05 00:31:28)

Offline

#68 2009-02-05 01:40:39

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

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

For reference, Robhert was using smd_article_event on the same page as a regular article list. Since smd_article_event understands older/newer (unlike article_cuistom) it was intercepting the ?pg= variable and switching to the 2nd “page” of events when flicking through the standard article list.

In the next version you can now disable paging in the smd_article_event tag if you so desire. Thanks for the bug report, Robhert.

Last edited by Bloke (2009-02-05 01:42:40)


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

#69 2009-02-05 01:44:42

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

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

Hi Stef, I wonder if there’s some tag so I could have the 10 next events (from Today) In zem_event I used this: <txp:zem_event_list date_from=“today” date_to=“10 day” form=“event_now” />

Any ideas?

Offline

#70 2009-02-05 01:53:45

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

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

robhert wrote:

I wonder if there’s some tag so I could have the 10 next events (from Today)

Doesn’t time="future" work?

Or perhaps this:

<txp:smd_article_event time="future" to='<txp:smd_cal_now offset="10 days" />' />

EDIT: (you may need either/both of limit / event_limit too)

EDIT 2: I just read your post again and understood what you really meant. I updated the code in this post

Last edited by Bloke (2009-02-05 01:57: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

#71 2009-02-05 16:34:34

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

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

Hi Stef,

I’m having a strange performance issue with smd_calendar. On a holding page I have a three column layout showing Events, Meetings and Courses. Whenever I include the Courses output I get horrendous lag –

<!-- Runtime: 10.473 -->
<!-- Query time: 0.006517 -->
<!-- Queries: 17 -->
<!-- Memory: 5492Kb, end of textpattern() -->

If I exclude it, the page loads very quickly. I’ve tried various permutations and it seems particular to that category. Apart from a change of category= it’s exactly the same code as the other two…

<div class="grid_5">
<h2>Upcoming courses</h2>
<txp:smd_article_event stepfield="custom_1" wraptag="dl" time="future" category="Calendar-course" eventlimit="25" expired="0">
<txp:if_different>
</br><dt><txp:posted format="%B %Y" /></dt>
</txp:if_different>
<dd><txp:permlink><txp:title/></txp:permlink></dd>
<dd><i><txp:posted /></i></dd>
</txp:smd_article_event>
</div>

…so I’ve no idea why it’s causing problems, is it possible for something to get corrupted?

Offline

#72 2009-02-05 18:00:26

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

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

I doubt it’s related to your issue, but you have a </br > that not only is mistyped ( should be <br />) and it’s also in a wrong place.

So, maybe it’s not a server-side performance issue but a rendering performance issue on the browser side.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB