Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)Import Events Using csxport files
Pages: [1]   Go Down
Print
Author Topic: Import Events Using csxport files  (Read 361 times)
0 Members and 1 Guest are viewing this topic.
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« on: May 18, 2004, 10:56:00 AM »

Problem: How to cross-populate selected groups of events from calendars on different domains.

One solution: Use the csxport beta plugin to make a text db, then use the Import Events function in the other calendar.

Works very well if I twiddle the text file to make it import correctly. In order to make things fully compatible, I would need to accomplish three things:

1) Eliminate the extra space following the delimiter in the csxport output.
2) Change the start_time and end_time (24 hr.) from hhmm to hh:mm OR change the Import Events to accept hhmm
3) Preserve the line breaks from textarea fields in the output.

I know the csxport plugin was mostly abandoned, but we are going to use it extensively for creating end-of-year reports and the use described above. Can someone point me in the right direction on these mods?

TIA

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: May 18, 2004, 03:33:00 PM »

 
quote:
1) Eliminate the extra space following the delimiter in the csxport output.
2) Change the start_time and end_time (24 hr.) from hhmm to hh:mm OR change the Import Events to accept hhmm
Both of those should be able to be accomplished using the search and replace feature of a text editor and regular expressions.

I have not delved into that plug-in to be able to tell you what parts of the plug-in code would need to be modified to accomplish those tasks automatically. Sorry.

Dan O.

------------------

Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #2 on: May 19, 2004, 01:27:00 PM »

Got the hh:mm problem solved.

Still can't eliminate the leading white space (it leads the data rather than trailing the delimiter). I've been trying $whatever =~ s/^\s*//; in various places to no avail.

Will post all the solutions once I've got them all; I believe several people could benefit from them judging by the questions regarding importing events.

Any guidance gratefully appreciated.


------------------

Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #3 on: May 21, 2004, 01:10:00 PM »

Woohoo! Got the whitespace thing solved. Two down, one to go. Details forthcoming.

------------------

Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #4 on: May 23, 2004, 10:05:00 PM »

OK, here it is.
Allows no-hassle export/import between calendars by using the csxport beta plugin to create an intermediate database.
I will put it into a new thread after a few people have had a chance to try it out and post improvements or simplifications.

Back up your admin.pl file.

In admin.pl find two instances of
=~/(\d\d?) : (\d\d?)/); (Remove the spaces before and after the : to search for this line)
Remove the : in both instances
This should not create a problem unless you are also importing events from Version 2 calendars.

In import_events.html find two instances of
HH:MM
Replace both with
hhmm

In the csxport display_after_search.pl find the line
flock(FILE, 2);
Immediately after that line paste these three lines
$csx_data =~ s/\n |\r $/\n/g;
$csx_data =~ s/\| /|/g;
$csx_fieldnames =~ s/\| /|/g;
This assumes you will be using a pipe "|" delimiter. For other delimiters the last two lines will have to be altered accordingly.

Also in the csxport display_after_search.pl find the line
$csvc_eventkey =~ s/\n|\r//mg;
Replace with
$csvc_eventkey =~ s/\n|\r/\\n/mg;
This will preserve line breaks in the event descriptions, etc. if you are using the preserve line breaks mod. in your templates.

All suggestions welcomed.
------------------

[This message has been edited by musicvid (edited May 28, 2004).]

Logged
Pages: [1]   Go Up
Print
Jump to: