Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#331 2009-06-16 08:34:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

nardo wrote:

When you go to the individual article page for this event, txp:posted shows its first date … not good if this is in the past!

Correct. The ‘solution’ (hack) for this has been covered

when there’s one or more events on the date (whether single, recurring, etc), it should hyperlink to e.g. http://website.dev/?date=2009-06-25&s=events

The minical will do this but it’s not very good at the moment. I’m in the process of trying to remove minical from the plugin but it’s trickier than I’d hoped. I assure you cellform does work (on large calendars only at the moment) so if you post your code so far I can perhaps give you a hand.

The trick would be to use the conditional and smd_cal_info, something like this (untested) :

<txp:smd_calendar stepfield="custom_5" section="news" debug="0" cellform="miniclone">
   <a href="<txp:site_url /><txp:smd_cal_info type='section' html='1' />&date=<txp:smd_cal_info type='year,month,day' join='-' />"><txp:smd_cal_info type="day" /></a>
</txp:smd_calendar>

And in form minclone:

<txp:smd_if_cal flag="SMD_ANY">
    {events}
<txp:else />
  {day}
</txp:smd_if_cal>

That will be close but will have two problems:

  1. it’ll probably leave you a hole on today’s date so you might have to put some more logic in the container to check for the flag today
  2. the date in the hyperlink won’t have preceding zeros on days/months less than 10

Both are fixable, though the 2nd one might need a plugin tweak as per maniqui’s suggestions a few days ago.

I hope [smd_calendar] will replace it in future (because zem_event is not being maintained).

What functionality does zem_event provide that smd_calendar does not? I’ll build it :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#332 2009-06-16 08:38:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

alexandra wrote:

switching to german language messed it up.

Really? I developed the plugin on a German site and we were swiching back and forth between English and German without issue.

The setting works fine for english. But in english Juni is June.

*confused* so you don’t want Juni to be June now?! You want it to be September or something? ;-)

one can append a text file with month and day names in the foreign language. I searched the manual but could not find anything referring to a text file.

It’s not a text file, it’s a text string. Look at the monthformat and dayformat attributes if you want to customise the month/day names.

Last edited by Bloke (2009-06-16 08:38:51)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#333 2009-06-16 09:31:49

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

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

Thanks Bloke – stupid error on my part, using attribute form not cellform

when there’s one or more events on the date (whether single, recurring, etc), it should hyperlink to e.g. http://website.dev/?date=2009-06-25&s=events

Your solution works well. Couple of issues:

  • when there’s two events on a date, I get the date output twice… is there a way to limit to 1?
  • sort of similar, code below is my miniclone form… when there’s an event on the current day, two dates output… how would you structure the conditionals?
<txp:smd_if_cal flag="today">
{day}
</txp:smd_if_cal>

<txp:smd_if_cal flag="event, standard, recurfirst, recur, multifirst, multilast, multi, multiprev, extra, hols">
{events}
</txp:smd_if_cal>

<txp:smd_if_cal flag="SMD_ANY">
<txp:else />
{day}
</txp:smd_if_cal>

Will write up a zem_event evaluation – based on 2+ years experience (incl. training others)

Offline

#334 2009-06-16 10:31:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

nardo wrote:

when there’s two events on a date, I get the date output twice… is there a way to limit to 1?

Ummm, probably. Can’t think of a way offhand but there must be a method.

how would you structure the conditionals?

Does this work?

<txp:smd_if_cal flag="event, standard, recurfirst, recur, multifirst, multilast, multi, multiprev, extra, hols">
  {events}
</txp:smd_if_cal>

<txp:smd_if_cal flag="SMD_ANY">
   <txp:smd_if_cal flag="today">
    {day}
   </txp:smd_if_cal>
<txp:else />
  {day}
</txp:smd_if_cal>

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#335 2009-06-16 14:24:48

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

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

Does this work?

Nah, still getting double dates when 2 events on a day…

Offline

#336 2009-06-16 14:40:26

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

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

Bloke schrieb:

Really? I developed the plugin on a German site and we were swiching back and forth between English and German without issue.

Maybe your german DB runs UTF-8 while mine is using character set latin1? Could this cause the problem?

BTW for skipfield etc. do you insert only english month abbr like jun for june? Or when switched to another language do you insert the abbr of the languages month name? F. e. in english it is May – in german Mai. What is correct: 20-may-2009 or 20-mai-2009 when using german?

Last edited by alexandra (2009-06-16 18:08:44)

Offline

#337 2009-06-19 15:03:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

alexandra wrote:

Maybe your german DB runs UTF-8 while mine is using character set latin1? Could this cause the problem?

Maybe. It was UTF-8. Honestly don’t know the answer to this one.

for skipfield etc. do you insert only english month abbr like jun for june?

Sadly yes. The PHP function that does the magic behind the scenes parses only English dates and times


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#338 2009-06-19 15:09:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

‘ello ‘ello ‘ello. What’s all this then? Does this mean that smd_calendar could potentially be freed of the drudgery of timezone hacks and server offset/DST weirdness from the next version? Time will tell, and I’ll post findings here as I experiment with this unexpected but hopefully fabulous news from Mr Wetzlmayr.

If anybody (saccade?) running bleeding edge SVN can send me any bits and pieces on how the current plugin version behaves under these changes, I can see which bits I need to re-engineer so I can leave TXP to do the timezone stuff and I can present a clean plugin interface without fear of dates shifting every 6 months or days of the week being one day “out” between midnight and 3am every day, etc, etc.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#339 2009-06-19 15:44:08

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

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

Hi Bloke,

I’m hoping to upgrade my development site to the latest SVN soon. Will definitely report findings.

Only problem is that SVN and MLP don’t play nice at the moment :P

Offline

#340 2009-06-25 10:14:06

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

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

If you use the hack to display individual days events when clicking links in the mini calendar it doesn’t work with expired events.

So even though i’ve set the Textpattern to publish expired articles it still doesn’t display. I think it’s because the “to” and “from” are only looking for articles with posted and expired times within that and not articles with repeat dates exceeding those.

<txp:smd_if field="urlvar:date" operator="defined">
<h1><txp:smd_cal_now now="{smd_if_date}" format="%d %B %Y" /></h1>

<table id="event_listings">
	<tr>
		<th>&nbsp;</th>
		<th>Event Name</th>
		<th>Event Location</th>
		<th>Event Type</th>
	</tr>        
<txp:smd_article_event section="courses"  expired="1" time="any" stepfield="custom_1" omitfield="custom_2" extrafield="custom_3" sort="Posted asc" from='<txp:smd_cal_now now="{smd_if_date}" format="%d %B %Y" />' to='<txp:smd_cal_now now="{smd_if_date}" offset="1 day" format="%d %B %Y" />'>

<txp:if_different>
	<tr><th class="event_month" colspan="5"><txp:posted format="%H:%M" /> &ndash; <txp:expires format="%H:%M" /></th></tr>
</txp:if_different>

<tr <txp:zem_nth step=2 of=2>class="odd"</txp:zem_nth>>
	<td><txp:permlink><txp:article_image thumbnail="1" class="event_thumb" /></txp:permlink></td>
	<td><p><strong><a href="<txp:permlink />"><txp:title /></a></strong></p>
		<txp:excerpt />
	</td>
	<td>Location</td>
	<td><txp:category1 title="1" link="1" this_section="1" /></td>
</tr>
</txp:smd_article_event>
</table>

Last edited by FireFusion (2009-06-25 10:14:33)

Offline

#341 2009-06-25 10:32:49

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

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

For another problem i’m having I wonder if it’s because the formating of “?month” is naturally right for TXP to understand.

I entered the following in my stepfield

10 ?month,25 ?month

To repeat an event on the 10th and 25th of every month. I wonder if it’s because ?month is outputting a funny formatted date like “24 days ago”

Last edited by FireFusion (2009-06-25 10:38:52)

Offline

#342 2009-06-30 07:49:51

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

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

Getting the following error in testing mode…

Tag error:  <txp:smd_if_cal flag="multi, multiprev"> ->  Warning: in_array() [function.in-array]: Wrong datatype for second argument  on line 1218

Offline

#343 2009-07-07 21:44:11

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

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

Hi Stef,

any news on an update (Now that 4.2.0 is in feature lock)?

One of my events is one day out with txp 4.2.0 no matter what i do. I was wondering if it’s a result of the new time system or a bug.

If you click on the event Mahayana Precepts on the 13th you’ll see that the info box displays the correct date of the 14th but yet it is shown on the 13th :P

Last edited by FireFusion (2009-07-08 08:14:48)

Offline

#344 2009-07-08 08:28:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,506
Website GitHub

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

FireFusion wrote:

any news on an update (Now that 4.2.0 is in feature lock)?

Nope. Had a crappy few weeks. Coding is not on my radar at the moment, sorry.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#345 2009-07-22 00:06:05

wolle
Member
Registered: 2006-05-04
Posts: 19
Website

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

I have a problem while I do my first steps with smd_calendar (V 0.42b / 0.32):

I put a

<txp:smd_cal_info type=“s” />

in a article-form, which I call from

<txp:smd_article_event section=“mwtermine” form=“mw_terminartikel” time=“future” allspanned=“1” limit=“5” sort=“Posted asc” stepfield=“custom_8” />

This works! – I get the section as the output.

If I change it to

<txp:smd_cal_info type=“day” />

I get no output – nothing.

The same with month, year, callid … – no output.
Only author and section are working.

Can anybody help me?

Thanks, Wolfgang

Offline

Board footer

Powered by FluxBB