Textpattern CMS support forum

You are not logged in. Register | Login | Help

#631 2011-03-11 20:45:50

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Bloke:

Hope all is well. I think this is an easy one and in fact I think I saw this on the Forum but for some reason it escapes me now. I have the calendar on the site, but when people move between pages the calendar is reverting back to the current month. Is there a way to make the calendar to stay in its current setting whatever that happens to be for the individual users.

Thanks in advance for you assitance.

progre55

Offline

#632 2011-03-15 08:47:18

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 435

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

You could try using the maintain attribute. I also found using variables and passing them to the URL helps.

Offline

#633 2011-03-16 18:23:07

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Algaris:

Thanks for the push in the right direction, but still having issues.

In Bloke’s help notes he writes: Use maintain=“section, article, calid” if you have an individual article page with a calendar in a sidebar, so the currently viewed article will remain in view when changing date. If you wish to maintain state yourself or do something exotic, empty this attribute first to avoid weirdness

Here is my scenerio. I have the calendar in a sidebar. What I want to have happen is if people are navigating the calendar and select any month (besides the current) and select an event within the calendar that when they are kicked to that article page the calendar maintains itself on the month they were in when they selected that event.

What is occurring right now (and I tried several combinations) is that it is resetting to the current month.

any guidance would be appreciated.

progre55

Offline

#634 2011-03-16 23:04:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,586
Website

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

progre55 wrote:

it is resetting to the current month.

One way to do it is to make sure your cell anchors that lead to your individual articles (events) contain m= and y= URL variables. The maintain attribute is for doing things in reverse: making sure that when you change month using the calendar’s next/prev month navigation that it maintains the other stuff around the page (namely the article in most cases).

Since the calendar will read its current month and year from the URL in preference to anything else, simply adding ?m=04&y=2010 to every event link will make sure that the calendar in the sidebar returns to April 2010 when the event is clicked. So the key is to use the cellform and probably some of the {replacements} to create anchors that all contain the month/year of the currently viewed calendar. That should get you going somewhere near where you want to be.

There are other approaches. I know mrdale has used cookies to keep track of the month/year in view and just told the plugin to read those. That also means that even if you navigate away to a completely different section and come back that you’ll return to the same calendar you were viewing before. That may not be what you want in this case, though.

Last edited by Bloke (2011-03-16 23:05: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

#635 2011-03-26 02:35:31

kevinpotts
Member
From: Kansas City
Registered: 2004-12-07
Posts: 364
Website

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

Stef —

I hope you’re still reading this thread because I’ve run into an odd issue that I’ve never seen before, even after installing and customizing the snot out of this plugin many times across different hosts. Basically: any event with an expiration date/time fails to appear in the calendar. This effectively prevents any “multi” events. Everything else — recurring stuff, etc — works fine. Here’s what I’ve done to make sure I’m not insane:

  • Stripped all attributes out and let the calendar load everything in TXP. Still not there.
  • Installed an older version of the plugin to see if something wonky was in .42c. No help.
  • Checked the MySQL database just to make sure the expiration values were there, and they are.
  • Disabled every other plugin. Nada.

Running both 4.3.0 and out of ideas.

Any clues?

Edit: forgot to add one key clue: tis behavior only works with past articles. Anything set into the future works just dandy.

Last edited by kevinpotts (2011-03-26 02:38:46)

Offline

#636 2011-03-26 17:05:47

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

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

Hi Stef

Would you mind also sending me a copy of the beta version you’ve mentioned above please? I’ve been encountering time related issues with v0.42c that sound similar. Many thanks John

Offline

#637 2011-03-26 17:18:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,586
Website

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

All

I have what I consider the final version of smd_calendar 0.50 done. Just need to review the docs so they match up with the code. Can’t do it today but maybe tomorrow or Monday I’ll get this out the door.


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

#638 2011-03-26 19:19:53

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

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

Thank you Stef!

Separately, here’s a thing that has cropped up. Perhaps someone here knows a way to achieve it (suggestions welcome), if not it might be considered as a possible feature in a future version?

With smd_article_event I want to output a “flag” (for example the message “Sold Out”) on select days in a multi-spanned event. Easy enough to do with a custom field or two for ALL days in the spanned time, but I’m not sure if it can be done for a set of specific days within the spanned time.

Offline

#639 2011-03-27 21:05:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,586
Website

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

Alright I’ve messed everyone around enough. Here’s v0.50. Sadly it’s not the massive rewrite I’d hoped, because I was patching this plugin in 5 different places in the wild (my own server, mrdale, Algaris, Jan DeWilde and Keith Smith, plus about 20 copies I’ve sent out in various states of disrepair to other willing beta-hamsters) and had to resync it all, consolidating all the various features and fixes into one that worked across all the servers I had access to around the world.

Many, many thanks to all those who pledged server space and logins for me to tinker on your sites and get this sucker in a slightly better shape. You’re all saintly.

Features:

  • <txp:smd_calendar/> tag: Added subcats, headerform, caption, summary
  • Fixed five zillion timezone-related errors and bugs that:
    • displayed the wrong day / month / year
    • made day names jump forwards/backwards depending on time of day
    • incorrectly calculated date offsets
    • incorrectly rendered dates without time offsets
    • didn’t handle expiry properly
  • Permitted evid (among other items) to be displayed and handled correctly
  • Improved Windows support: all strftime() functions (e.g. as used in <txp:smd_cal_now />) that are available on *NIX are now available on Windoze, including %V, %e, %P, %r and %G. Yes, that’s better than even PHP can do :-)
  • Internal minical improvements
  • Permitted this in your nominated stepfield
  • Added the following replacements inside cellform:
    • {dayzeros} : day padded with leading zero
    • {weekdayabbr} : abbreviated weekday (local lingo)
    • {weekdayfull} : full weekday (local lingo)
    • {monthzeros} : month padded with leading zero
    • {monthnameabbr} : abbreviated month name (local lingo)
    • {monthnamefull} : full month name (local lingo)
  • Headerform replacements (to be improved in future) :
    • {firstday} : first day of week (0-6)
    • {daynames} : list of day names (comma-separated)
    • {isoweekhead} : your defined isoweek heading (see isoweek attribute)
    • {week} : the ISO week number
    • {month} : numeric month number (no leading zeros)
    • {year} : 4-digit year
    • {isoyear} : 4-digit ISO year
  • <txp:smd_article_event>:
    • preserves original article and has tentative support for is_first/last_article under some special circumstances. To be improved in future
    • added time="today" support

I hope the considerable wait is worth it and your calendars can flourish without random bugs.

From here I shall try and address any outstanding issues/questions and then press on with timefields and other goodies, as well as look at some of the half-imlemented things mentioend with the word ‘future’ in the above list.

As ever I’m here for kicking or praise if this does (not) do what you want.


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

#640 2011-03-27 21:40:35

PascalL
Member
From: Switzerland
Registered: 2009-03-09
Posts: 132
Website

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

Thank you very much Bloke !
I use your plugin intensively, here. I’ve never found such a powerful calendar plugin on other CMS’s !

I’ll be glad to try the new shiny version on my local install, will report in case I see some issues.

Cheers!

Pascal

Offline

Board footer

Powered by FluxBB