Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#109 2006-04-01 15:16:45

ragger
Member
From: Netherlands
Registered: 2005-04-10
Posts: 82
Website

Re: [plugin] [ORPHAN] mdp_calendar

Quincas wrote:

Hey! sorry, I was hasty… Logged on today and the calendar is working fine after updating to 1.0
Lost the portuguese version, but I’m sure that’s an easy edit, I’ll figure it out…
Thanks for this great plug in! For a band website’s gigs page comes in very handy!
Peace
Q

And your hover indicates the correct date. How did you do that? :)

Offline

#110 2006-04-25 02:36:20

Rachel Rachel
Member
Registered: 2004-09-24
Posts: 28

Re: [plugin] [ORPHAN] mdp_calendar

is it possible for the link text in mdp_calendar_large mode to be something other than the entry title? ideally, i would like something like the calendar on subtraction.com’s monthly archive pages.

edited to add:
okay, so i just went to plugins > edit plugins and changed line 145 from this:

$c[] = doTag('<a title="'.$title.'" href="'.$link.'">'.$title.'</a>','div','permalink');

to this:

$c[] = doTag('<a title="'.$title.'" href="'.$link.'">poop</a>','div','permalink');

where ‘poop’ is whatever text the link should be, obviously.

so what i want to do now is have different link classes for links to articles in different sections (essentially, color-coding the links by section). anyone have an idea how to do that? (the extent of my php is that i know it’s… some kind of computer language. that hack up there was actually very scary for me to do.)

edited again to add:
yeah, so i think i may have gotten it to work. i changed line 145 again so that it reads:
$c[] = doTag('<a title="'.$title.'" href="'.$link.'" class="'.$section.'">poop</a>','div','permalink');

and i changed line 111 from this:

$out[(int)safe_strftime('%d',$i['posted'])][] = array('link' => permlinkurl($i), 'title'=>$i['Title']);

to this:

$out[(int)safe_strftime('%d',$i['posted'])][] = array('link' => permlinkurl($i), 'title'=>$i['Title'], 'section'=>$i['Section']);

so basically, the HTML output is:
<a title="my entry title" href="link-to-entry" class="section">poop</a>
yay!

i have no idea what i just did, but it seems to work. i feel retarded for having this little conversation with myself here… sorry to waste forum space.

Last edited by Rachel Rachel (2006-04-25 03:19:58)

Offline

#111 2006-05-10 06:13:55

anand
Member
From: netherlands
Registered: 2005-07-13
Posts: 16
Website

Re: [plugin] [ORPHAN] mdp_calendar

can this plug also display the full year, for instance i want to display a full year calendar on a page, each month is set to small ofcourse.
can this be done with this plug-in if so how ?
you can see the site where i am useing it ——> http://samaanta.project-8.nl/jaarkalender

Offline

#112 2006-05-10 12:10:45

anand
Member
From: netherlands
Registered: 2005-07-13
Posts: 16
Website

Re: [plugin] [ORPHAN] mdp_calendar

I solved the problem to display all 12 months, now i need to get the navigation out of each calendar , how do i go about doing that

check the link i posted , i still need to style the whole page but that ain’t no biggie , i guess :)

Offline

#113 2006-06-15 03:33:24

asarbogast
Member
From: Arcata, CA
Registered: 2004-05-21
Posts: 33
Website

Re: [plugin] [ORPHAN] mdp_calendar

I am having trouble getting the small format calendar to work for future events as well, but when I click on a date I get a list of all the articles in that particular section, rather than only the ones for that day. It is showing the future articles fine, but just not limiting them based on the date selected. Any ideas?

Offline

#114 2006-07-04 07:07:51

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] mdp_calendar

I would like to have a shared/common calendar of events for three institutions(e.g. churches).
But it should be obvious to which institution an entry belongs.

I thought about different colours for the entry or providing a small symbol provided by css/background.

So my question:
Is it possible to include a class into the entry-link depending on the category or section of that entry?
Can it be supplied by a form used for entries. Or in any other way?

Or the other way round:
Could it be added to define the form/class (and so on) of each entry by providing a form for it (which does the class-adding depending on category/section or whatsoever)?

EDIT:
After trying some solutions I ended with something that – as I only saw now – is similar to RachelRachels post:
Adding another variable (section or Category or maybe customfield?) to the array in line 111:
<code>$out[(int)safe_strftime(‘%d’,$i[‘posted’])][] = array(‘link’ => permlinkurl($i), ‘title’=>$i[‘Title’], ‘catclass’=>$i[‘Category1’]); </code>

And adding the content of the used field as a class-attribute in line 145:
<code>$c[] = doTag(‘<a class=”’.$catclass.’” title=”’.$title.’” href=”’.$link.’”>’.$title.’</a>’,‘div’,‘permalink’); </code>

This seems to work fine, if it is ok that you are stuck to this special criteria.
But I’m no coder, so can anyone tell me if this solution is fine and secure or if there are any traps?

SECOND EDIT:
For my purposes I need the following:
Events-entrys from different clients share for example a common section “events”,
each client tags its entrys for example by category1.
Output of all events in the mdp_calendar by section-attribute.
For adding a class to the event-link then I use the category1.

Or – if the site has all articles in the calendar (as in my testsite) – output in mdp-calendar without specifying section/category.
Each client has its own section or an own category.
Defining the class of event-links by specifying section-field or category-field whichever fits.
It also could be useful to have the AuthorID as class-attribute within the link.

So I want to make the following suggestion:

1) Add another attribute “classfield” (or something liek that), in which you can define from which field a class-attribute for the artice-link is generated.
Line 33:
<code> ‘classfield’ => ‘’, </code>
(Maybe some default would be fine.)

2) this Attribute defines from which field content is taken to generate a class-variable “linkclass”:
line 111 (now 112):
<code>$out[(int)safe_strftime(‘%d’,$i[‘posted’])][] = array(‘link’ => permlinkurl($i), ‘title’=>$i[‘Title’], ‘linkclass’=>$i[$atts[‘classfield’]]); </code>

3) And adding the content of the used field in “linkclass” as a class-attribute in
line 145 (now 146):
<code>$c[] = doTag(‘<a class=”’.$linkclass.’” title=”’.$title.’” href=”’.$link.’”>’.$title.’</a>’,‘div’,‘permalink’); </code>

For me this works fine. I can definte from which field to take the class attribute.

But anyway: couldn’t there much better be the using of a form implemented?

Last edited by saccade (2006-07-04 21:20:10)

Offline

#115 2006-07-08 10:36:34

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [plugin] [ORPHAN] mdp_calendar

This plugin has been added to the plugins archive. Please update the archive with new versions as they come out.

Offline

#116 2006-07-10 08:53:14

edmungo
Member
Registered: 2006-07-10
Posts: 12

Re: [plugin] [ORPHAN] mdp_calendar

For those of us having the (Date+1) tool tip/alt text/title rollover problem – there is an ‘error’ in the plugin code – to fix go Admin>Plugins>mpd_calendar(edit) – them line 237 reads:

$title = ‘ title=”’.safe_strftime(‘%x’,gmmktime(0,0,0,$this->month,$day+1,$this->year)).’”’; // no idea why $day+1, but otherwise it won’t work

but should read:

$title = ‘ title=”’.safe_strftime(‘%x’,gmmktime(0,0,0,$this->month,$day,$this->year)).’”’;

now this ‘error’ was obviously inserted deliberately to ‘fix’ some undefined problem, I don’t know why the comment says ‘no idea why $day+1, but otherwise it won’t work’ but I’ve edited the line and it seems to work fine for me, and it fixes the day+1 rollover problem

Offline

#117 2006-08-24 04:26:03

jagorny
Member
From: Portland, OR
Registered: 2006-08-24
Posts: 39
Website

Re: [plugin] [ORPHAN] mdp_calendar

ARGHHHHH!!!! This fixed it yesterday… TODAY it is BROKEN!

Ok – for those of you who have been having a ton of issues with the small calendar being broken, here’s the fix:

First of all, this is on version 1.0…

That line with the day+1 //Not sure why it works but if it’s not there it breaks…

$title = ‘ title=”’.safe_strftime(‘%x’,gmmktime(0,0,0,$this->month, $day+1 ,$this->year)).’”’; // no idea why $day+1, but otherwise it won’t work

Well, change the line to read:

$title = ‘ title=”’.safe_strftime(‘%x’,gmmktime(0,0,0,$this->month, $day, $this->year)+tz_offset() ).’”’;

That fixed all of my issues – Day of week being listed wrong, offset articles and wrong days.

Last edited by jagorny (2006-08-26 01:21:08)

Offline

#118 2006-08-24 11:38:00

ragger
Member
From: Netherlands
Registered: 2005-04-10
Posts: 82
Website

Re: [plugin] [ORPHAN] mdp_calendar

jagorny wrote:

PRAISE THE LORD I fixed it……

Great! Finally a solution for this ‘problem’. Thanks!

Offline

#119 2006-08-26 01:21:36

jagorny
Member
From: Portland, OR
Registered: 2006-08-24
Posts: 39
Website

Re: [plugin] [ORPHAN] mdp_calendar

Why Does It Say Paper Jam When There Is No Paper Jam!?

Offline

Board footer

Powered by FluxBB