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


Login with username, password and session length

Search

 
Advanced search

8021 Posts in 1850 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Event list and mini-calendar  (Read 396 times)
0 Members and 1 Guest are viewing this topic.
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: September 16, 2003, 07:06:00 PM »

Hi,
I'd like to use CalendarScript to recreate this kind of layout, for a client of mine:
http://www.winter2010.com/NewsAndEvents/Events/Default.htm?month=7&year=2003

I've done some tweaking of the "basic" template, added style sheets to make it match their existing site better, etc. But my pace is turtle-slow, and I know someone more familiar with the custom tags, etc. could probably do it in two seconds... wondering if anyone could share their expertise on the code required.

Basically I would like the following:
- compact, date-only calendar on the right
- Clickable list of events for the selected month on the left.
- Would need the individual event page to match as well, of course.

Any help much appreciated!
thanks!
Adam

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 219

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


WWW
« Reply #1 on: September 16, 2003, 08:20:00 PM »

** I've done some tweaking of the "basic" template **

Have a look at the "Headlines" template at the Unofficial CalendarScript - Mods and Plugins site. Just call it twice (once each way) via 2 SSI tags on the same page.

Dan O.

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

Logged
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: September 17, 2003, 01:41:00 AM »

Thanks Dan, looks like quite the treasure trove! Should be pretty much what I need.

Adam

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

Logged
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: September 17, 2003, 12:47:00 PM »

Hi Dan!

Well, thanks to some late-late-night hacking and your brilliant template, I'm nearly there! My "default.html" now includes your 2 SSI's which I've modified according to my needs:
http://www.adamabrams.com/cgi-bin/calendar/calendar.cgi?month=9&year=2003

Two (hopefully easy) questions:

How exactly do I make the titles of the events into links to an event view? (Description on left, calendar on right) I still can't quite wrap my head around it. I'm assuming I have to add an option for a single-event view to ssi_max_events.html... and an <A></A> that includes the correct cgi code... but my brain is full at the moment...!

My  current code for ssi_max_events.html follows.

Thankyouverymuch!
Adam

<%
&getEvents( {'duration'=>$in{duration}} );
$DAY = $Grid->{'grid'}->

  • ->
  • ;
    $EVENTS = $DAY->{events};
    $total_events=0;
    $total_trueevents=0;
    $max_events=20;
       $time = time;
       ($neg_pos,$hours) = ($vars{time_offset} =~ /([+-])(\d+)/);
       if ($neg_pos eq '+') {
          $time += (60*60 * $hours);
       }
       else {
       $time -= (60*60 * $hours);
       }
       ($mday,$month,$year) = (localtime($time))[3,4,5];
       $month = $month+1;
       $year = $year+1900;
       $datestamp = sprintf("%4.4d%2.2d%2.2d",$year,$month,$mday);
    %>
    <table width="auto" cols="2">
    <tr align="left"><td align="left" valign="top" width="auto"><b>DATE</b></td>
    <td align="left" valign="top"><b>EVENT</b></TD></tr>
    <%FOREACH EVENTLIST%>
       <%IF EVENTS EXIST%>
       <%$total_events++;%>
       <%if($DAY->{dd} >= $mday) { %>
       <tr><td valign="top"><%=$DAY->{mm}%>/<%=$DAY->{dd}%></td>
       <td valign="top">
          <%FOREACH EVENT%>
             <% $total_trueevents++;%>
             <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= $EVENT->{'schedule'}->{'start_time'} %><% } %>
             <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= $EVENT->{'schedule'}->{'end_time'} %><% } %>
             <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %>


             <%= $EVENT->{'details'}->{'title'} %><BR>
             <% if($total_trueevents >= $max_events) {
                exit();
             }%>
          <%/FOREACH%>
    </td></tr>
       <%/IF%>
       <%}%>
    <%/FOREACH%>
    </table>
    <%unless($total_events){%>
    <CENTER><I>No Events</I></CENTER>
    <% } %>

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 219

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


WWW
« Reply #4 on: September 17, 2003, 04:29:00 PM »

** and your brilliant template **

It's not my template but was contributed by Kent (a previous forum regular).

** My "default.html" now includes your 2 SSI's **

What I was suggesting was including those 2 templates into a plain SSI parsed HTML file, not into a CalendarScript template.

BTW. I don't know if your mini calendar is working the way it is suppose to as I believe the dates which have events scheduled on them should be highlighted. Also, the links from those dates should go to a 'Day View' page which lists the events scheduled on that date only. They don't, it just goes back to the same month view.

Your display looks quite promising though. Maybe when you get the bugs worked out you'll consider making a copy available at the Unofficial CalendarScript - Mods and Plugins site?

** How exactly do I make the titles of the events into links to an event view? **

I assume (I don't know for sure because I don't use that template myself) the same way they it was done on the original default.html template file. Try searching it for "<%= EVENT FIELD(title) %>" (without the quotes) to see code examples.

Dan O.

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

Logged
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #5 on: September 18, 2003, 11:50:00 AM »

Thanks Dan, I'll keep plugging away and will let you know when I have it all solved! (He said hopefully...)

Adam

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

Logged
Tetley
Guest
« Reply #6 on: September 25, 2003, 03:31:00 PM »

Hi,

To link events to the corresponding calendar events, use this code in your ssi.html:

code:
<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"><%= $EVENT->{'details'}->{'title'} %></a>


Logged
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #7 on: September 26, 2003, 01:01:00 AM »

Thanks Tetley, I think I _nearly_ have it all sorted out now...

One thing though: any idea why I get an error when I click on a day of the month?
http://www.adamabrams.com/cgi-bin/calendar/calendar.cgi

(Still a bit rough around the edges, be warned)

And can the current day be highlighted in a different colour?

Thanks!

Cos

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 219

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


WWW
« Reply #8 on: September 26, 2003, 01:03:00 PM »

** any idea why I get an error when I click on a day of the month? **

If you look at the link URLs you'll see the problem (HASH(0x8315cf0) bolded below):

http://www.adamabrams.com/cgi-bin/calendar/calendar.cgi?view=Day&datestring=2  003HASH(0x8315cf0)24

It looks like one of the variables you've used to genterate the link URL isn't correct or isn't used correctly.

** can the current day be highlighted in a different colour? **

I'm sure it's possible as the original default.html template file did it.
Have a look how it was done there and see if you can make a similar conditional
in the template code you're using.

** I think I _nearly_ have it all sorted out now **

Looks good but it is generating a JavaScript error when loaded.

BTW. I guess you haven't gotten to the Event View part of the template as clicking
on one of the event titles causes (most of) the calendar grid to not be displayed.

Dan O.


[This message has been edited by DanO (edited September 26, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 219

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


WWW
« Reply #9 on: October 22, 2003, 06:46:00 PM »

I've just about completed a template/plug-in which includes a mini calendar (Kent's) and a
list view of events for the month similar to the one you linked to. It also includes a
'Day View' and 'Event View' display which also includes the mini calendar.

I'll post a note here about it once it and it's documentation is finished.

Dan O.

[This message has been edited by DanO (edited October 22, 2003).]

Logged
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #10 on: October 22, 2003, 07:05:00 PM »

Thanks, I'm really looking forward to that! Luckily this part of my Web project has been postponed, but it will be coming back to haunt me before too long, and it will be nice to have a solution ready to go.

Thanks again!

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 219

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


WWW
« Reply #11 on: November 29, 2003, 08:18:00 PM »

This template was pretty complicated to make as it required some plug-in
components also to allow it to function properly. It is called the
"DoubleCal" template and is available for a nominal donation via PayPal
from the Unofficial CalendarScript - Mods and Plugins site.

BTW. It is NOT an SSI template but instead meant to replace the default calendar view.
You can see some sample images of its output at the following link:

LINK > DoubleCal Template/Plug-in Images

Let me know if you have any questions.

Dan O.

[This message has been edited by DanO (edited November 29, 2003).]

Logged
cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #12 on: November 29, 2003, 08:37:00 PM »

Thank you, DanO! I bow to your dedication and expertise!

It won't be long now before I'll be needing that script, so the timing couldn't be better.

Look for a generous PayPal donation from me soon!

Cosmo

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

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