Combining "My Calendar" with "Calendar"

Creating and modifying plugins.
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

I reinstalled the plugin, but it still doesn't want to add links directly to the calendar for me. On a side note, the My Calendar countdown is all screwy now. It's only showing days-left for one event.

Im about ready to call it good, and leave well enough alone. :D
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

The countdown thing was edited/changed by another developer, so I haven't looked into that.

Which version of the plugin are you using right now? And you definitely need the include/plugin_internal.inc.php file of the snapshot that will be created today,or fetch it via SVN directly...

I want to fix this, and not just ignore it :))

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

Okay, got the links to work in the calendar after appying the correct file. I wasn't appying the latest snapshot, only re-downloading the latest stable release and appying from there. *smacks self*

I'm still having problems with the events not showing how many days are left. One of the events displays the days left, but other events do not. The mycalendar event plugin is ver 0.6, and the sidebar plugin is 0.4.

Thanks

**edit**

Peeking at the code I noticed that maybe the plugin only shows the number of days left for an event if 1. It's in the future (makes sense) and 2. If it's not the next event.

Why doesn't it show days left for the nearest upcoming event?
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

Well, I got it to work by removing a portion of line 131 of serendipity_plugin_mycalendar.php.

from this...

Code: Select all

if ($days > 0 and $olddays > 0) {
to this...

Code: Select all

if ($days > 0) {
I don't understand the reason for not showing 'days left' for the first future entry. And I'm sure I fixed it exactly the wrong way, but it seems to work.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I've just committed a new plugin version that makes it configurable whether the first future item is skipped or not. It basically uses your code suggestion, so if you keep your patch you should be as happy as with the new version :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gizmola
Regular
Posts: 37
Joined: Mon Oct 25, 2004 11:54 pm

Post by gizmola »

kavuday wrote:I had to get my host to go in and reset permissions, etc. As far as I could tell, the fetched plugins were assigned an owner of 'nobody', hence I couldn't go in and change permissions. Weird...

Thanks for the help Garvin!
It's actually not weird at all, sounds like the apache server for your host runs as nobody. When spartacus is involved, it is creating the plugin directory and writing the plugin files, and depending on your plugin settings, and how the server is configured, it's not unusual to find that you now have locked yourself out of those files via any mechanism other than, as was suggested writing a script that accesses them for you, and perhaps chmods them so that you have access as "Other".
caw
Regular
Posts: 13
Joined: Wed Jul 20, 2005 5:48 am

Post by caw »

I upgraded to the new (0.6) version of the plugin and it appears lang_en.inc.php is missing. I'm getting all kinds of errors.

Code: Select all

Warning: main(/var/www/curtis/blog/plugins/serendipity_event_mycalendar/lang_en.inc.php) [function.main]: failed to open stream: No such file or directory in /var/www/curtis/blog/plugins/serendipity_event_mycalendar/serendipity_event_mycalendar.php on line 9

Warning: main() [function.include]: Failed opening '/var/www/curtis/blog/plugins/serendipity_event_mycalendar/lang_en.inc.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear:/usr/share/php/s9y/:/usr/share/php/s9y/bundled-libs/') in /var/www/curtis/blog/plugins/serendipity_event_mycalendar/serendipity_event_mycalendar.php on line 9

Warning: Cannot modify header information - headers already sent by (output started at /var/www/curtis/blog/plugins/serendipity_event_mycalendar/serendipity_event_mycalendar.php:9) in /usr/share/php/s9y/serendipity_admin.php on line 11
Thanks,
Curtis.
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

gizmola wrote:
kavuday wrote:I had to get my host to go in and reset permissions, etc. As far as I could tell, the fetched plugins were assigned an owner of 'nobody', hence I couldn't go in and change permissions. Weird...

Thanks for the help Garvin!
It's actually not weird at all, sounds like the apache server for your host runs as nobody. When spartacus is involved, it is creating the plugin directory and writing the plugin files, and depending on your plugin settings, and how the server is configured, it's not unusual to find that you now have locked yourself out of those files via any mechanism other than, as was suggested writing a script that accesses them for you, and perhaps chmods them so that you have access as "Other".
Yeah, this is a learning process for me...and I like to learn the hard way. In hindsight, I realized I didn't properly configure Spartacus to assign ownership for fetched files. Lesson learned...again. :D
Anthem
Regular
Posts: 20
Joined: Wed Aug 03, 2005 10:28 pm

Post by Anthem »

You might want to change Line 108 in serendipity_event_mycalendar.php

Code: Select all

                if (!isset($eventData[$day])) {
                    $eventData[$day] = array(
                        'Class'  => 's9y_mc_event',
                        'Title'  => $event['eventname'],
                        'Extended' => array(
                            'Link'   => $event['eventurl'],
-->                         'Active' => true)
                    );
to

Code: Select all

                            'Active' => $event['eventurl'] != '')
so that events without URL won't get an empty link.
2b || !2b
Post Reply