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
Pages: 1 [2]   Go Down
Print
Author Topic: RSS Calendar 2  (Read 3330 times)
0 Members and 1 Guest are viewing this topic.
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #15 on: October 16, 2007, 09:25:20 PM »

Sorry for the slow reply, I've been in production for a show the past month. 

By entering the url of your xml template, it looks like you're almost there! The feed shows, and any minor validation problems can be dealt with:

1) Your $orgurl should be your home page, just hxxp: thenebb.  com/
2) Your $imageurl must be a link to an actual image file, as DanO pointed out
----For example: hxxp: thenebb.  com/mylogo.  gif
----As noted in the documentation, that image must be <=144px in width
3) As DanO also mentioned, you should make the server encoding change, but this is not absolutely necessary. 
4) There is a little mod included in the template, to exclude US holidays, if you wish. 
5) Also, you'll want to change the white text attribute, it doesn't read well on the event view template.

Hope this helps.   Otherwise, your feed looks good!
« Last Edit: October 16, 2007, 10:00:22 PM by musicvid » Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #16 on: December 21, 2007, 04:33:01 AM »

Then I have finally managed to get around and test musicvid's nationalisation update from almost a year ago. Sorry about the delay!

Yes, it worked nicely  Smiley

I do however have a comment. The published date shows exactly as it should in my native language (I guess after I set the language to be used to "no-no"). However the date of the event in the event title shows up with the American way of showing dates . This is easy to adjust down in the code, but in order to be easier to use for those with less skills in programming this format issue could have been moved to the top. You could of course use the settings managed within the admin part, but as I see it, it is just as good to set this in the xml-file (like now), as you might want to show it differently in different views.

PS! My last post was under the name "oas"
Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #17 on: December 21, 2007, 04:49:17 AM »

This comment is possibly a little bit about different tastes and need for different users.

In my case I think I will do some adjustments to what is put where in the actual feed. As the main interrest for my users are the actual date of the events and not when the event was entered into the calendar, I think I will put the actual date of the event where the published date is today (enables sort by date). I also think I will leave the title field with just the title of the event. Further on will I extend the description part with some of the fields from my calendar.

As I have several calendars combined with Meta calendar, I think I will enhance the feed by adding the Category feature, and use the calendar names as Categories.

I will post back when I have finished my personalization... (hopefully within the end of the year)
For those curious this feed is announced as "terminliste" on my web-page.
« Last Edit: December 21, 2007, 05:01:32 AM by Tanus » Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #18 on: December 26, 2007, 07:16:55 PM »

**However the date of the event in the event title shows up with the American way of showing dates . **

Could you show me an example of this, and how it should show up when nationalized. I might be able to change the way it shows up.
Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #19 on: December 27, 2007, 10:45:29 AM »

Of course.

The feed produced originally something like "Des 25, 2007" for itemdate and "25. desember 2007" for pubdate, after changing the language to "no-no" (Norwegian). Whilst the correct for itemdate should be either "25. des 2007" (or "25. desember 2007"). See two replies below.
« Last Edit: December 27, 2007, 12:44:13 PM by Tanus » Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #20 on: December 27, 2007, 10:59:44 AM »

A small suggestion for the "rssevent2.html" - file
The line
Code:
$feedcfg="calendarscript/calendars/$in{key}/$in{cfg}.txt";
should be replaced by
Code:
$feedcfg = $main::BASE_DIR."calendars/$in{key}/$in{cfg}.txt";

This is inline with DanO's suggestion for the xml-file
Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #21 on: December 27, 2007, 12:27:24 PM »

There is certainly something i doesn't understand fully in how this feed stuff works, however I have now finally found a solution for how to get both the dates right in programming. The way I did it was to use the strftime and the locale-setting. Like in the following.

By adding the following lines near the top, where strftime is defined
Code:
use POSIX qw(locale_h);
my $old_locale = setlocale(LC_TIME);

And then immediately before the variable $itemDate are set to my native language (Norwegian)
Code:
setlocale(LC_TIME, "no_NO");

I have also changed the setting of $itemDate to
Code:
my $itemDate    = strftime("%e. %b %Y", @start);

And then set it back after $itemDate are set (after the if-sentence)
Code:
setlocale(LC_TIME, $old_locale);
Then the dates mentioned above shows up correctly, and my items are showed in the right order.
Note: the $pubDate needed to be formatted as "en-us"... otherwise the feed-readers are confused!

It would of course have been possible to use the configuration settings provided by calendarscript, but I think that would have required a little bit more coding. For those not having POSIX-support that would probably be more flexible.

Whats left in my nationalization now is the html-template, where it seemed that I needed to modify it in order to display my national characters right in the header part. The other parts are displayed correctly... The trouble is that "ø" is displayed wrongly just after I click on the link to the event, but correctly if I do a browser refresh on the same page!  However after a short test is seems that it is only IE7 that has the problem and not Firefox or other readers I just tested...  Roll Eyes Therefore I leave this to Microsoft for the time being 
Huh?

« Last Edit: December 27, 2007, 03:28:08 PM by Tanus » Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #22 on: December 27, 2007, 05:49:16 PM »

Quote
The feed produced originally something like "Des 25, 2007" for itemdate ...

Code:
my $itemDate    = strftime("%d $mabbr, %Y", @start);
if ($time_format == 12) {
$itemDate       = strftime("$mabbr %d, %Y", @start);
#etc. etc.

Is this code in two places in the .xml template you are using? Are you using the new .xml template? Did you upload both files?

I thought that this would have displayed $itemDate as "25 des, 2007" if your calendar is set for 24-hr time format or "Dec 25, 2007" if it is set for 12-hour (English) time format. No changes to Posix_locale should be necessary because it now takes the Month and Day names and abbreviations directly from your Calendar Admin settings, not from strftime. Can you help me figure out why this is not working?

Quote
It would of course have been possible to use the configuration settings provided by calendarscript, but I think that would have required a little bit more coding. For those not having POSIX-support that would probably be more flexible.

Actually, it would require quite a bit more coding; that is actually how I started, and for your interest the discussion from two years ago is buried here:
http://www.calendarscript.com/support/forum/rss-feed-calendar-t1435.15.html#msg5889
Since Posix packs with every standard Perl distro, I think it is unlikely not to find it on anyone's unix server, however an alternative has already been provided in the code, "just in case."

Quote
A small suggestion for the "rssevent2.html" - file
The line
Code:
$feedcfg="calendarscript/calendars/$in{key}/$in{cfg}.txt";

should be replaced by
Code:
$feedcfg = $main::BASE_DIR."calendars/$in{key}/$in{cfg}.txt";

This is inline with DanO's suggestion for the xml-file

Yes you are correct. When we get these other nationalization details figured out (it is harder than I thought), I will incorporate the change in the next release. Thanks for staying in the discussion and for providing feedback that I cannot validate on a US server!
« Last Edit: December 28, 2007, 02:20:33 PM by musicvid » Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #23 on: December 28, 2007, 06:16:08 PM »

Quote
Is this code in two places in the .xml template you are using? Are you using the new .xml template? Did you upload both files?

I thought that this would have displayed $itemDate as "25 des, 2007" if your calendar is set for 24-hr time format or "Dec 25, 2007" if it is set for 12-hour (English) time format. No changes to Posix_locale should be necessary because it now takes the Month and Day names and abbreviations directly from your Calendar Admin settings, not from strftime. Can you help me figure out why this is not working?
Yes, I uploaded both files. Well, yes, I'm sorry, you are right. I was a bit quick and I didn't read the code well enough  Embarrassed - it gave me the 24hr set-up (25 Des, 2007) as you pinpointed. However, the Norwegian version is slightly different with placing of dots and commas, as well as capital letters or not. In this case there shall be small letters, but in some other places in the calendar they shall be capital... Usually we should not use leading zeros either, but this is minor.

So, to sum up: To get the your last version of the script into Norwegian, the only necessary thing to do was really to lowercase the $mabbr before it was used (Since in the other instances where they are used they should be capitalized - as I have done in the config-table), and then add a dot after the date and then remove the comma after the month... So it looks like this "25. des 2007"

My suggestion is to place some sort of a definition on how the user would like it in the top of the xml-file, and then use strftime as you are doing. And maybe have a line commented out down in the code to uncomment for us who needs it. Thats might be an easy way out...?
« Last Edit: December 28, 2007, 06:43:38 PM by Tanus » Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #24 on: December 28, 2007, 09:15:20 PM »

Quote
My suggestion is to place some sort of a definition on how the user would like it in the top of the xml-file, and then use strftime as you are doing. And maybe have a line commented out down in the code to uncomment for us who needs it. Thats might be an easy way out...?

After looking at all the many variations on the 24-hour and 12-hour clock schemes, see http://en.wikipedia.org/wiki/Date_and_time_notation_by_country,
I think I'll leave it as generic and portable as possible with the two "universal" options -- replacing a dot here or a leading zero there is something the user can either figure out or ask how to do in the forum. Actually, I'll probably take the comma out of the 24-hour designation to make it closer to RFC-1123. If capitalization of a month abbreviation is important in one usage and not in another, I thank you for finding your own solution. This customization can be done as well with Perl regexp. However, trying to accommodate all the possible language/locale variations using script options is well beyond the scope of my abilities or interest.

However, if you would like to develop this option set on your own (you seem quite knowledgeable), I will be glad to consider incorporating it into future versions of RSS templates for both CS and Coranto. Or, if you want to develop your own Norwegian-only version, you are welcome to do so, with proper credit given of course.

I also think the current scheme of taking Month and Day names and abbreviations from the user's definitions (as you suggested some time ago) will serve better than using strftime throughout, since if the user's server is not resident in their own country or is not suited to their own locality, the Posix_locale function is useless to them. The current scheme of leaving it up to the user should provide a satisfactory starting point, while customization is still as easy as with the rest of Calendarscript. Putting it all into English, as it was before, is still an option. If you have further comments on Ver. 2.02 I will be happy to discuss them. Thanks again for your input.

« Last Edit: December 29, 2007, 01:59:19 AM by musicvid » Logged
Tanus
New Member
*

Karma: 0
Offline Offline

Posts: 15


WWW
« Reply #25 on: December 29, 2007, 10:19:48 AM »

I agree with you. The best thing is probably to have it as it is, use the user abbreviations, and then let the users do further adjustments themselves. I will prepare a Norwegian version of your script with full credits and can make it available on request. (In the end it is only 2 lines that are changed for the dates and 2 lines that needed translation - times 2 for basic and advanced search mode)

No further comments at the moment.
« Last Edit: December 29, 2007, 11:33:39 AM by Tanus » Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #26 on: December 29, 2007, 12:13:08 PM »

Yes, I would like to receive a copy for future reference. musicvid{at}gmail.com

By the way, the translation of a string to all lower case looks like this:
Code:
#De-capitalize month abbreviation
$mabbr =~ tr/[A-Z]/[a-z]/;
Don't know if there are any considerations for your native language, but it should work.

Thanks again.
« Last Edit: December 29, 2007, 12:24:53 PM by musicvid » Logged
Pages: 1 [2]   Go Up
Print
Jump to: