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


Login with username, password and session length

Search

 
Advanced search

8264 Posts in 1911 Topics- by 2176 Members - Latest Member: dsets5646
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO)SSI Script Catches another one :-(
Pages: [1]   Go Down
Print
Author Topic: SSI Script Catches another one :-(  (Read 2656 times)
0 Members and 1 Guest are viewing this topic.
John_Lickman
New Member
*

Karma: 0
Offline Offline

Posts: 0

IT Manager


WWW
« on: January 06, 2006, 06:37:00 PM »

Hi,

I'm almost embarrased to ask this again, but I've read lots of previous posts on here and BigNoseBird.com's guide to SSI and I think I've done everything right, but....

Please can some give be a clue as to where it's all going wrong?

My aim is to embed a mini calendar in my home page.  I started simple by creating a test file called test1.shtml and placing it in the same folder as my index.html.  The file contains the following:
   <html>
   <head>
   <title>An SSI Test Page</title>
   </head>
   <body>
   <p>This is a test of an SSI script</p>
   <!--#exec cgi="/cgi-bin/CalendarScript321/calendar.pl"-->
   </body>
   </html>

I've checked the ssi.txt file in the CalendarScript321/calendarscipt folder. It reads
   template=ssi.html
   duration=1d

I downloaded the new_minical.html scipt from much2.com and uploaded it to my CalendarScript321/calendarscipt/templates/calendars/default folder and renamed it as ssi.html (saving the original one first).

When I run my test1.shtml file my browser show the "This is a test..." message followed by my standard, default matrix calendar display.  This is the calendar I see when I open it from a link on my home page.  It's as it either the ssi.txt file or the ssi.html file is being ignored completely! If I delete the default.html file I get an error message "template file specified does not exist" from both my test1.shtml file and the link on my home page.

Thanks in advance

John

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 284

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


WWW
« Reply #1 on: January 07, 2006, 02:32:00 AM »

** When I run my test1.shtml file my browser show the ... default calendar [grid] display. **

Sounds like CalendarScript is not recognizing it is being called via SSI. Try one of the alternate SSI tags illustrated in the previous forum message "SSI head ache!".

Dan O.


Link Updated
« Last Edit: October 08, 2007, 09:18:03 PM by DanO » Logged
John_Lickman
New Member
*

Karma: 0
Offline Offline

Posts: 0

IT Manager


WWW
« Reply #2 on: January 07, 2006, 03:46:00 PM »

Thanks very much for your help Dan.

I tried as many permutations as I could think of and the one that worked was...

<!--#include virtual="/cgi-bin/CalendarScript321/calendar.pl?template=ssi.html&duration=2d"-->

With that little mistery out of the way I can get on with my next challenge, namely getting a script that will also display a mini-calendar for next month too.

Thanks again.

John

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

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 284

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


WWW
« Reply #3 on: January 07, 2006, 04:17:00 PM »

** the one that worked was...

<!--#include virtual="/cgi-bin/CalendarScript321/calendar.pl?template=ssi.html&duration=2d"--> **

You probably don't need the &duration=2d part of it as that is telling the calendar to display 2 days worth of events which is not applicable to the mini calendar.

** my next challenge [is] getting [the] script [to] also display a mini-calendar for next month too. **

That can easily be done by adding a second SSI call and passing the appropriate query string to the calendar to tell it what month's events to display. Eg.

<!--#include virtual="/cgi-bin/CalendarScript321/calendar.pl?template=ssi.html&month=2"-->

Would tell it to display month 2 (February's) events.

JFYI

Dan O.

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

Logged
John_Lickman
New Member
*

Karma: 0
Offline Offline

Posts: 0

IT Manager


WWW
« Reply #4 on: January 08, 2006, 02:04:00 PM »

Once again, thanks very much for your help Dan.

I now have a template that will display a mini calendar in the colours I want and open the link to the daily events list in a new page. I can even get it to display 2 mini-calendars, one above the other - but both for this month.

I am now trying to produce a template that with display a mini calendar for this month and next month, which ever month that is.  My few hours playing with SSI hasn't revealed any way of automatically generateing a calendar for "next month".  I've spent some time also looking at the calendarscript template language.  I can get close but no cigar.  What I need, I think, is some code that will retrieve the current date and calculate the start and end dates for next month and then assign them to variavles that I can use in a &getEvents call.  I can see the logic in my head, but translating it to SSI, CGI, Perl, or whatever, code is where my experience runs out.  Can anyone help me here?

Thanks in advance.

John

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

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 284

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


WWW
« Reply #5 on: January 08, 2006, 07:45:00 PM »

**  I can get it to display 2 mini-calendars, one above the other - but both for this month. **

Did you try the SSI tag I suggested?

<!--#include virtual="/cgi-bin/CalendarScript321/calendar.pl?template=ssi.html&month=2"-->

(note the &month=2)

Dan O.

PS. Please supply a link to your calendar so we can test it directly.

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

Logged
John_Lickman
New Member
*

Karma: 0
Offline Offline

Posts: 0

IT Manager


WWW
« Reply #6 on: January 09, 2006, 03:01:00 AM »

Hi Dan,

As always thanks for your reply.

It appears that I may have done you a disservice!

I assumed that the &month=2 would have just loaded a calendar for the month of February, regardless of what month of the year it was. Can you confirm that this is the case?  The documentation doesn’t seem very clear in the area - or I’m being stupid again (equally possible)  

I have now updated my test page to include the SSI tags you suggested.  The link is as follows:
http://www.bikesites.org.uk/test1.shtml

Thanks for your help.

John

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

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 284

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


WWW
« Reply #7 on: January 09, 2006, 12:11:00 PM »

** I assumed that the &month=2 would have just loaded a calendar for the month of February **

That is true.

Dan O.

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

Logged
John_Lickman
New Member
*

Karma: 0
Offline Offline

Posts: 0

IT Manager


WWW
« Reply #8 on: January 09, 2006, 06:38:00 PM »

Has anyone got any thoughts on how I can get a calendar for next month, regardless of which month it is today?

This kind of thing...

Draw the first mini calendar for current month

IF month = 12 then
  next_month = 1
  year = year + 1
ELSE
  next_month = month + 1

Draw the mini calendar for calculated value of next_month

As I said in an earlier post, I think this needs to be done in the Perl part of the template, but that's beyond my knowledge.  

Any help would be much appreciated.

John

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

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 284

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


WWW
« Reply #9 on: January 10, 2006, 01:17:00 PM »

** I think this needs to be done in the Perl **

Depending on the version of SSI used on your server, the month part of the SSI tag might be able to be set using SSI.

** I think this needs to be done in the template **

It could be done there too, maybe even easier.

CalendarScript does have one variable that contains the value of next month ($NEXT_MONTH) as described in the documnentation. If the $month template variable was set using the $NEXT_MONTH value, the template should display next month's events?

That's just a guess through, I've never tried it.

Dan O.

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

Logged
roberts
Guest
« Reply #10 on: March 16, 2007, 01:14:00 AM »

hi,

you try Code:
<!--#set var="cmd" value="/cgi-bin/CalendarScript321/calendar.pl?${QUERY_STRING}"-->
<!--#exec cgi="${cmd}" -->  
?

------------------
software reviews

Logged
tekn1qu3z
New Member
*

Karma: 0
Offline Offline

Posts: 1


« Reply #11 on: October 07, 2007, 08:23:07 PM »

I keep getting an error with that roberts.  Can you help me?
Logged

hxxp: www. discount-softwares. com/
Pages: [1]   Go Up
Print
Jump to: