Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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: 604
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
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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#635 2011-03-26 02:35:31
- kevinpotts
- Member

- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
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)
Kevin
(graphicpush)
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
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.
Hire 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
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
thisin your nominatedstepfield - 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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#640 2011-03-27 21:40:35
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
#641 2011-03-28 01:36:54
- lazlo
- Member
- Registered: 2004-02-24
- Posts: 110
Re: smd_calendar: complete schedule / event / calendar / diary
Hi Stef
Where do you custom fields show up in the Write Tab? Or in the db table? Do I have to create them myself?
I am testing 4.30 textpattern just upgraded to .50 smd_calendar and also using glz_custom_fields 1.2.4 and have many existing custom fields but not smd_calendars?
[Edit] I just installed a base install of textpattern 4.4 and installed .50 smd_calendar and stil can’t see the custom fields you reference in the docs
“Custom field to specify event frequency (1 week / 10 days / 3 months / etc)”
“Custom fields for in/exclusions (a list of dates on which that event is (re)scheduled/cancelled/omitted)”
what am I missing?
Les
Last edited by lazlo (2011-03-28 04:31:09)
Offline
#642 2011-03-28 05:34:49
Re: smd_calendar: complete schedule / event / calendar / diary
kick. it still doesn’t provide me with a pony. ;)
Big thanks bloker.
Offline
#643 2011-03-28 09:25:38
Re: smd_calendar: complete schedule / event / calendar / diary
lazlo wrote:
can’t see the custom fields you reference in the docs
You create them as normal in the Advanced Prefs screen and then tell the plugin which numbers they are via stepfield="custom_2", for example. If you are using glz_cf then you’d define them in Extensions->Custom Fields instead.
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
#644 2011-03-29 08:15:03
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 604
Re: smd_calendar: complete schedule / event / calendar / diary
I just wanted to say thank you so much for all your help with this plugin. I’m glad you managed to get something out of tinkering around on my Windows server.
The senior management have approved the calendar I was working on and it should go live at the end of April in time for the summer school term. If you’ve logged in recently you’ll notice that it looks quite a bit different from what it did before.
When I have a spare moment I’ll give the latest version a spin in my development area. I have to admit to being a little nervous about upgrading given all the custom edits and variables we used to get the calendar working.
Offline
#645 2011-03-29 08:43:36
Re: smd_calendar: complete schedule / event / calendar / diary
Algaris wrote:
I just wanted to say thank you so much for all your help with this plugin. I’m glad you managed to get something out of tinkering around on my Windows server.
No worries. The plugin’s much better as a result. I’m pleased with the improved Windows server support and the fact it actually offers more conversion modifiers in the plugin than PHP itself has under Windoze!
The senior management have approved the calendar I was working on and it should go live at the end of April in time for the summer school term.
Looking good. Though it doesn’t seem to remember the calendar month now as I move around the different parts of the school. Is that intentional?
I have to admit to being a little nervous about upgrading given all the custom edits and variables we used to get the calendar working.
The version on your server is identical to the released v0.50 as yours was the last site I was using to tweak the code. The only differences in the official version are a few documentation edits. In fact the docs might be completely overhauled at some point soon so, assuming no code fallout from this version, I’ll probably release 0.51 with just the new docs attached. You might as well wait.
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