Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#349 2009-07-28 14:46:53

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 99

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

Bloke, that works beautifully. Nothing broken. I will buy you a few pints for that and smd_if – are they around 4 quid still? I am trying to retrieve my paypal details to do this asap.

Another thought I’m afraid…
I have a custom field named “town” which I would like to filter events by. I have had a go passing url vars into txp:variable and then using if_custom_field in the container, and even a spot of CSS display:none, but am not having a lot of luck. Is there a simple way to mimic the category attribute in txp:smd_calendar for a custom field? If you have a gander at this you’ll see why I could use it: http://www.butterpaper.com/cms/events

Am lovin this plugin – it’s keeping me up late on a ‘school’ night.

Offline

#350 2009-07-28 15:10:27

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

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

peterj wrote:

Bloke, that works beautifully. Nothing broken.

Sweet!

I will buy you a few pints for that and smd_if – are they around 4 quid still?

Depends where I drink, but yeah, about that ;-p Thank you!

I have a custom field named “town” which I would like to filter events by.

Sounds like you’re on the right track as it can’t be done natively with smd_calendar.

Off the top of my head, I’d guess something like:

<!-- auto-assign the 'town' URL var to a TXP var -->
<txp:adi_gps name="town" />

<txp:smd_calendar blah="blah" flah="flah">
   <txp:if_custom_field name="town" val='<txp:variable name="town" />'>
      <txp:permlink><txp:title /></txp:permlink>
   </txp:if_custom_field>
</txp:smd_calendar>

You can do it with smd_if inside the loop and not use txp:variable, but adi’s awesome plugin is simpler.

Last edited by Bloke (2009-07-28 15:14: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

#351 2009-07-28 19:34:30

malaclypse
New Member
Registered: 2009-07-28
Posts: 1

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

Hi Bloke! Thanks for the great plugin. My roommate and me are going to use it for a little event calendar for our friends :)

I have a little problem getting the datefields thingy working:
i created two fields (custom3 and custom4) for start and end dates – but when i set the start date to the future (2009-08-07) , the calendar fills up every day in the current month (July).

I feel like i’m missing something stupid :)

i’m embedding the calender with <txp:smd_calendar section="events" size="small" datefields="custom_3,custom_4" class="event" rowclass="event_row" cellclass="event_cell" navclass="event_nav" debug="3"/>

i have two events:

++ EVENT START // END // REAL END ++

TestEvent

07-Aug-2009 00:00:00 // 31-Jul-2009 23:59:59 // 08-Aug-2009 00:00:00

array (
  'ID' => '5',
  'Posted' => '2009-07-20 23:54:02',
  'Expires' => '0000-00-00 00:00:00',
...
  'Section' => 'events',
...
  'custom_1' => '',
  'custom_2' => '',
  'custom_3' => '2009-08-07',
  'custom_4' => '2009-08-08',
...
  'feed_time' => '2009-07-20',
  'uPosted' => '1248126842',
  'uLastMod' => '1248764123',
  'uExpires' => '0',
)

and

++ EVENT START // END // REAL END ++

Ein Event in der Zukunft

29-Jul-2009 00:00:00 // 30-Jul-2009 00:00:00 // 30-Jul-2009 00:00:00
...

which seems fine to me – but the calendar has every day filled up with one, or the other event, as shown here (2009-07-01 and 2009-07-02) :

++ ALL EVENTS ++

array (
  1 => 
  array (
    0 => 
    array (
      'ev' => '',
      'flag' => 
      array (
        0 => 'multiprev',
      ),
      'classes' => 'smd_cal_multiprev',
      'posted' => '2009-08-07',
    ),
  ),
  2 => 
  array (
    0 => 
    array (
      'ev' => '',
      'flag' => 
      array (
        0 => 'multi',
      ),
      'classes' => 'smd_cal_multi',
      'posted' => '2009-08-07',
    ),
  ),

I hope you can help me with that, and am truly sorry for spamming this forum with so much text!

thanks again for the plugin :)

malaclypse

Offline

#352 2009-07-30 15:24:44

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 99

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

Ahh. Thanks bloke. That sent me off on the right track. I was having loads of problems with case though – many of the custom fields have been filled in with either “Sydney” or “sydney” – so in the end I made the url variable ‘town’ and the custom field ‘town’ both lowercase before starting smd_calendar. Using my dirty and dodgy php.

I’m sure it could be a lot tidier than I did it, but it works, so if anyone needs to filter their events using sloppily filled in custom fields, it’s here as a txt file, I hope:
http://bit.ly/Nm9ce

It relies on a urlvar along the lines of http://www.butterpaper.com/cms/events?town=Sydney .

Last edited by peterj (2009-07-30 15:25:50)

Offline

#353 2009-08-09 09:57:29

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

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

malaclypse wrote:

when i set the start date to the future (2009-08-07) , the calendar fills up every day in the current month (July).

Hi, thanks for the detailed diagnostics, and sorry for the delay getting back to you.

It may be a bug in the plugin. Before I start hammering away at it, would you just try something for me please first: explicitly use the (full or abbreviated) month name in your custom fields. I have a suspicion that somewhere along the line the plugin is interpreting 2009-08-07 as 8th July 2009 instead of 7th August 2009. It seems like a bug anyway because, even if the dates were being interpreted wrongly, they show up correctly at debug points.

The other thing that may be happening if it’s interpreting one or both dates wrongly is that the plugin thinks like this:

  • Hmmm, end date is earlier than the start date
  • Sounds wrong; I don’t like that
  • I’ll use the posted/expires dates from the article instead

So it may be dropping back to the actual article dates instead, causing the unexpected behaviour. Does it seem like it’s doing that?

Last edited by Bloke (2009-08-09 09:58:12)


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

#354 2009-08-11 01:12:30

coleh
Member
From: Edinburgh, UK
Registered: 2007-08-16
Posts: 28
Website

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

Exhaustive plug in as usual Bloke. Top work!

Been struggling to get my head round an event diary using this and wondered if anyone had any thoughts on how might best be achieved.

Desire

  • Calendar, browseable by month. Click on a day will go to a summary of that day ->
  • Day listing, showing all events for that day, clicking on an event will go to that event ->
  • Event details page

The above requires the ability to use recurring events

Approach

Through lots of complicated, nested queries am currently trying to:

  1. Showing a calendar that parses the date in question (through some smd_calendar jiggery pokery) onto the destination URL thus: /news-diary/?date=2009-8-4
  2. On the above page, take the URL in the date to parse all events happening on that day using smd_article_event, again using some jiggery pokery to customise the URLs
  3. The event page, a standards textpattern article

For the life of me I cannot get the second step to work. I just can’t seem to figure out how to parse a variable form the URL into the smd_article_event tag (using the from and to attributes). I can manually add them but not have them dynamically parsed depedning on the date being viewed.

Any thoughts? Not sure if just made things ten times more complicated than I meant to or have been particularly clear/muddy in describing the problem.

Cheers in advance,

Cole


Jack of all trades, Doctor of one

Offline

#355 2009-09-01 10:04:58

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

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

Hi Stef,

any word on an update (or beta) for this plugin that will work with 4.2.0 and fix some of the past issues?

Thanks.

Offline

#356 2009-09-01 10:16:01

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

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

FireFusion wrote:

any word on an update (or beta) for this plugin that will work with 4.2.0 and fix some of the past issues?

I have a new version (0.5) written that has (I think) removed the minical in favour of emulating the minical via the big cal system. Thus you no longer have two distinct calendars available that do different things, you have two convenience calendars that make stock implementations that you can modify to the nth degree.

I’ve also made every function use the ‘safe_’ calls and the timezone offset calls that should now handle dates and times more consistently thanks to the new date handling of 4.2.0. Whether this fixes timezone and DST shifts and ‘my event is an hour earlier/later than it should be’ things remains to be seen.

I do have some other stuff to build in, but that can come later in the v0.5 branch. I want to get this version out first and build on it.

The downside is that I still have a few bugs to iron out and the docs need redoing before it’s even considered Beta so I’m not at the stage where it’s for public consumption. If I get a chance this week I’ll try and get a version out. No promises though as I’m pretty busy, I’m afraid.


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

#357 2009-09-01 10:34:49

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

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

coleh wrote:

Exhaustive plug in as usual Bloke. Top work!

Thanks. Just standing on the shoulders of giants as usual (Marshall of mdp_calendar fame in this case).

I just can’t seem to figure out how to parse a variable form the URL into the smd_article_event tag

Sorry I missed this earlier. You probably want to try the adi_gps plugin (or perhaps smd_if, although that’s rather just for the URL reading feature and filtering capability than the conditional aspect of things — adi_gps is your best bet).

That will read any vars in the URL line and make them into txp:variables. You can then just simply embed those in your smd_article_event tag in the appropriate places using tags-in-tags, viz from='<txp:variable name="from_val" />'. Hope that helps.


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

#358 2009-09-10 04:49:55

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

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

Mr Bloke – any update on 0.5 release?

Offline

#359 2009-09-10 12:57:21

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

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

nardo wrote:

any update on 0.5 release?

Yes, despite my best intentions it’s suffering Feature Creep — d’oh :-(

In the process of doing some much-needed maintenance work to bring the core feature “fix 4.2.0 timezones” I managed to stumble upon something which never worked properly in the first place that requires a fix. This in turn has uncovered some more weirdness which requires a small rethink.

During that process (and after a conversation with maniqui) I stumbled upon a way to open the plugin up even further and it’s all related to this fix. So as well as what’s been noted before, v0.5 has the following in the pipeline:

  • Allow URL vars to be passed via POST so permanent links behave better
  • Possibility of tracking current month via cookie (as an option)
  • Add table caption and summary for accessibility / prettification
  • Use a form to customise the day row
  • Customise the nav row to make your own navigation system
  • Possibility of adding custom header and/or footer rows

Believe it or not, all this functionality (bar cpation/summary which was a quick win) is tied to one broken feature in the current version that really needs attention.

For the record, the current version of the plugin does work under 4.2.0 subject to the timezone limitations that have hamstrung it in the past.


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

#360 2009-09-10 13:00:59

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

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

Great!! – might just be bias for my applications of textpattern – but almost every site needs some form of event management

And zem_event is now too far back to deploy with confidence

Offline

Board footer

Powered by FluxBB