Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#85 2005-11-12 14:42:11
- Konijn
- Member
- Registered: 2005-06-18
- Posts: 33
Re: [plugin] [ORPHAN] mdp_calendar
Hey,
Nice plugin, works good.
But I have a little problem, when a date is active (is a link) and I press on It I dont see the comment I placed on that date?
How does that come?
Code:
<code>
<txp:mdp_calendar_small category=“kalender” section=“kalender” />
</code>
www.scoutssinaai.be/?s=kalender
Offline
#86 2005-11-13 23:15:28
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] [ORPHAN] mdp_calendar
Greenrift – I’m afraid to say that I have noticed that events posted to the last day of the year are failing to show up! This is surely a time offset related bug… Looks like we won;t be able to advertise the new years eve party ;)
SH
Offline
#87 2005-11-24 05:51:08
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: [plugin] [ORPHAN] mdp_calendar
Does anyone knows how can I display the large calendar events using /year/month/day/title when my url mode config is /section/title?
Offline
Re: [plugin] [ORPHAN] mdp_calendar
Would nck_olm help?
Offline
#89 2005-11-24 16:36:14
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: [plugin] [ORPHAN] mdp_calendar
Hi David!
Thanks for the tip. I was using sgb_url_handler but this has its advantages.
Sadly it doesn’t fix the “problem”….
Offline
#90 2005-12-09 16:55:14
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: [plugin] [ORPHAN] mdp_calendar
Bump
Offline
#91 2006-01-09 21:07:17
- jessejericho
- Member
- Registered: 2005-10-29
- Posts: 25
Re: [plugin] [ORPHAN] mdp_calendar
Could someone give me a hand with styling the calendar? I would like to be able to control the placement of the day numbers, as well as the size and line height of the event text. I’m having trouble figuring this out from the help file. Even if you could just post the CSS you are using to style yours, that would be appreciated. Thanks!
Offline
Re: [plugin] [ORPHAN] mdp_calendar
Working on a small theater website (music, drama, etc..), I wanted a small calendar to supplement the events navigation – similar to the one here
These are some of the problems I encountered:- Single letter month abbreviations
- Adding “cellpadding=0 cellspacing=0” to the table tag for the element to render properly in all browsers
- Multiple dates for events (articles)
- Small calendar natch (ie.. your calendar tag looks something like this: <txp:mdp_calendar_small displayfuture=“1” dayformat=“ABBR” />)
- Clean URLs presented as “section/article” or “article” ONLY
- All the solutions involved editing ver 0.5 of the plugin (Admin > Plugins > mdp_calendar > Edit)
A final warning – I know close to nothing about PHP – Alrighty, here we go:
Single (or however many) letter month names
1. Find the function “dspDayNames”
2. Find this line “$c[] = ‘<th>’.$names[$i].”</th>”;”
3. Use PHP’s substring function to abbreviate the names further. Replace the line with the following for 1 letter abbreviations:
$c[] = ‘<th>’.substr($names[$i], 0, 1).”</th>”;
Adding “cellpadding=0 cellspacing=0” to the table tag
Without cellpadding/cellspacing the table almost invariably renders with gaps between the cells regardless of how the CSS is styled – not very pretty if you are going for a classic outlined calendar.
1. Find function “display” (the first instance in the plugin, this function replaces the instance further down in the script)
2. In order to add these atributes we can’t use Textpattern’s built in tag builder (doTag). Replace the function as follows:
function display($static=false, $future=false) { $id = ($this->tableID) ? ‘ id=”’.$this->tableID.’”’ : ‘’; $c[] = ‘<table’.$id.’ cellpadding=“0” cellspacing=“0”>’; $c[] = $this->dspHeader($static, $future); $c[] = $this->dspDayNames(); $c[] = $this->dspDayCells(); $c[] = ‘</table>’; return join(‘’,$c);
}
Multiple dates for articles
This is a tricky one – my solution may not work for everyone (URLs cannot contain different dates or unique ID’s / only 1 event per day will be displayed). However, this was important where a single event might play 2, 10 or however many showtimes (and not sequentially either!) – and the calendar would be misleading if it only showed a single instance.
1. Firstly, it’s important how the content is written. The article representing the event should have the “Posted” date of the last showtime of the event (preferably at 23:59 at night as well so it remains posted throughout the final day). This is handy if you have the current event on your homepage for example (as mentioned to me by “nardo” on IRC (textpattern@ freenode – the unofficial/official Textpattern forum) so that it drops off after all the event showtimes have passed.
2. Write additional articles for the same event setting the posted date for each one of the showtimes. The only fields that should be completed are the “Title”, “Posted” and “URL-only title” (under Advanced Options – ALL the articles must share the same URL – Textpattern will warn you with a message like “The same URL-only title is used by x different articles”) – that’s OK). Additionally you can set the Sections & Categories as required.
3. Be sure to set the “Status” for these additional article/showtimes to “Hidden” – this way they will show up on the Calendar but nowhere else in your TXP site.
4. In the plugin, find the function “mdp_calendar_getEvents”
5. We need to find the “Hidden” events, so look for the line starting “$sql = “. Replace “Status = ‘4’” with “(Status = ‘4’ OR Status = ‘2’). If you test your calendar now the events should all appear properly – but the links don’t work.
6. Find “class MDP_Small_Calendar”. We won’t modify the code here, so if you ever won’t to return to the default calendar functionality you only need to remove the additions we’re abou to make. In the funtion “dspDayCell” on a new line BELOW where the $title variable is defined, add this code:
$days_events = $this->events[$day];
extract($days_events[0]);
$href = ‘ href=”’.$link.’”’;
$title = ‘ title=”’.$title.’”’;
NOTE: I just take the first article from the array for the day ($days_events[0]) – if there are multiple events for the day, only the first event will be linked to.
The result of all this – assuming I haven’t forgotten anything – is that all the showtimes to your events appear on the calendar and all link to the same article. If anyone has any problems with these instructions or better ideas please feel free to message me. Or if anyone would like the modified plug-in directly. As soon as I have the site online I will post a link so the result is easily appreciated!! -Hasta rl
Travel Atlas * Org | Start Somewhere
Offline
Re: [plugin] [ORPHAN] mdp_calendar
My small calendar is not working properly. Links off the small calendar sometimes lead to empty pages. I kind of know why, and it’s a timezone issue.
My timezone is GMT-0800. If I set an event for Jan 15 at 16:00 hours. It will load the article in the previous day’s url, ie http://c2design.info/diversity/?month=2006-01-14, however if I set the event time for Jan 15 at 15:59 hours it works as expected. As 16:00 is eight hours less than 24:00. It has to be an offset issue.
Anyone know of a fix for this?
Offline