Page 1 of 1
My Calendar Plugin
Posted: Tue Aug 02, 2005 12:55 pm
by Col. Kurtz
I really like the My Calendar Plugin, but I dont use it because the lines really dont look good if you dont have an very wide sidebar.
Is there a way to display it like:
Date Titele (and/or link)
(Number of Days left)
and to highlight the dates?
like:
07.08. New Release of SX
(5 Days left)
09.08. Whatever
(7 Days left)
...
?
______________________
MARC
Re: My Calendar Plugin
Posted: Wed Aug 03, 2005 4:56 pm
by garvinhicking
Yes, I suggest to edit the plugin for that and change the PHP output.
I did not build the plugin with smarty template customization because it would be overkill for that to load the smarty things.
Regards,
Garvin
Posted: Wed Aug 03, 2005 11:54 pm
by Anthem
It seems that both IE and Firefox honor really as
non
breaking
space, so you might want you change the line
in serendipity_plugin_mycalendar.php to
I'd actually recommend that change for the official mycalendar, too
The remaining time will still show in the same line as the title if there is enough space.
If you want the remaining time always in its own line you might want to change the line to:
or use some stylesheets in this area
Posted: Thu Aug 04, 2005 1:09 am
by garvinhicking
Thanks for that information!
I am actually a bit afraid that if we include the in the official plugin it might break other people's sidebar which are dependend on a fixed width - if the plugin enforces a wider area, it might break heavily graphical sidebars...?!
So...maybe make it a config option? *LOL*
Regards,
Garvin
Posted: Thu Aug 04, 2005 4:06 am
by Anthem
Ok
So what about:
Code: Select all
<SPAN CLASS="mc_date">25.05</SPAN> - <A HREF="">asdf</A> <SPAN CLASS="mc_interval">(53 days)</SPAN>
and solve the display issues with CSS in the template:
Code: Select all
container_serendipity_plugin_mycalendar .mc_date { font-weight: bold; }
container_serendipity_plugin_mycalendar .mc_interval { white-space: nowrap; }
The <SPAN> itself should be neutral in terms of rendering, but I can check on that one.
Posted: Thu Aug 04, 2005 12:29 pm
by garvinhicking
That sounds like a perfect solution to me.
Regards,
Garvin
Posted: Thu Aug 04, 2005 12:30 pm
by Col. Kurtz
will you commit this to a new version or do Ill have to make those changes manually? i think there are other changes for that plugin discussed in a seperate thread also.
Posted: Thu Aug 04, 2005 1:11 pm
by Anthem
Apply this patch after the other two: (patch -p1 < ..)
Code: Select all
diff -ruN cvspatch2/serendipity_plugin_mycalendar.php cvspatch3/serendipity_plugin_mycalendar.php
--- cvspatch2/serendipity_plugin_mycalendar.php 2005-08-04 10:49:18.000000000 +0200
+++ cvspatch3/serendipity_plugin_mycalendar.php 2005-08-04 11:00:56.000000000 +0200
@@ -112,10 +112,18 @@
$days = ceil(($item['eventdate'] - $ts) / 86400);
if ($days > -$showtime) {
- echo serendipity_strftime($this->get_config('datefm'), $item['eventdate'], false) .
- ' - ' . $cont .
- ($days > 0 ? ' (' . $days . ' ' . DAYS . ')' : '') .
- '<br />';
+ $cont = '<span class="mc_date">' . serendipity_strftime($this->get_config('datefm'), $item['eventdate'], false) . '</span>' .
+ ' - ' . $cont;
+
+ if ($days > 0) {
+ $cont = '<span class="mc_future">' . $cont . ' <span class="mc_interval">(' . $days . ' ' . DAYS . ')</span>';
+ } elseif ($days == 0) {
+ $cont = '<span class="mc_current">' . $cont;
+ } else {
+ $cont = '<span class="mc_past">' . $cont;
+ }
+
+ echo $cont . '</span><br />';
} elseif ($autoprune) {
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}mycalendar WHERE eventdate < ". ($ts - $showtime*24*60*60));
$autoprune = false;
This allows for the following stylesheet:
Code: Select all
.container_serendipity_plugin_mycalendar .mc_past { color: #888; }
.container_serendipity_plugin_mycalendar .mc_current { text-decoration: blink; color: #F00; font-weight: bold; }
.container_serendipity_plugin_mycalendar .mc_future { font-style:italic; }
.container_serendipity_plugin_mycalendar .mc_date { font-weight: bold; }
.container_serendipity_plugin_mycalendar .mc_interval { white-space: nowrap; }
Posted: Thu Aug 04, 2005 1:20 pm
by garvinhicking
I think I am now completely out of synch with your plugin; I don't have that $showtime variable.
How about I give you CVS access so you can commit to the plugin? I then just need you to give me the name of your SourceForge.Net account (if you don't have one, apply for one, it's free)...and I hope you'Re famillar with CVS, but you sound as if you do.
Regards and many thanks,
Garvin
Posted: Thu Aug 04, 2005 1:34 pm
by Anthem
$showtime gets introduced in
part II of the patch.
Ok, I just made an sf-account: anthem2005
Posted: Thu Aug 04, 2005 1:57 pm
by garvinhicking
Thanks a lot, you're in.
You'll also benefit from having realtime access to CVS now.
Regards,
Garvin
Posted: Thu Aug 04, 2005 2:59 pm
by Anthem
Ok, the official names are now
.s9y_mc for the entire line,
.s9y_mc_date for the date,
.s9y_mc_c for the text
.s9y_mc_day for "(... days)"
Should I insert the future/past/current classes as well ?
Posted: Thu Aug 04, 2005 4:11 pm
by garvinhicking
I think that would help, yes
Regards,
Garvin
Posted: Thu Aug 04, 2005 4:26 pm
by Anthem
ok

The classes are .s9y_mc_past, .s9y_mc_current, .s9y_mc_future
I hope I didn't break anything with the cvs

, I always let someone else do the checkin
Posted: Thu Aug 04, 2005 4:45 pm
by garvinhicking
Your cvs commits all look propper, thanks a lot!
Regards,
Garvin