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


Login with username, password and session length

Search

 
Advanced search

8240 Posts in 1905 Topics- by 2172 Members - Latest Member: JeffHLB
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO)Different navigation buttons depending on the map being viewed??
Pages: [1]   Go Down
Print
Author Topic: Different navigation buttons depending on the map being viewed??  (Read 1743 times)
0 Members and 1 Guest are viewing this topic.
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« on: September 30, 2009, 06:07:16 PM »

Hi again,

I managed to get a flash program to work on the calendar - its a small map and it sits just above the buttons on the left. The map links to the different calendars.


We have two "sets" of calendars. I want to make it so that the red team calendars all show the flash map program which will link to all of the red calendars, and the green team calendars all show a different map (which looks the same) which links to all the green team calendars. Then I want to add a button that lets you flip between red and green team (it looks too cluttered if I try and put both the red team and green team maps on at the same time.


What I need to do is like having different buttons down the left side of the calendar - depending on which calendar you are looking at. I know they are set in the default.html file and there is one default.html for all of the calendars - but is it possible to show one button on the left for calendars 1-5 and a different button for calendars 6-10?


I don't know if it helps - but its actually only the links within the xml file for the flash map that are different between the two sets of calendars - everything else is the same.

Thanks again

Anthony
Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #1 on: September 30, 2009, 09:02:46 PM »

** is it possible to show one button on the left for calendars 1-5 and a different button for calendars 6-10? **

It should be possible to make a conditional based on the current calendar being viewed. The $Calendar->{'key'} variable should contain the key value for the current calendar being viewed. To see what it is currently set to put <%= $Calendar->{'key'} %> somewhere on your template to see what is printed out.

I'll leave making the conditional to use to yourself. There should be lots of examples in previous forum messages or already in the template code.

JMO

Dan O.
Logged
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« Reply #2 on: October 01, 2009, 04:38:46 PM »

Hi,

I cant get it to work.


When I put <%= $Calendar->{'key'} %> into the default.html - it comes up with half a page of text (most of it about metacalendar) but with no $calendar entries at all.

Any ideas what I did wrong?

Anthony

This is what I see:

$STYLE = $in{style} || $_DEFAULT_LIST_GRID; $VIEW = $in{view}; if (!$in{duration} && !$in{range} && !$in{startdate} && !$in{enddate}) { $VIEW ||= $_DEFAULT_VIEW; } if ($VIEW eq "Month") { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); } elsif ($VIEW eq "Week") { &getEvents( { 'range'=>'week' } ); } elsif ($VIEW eq "Two-Week") { &getEvents( { 'range'=>'twoweek' } ); } elsif ($VIEW eq "Three-Week") { &getEvents( { 'range'=>'threeweek' } ); } elsif ($VIEW eq "Four-Week") { &getEvents( { 'range'=>'fourweek' } ); } elsif ($VIEW eq "Day") { &getEvents( { 'range'=>'day','startdate'=>$DATESTRING } ); } elsif ($VIEW eq "Event") { $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main::DBEvents; $fields = &main::DBGetFieldsInDisplayOrder($db); } elsif ($VIEW eq "Search") { $db = $main::DBEvents; # Keep form values to populate form fields foreach (keys %in) {$name = $_; if ($name =~ s/^FIELD_//) { $search_params->{$name} = $in{$_}; } }


Lots about metacalendar

} else { &getEvents( {'duration'=>$in{duration}, 'range'=>$in{range}, 'startdate'=>$in{startdate}, 'enddate'=>$in{enddate} } ); } if ($GRID_ROW_COUNT > 0) { $rowheight = "HEIGHT=\"".int(90/$GRID_ROW_COUNT)."%\""; }
Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #3 on: October 02, 2009, 12:47:53 PM »

** When I put <%= $Calendar->{'key'} %> into the default.html - it comes up with half a page of text **

Where exactly are you putting that tag???

Try putting it immediately after the <BODY...> HTML tag to see what is printed out at the very top of the calendar display.

BTW. Just in case you haven't figured it out and it is what you're experiencing, you can NOT put <% ... %> tags inside other <% ... %> tags.

Dan O.
« Last Edit: October 02, 2009, 12:49:27 PM by DanO » Logged
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« Reply #4 on: October 02, 2009, 04:22:46 PM »

Hi, thanks.

To start with I put it right after the bit that says "Begin the code" and it came up with all that text.

If I put it after the bit that says <body or anywhere else lower dowm then nothing happens. There is no difference with the <%= $Calendar->{'key'} %> tag or without it.

I'm not sure why.

Anthony
Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #5 on: October 02, 2009, 05:35:26 PM »

** To start with I put it right after the bit that says "Begin the code" **

That would be within other <% ... %> tags which I explained above is not allowed.

** If I put it after the bit that says <body or anywhere else lower dowm then nothing happens. **

What do you mean by "nothing happens"?? Just that nothing extra is printed out when the page is displayed or not even the page is displayed??

** There is no difference with the <%= $Calendar->{'key'} %> tag or without it. **

If it wasn't within <%= ... %> tags, "$Calendar->{'key'}" should literally be printed on the calendar somewhere rather than the value it represents.

** I'm not sure why. **

I'm afraid i do not know either.

Dan O.
Logged
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« Reply #6 on: October 02, 2009, 06:30:13 PM »

HI,

Just to clarify what I'm trying to do...

I have this entry which adds a map just above the grid-view button:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/sw flash.cab#version=8,0,0,0" width="150" height="150">
<script type="text/javascript" src="http://www.mywebsite.com/website/ieupdate.js"></script>
<param name="movie" value="http://www.mywebsite.com/website/Map.swf"><param name="quality" value="best"><param name="loop" value="false"><param name="wmode" value="transparent">




What I want is for the map.swf file to appear with caleandars A, B C and D, but map2.swf to appear with calendars E, F G and H



I'm a bit stuck again.

Thanks if you can point me in the right direction.

Anthony
Logged
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« Reply #7 on: October 02, 2009, 06:39:16 PM »

Also - I have been trying to find a work around to this problem... [I roughly understand the idea of setting up a conditional so it shows a different map depending on the calendar but I'm not sure where to start and I cant even get the bit to find out what calendar I'm using to work! - so not a good start].


Can I run two copies of calendarscript side by side on teh same server? There would be one for red team and one for green team. For the user it would make no difference at all and I could run two versions of my pap - on in each package.


Presently I have it installed in cgi-bin/calendarscript - so default.html is cgi-bin/calendarscript/templates/calendars/default/default.html.


Could I copy the whole thing into a second dir cgi-bin/calendarscriptB and then link to the relevant pages there?


Failing that - can you point me to an example conditional (perhaps in teh archive or on the web) and I can have a go at learning how to do it.


Thanks again

Anthony
Logged
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« Reply #8 on: October 02, 2009, 08:30:08 PM »

Here is another thought - can you help me work out how to add navigation buttons to the right of the calendar? - The grid/list buttons are currently flush to the left - how can I add copies of the buttons that are flush to the right? Ive been playing around with the default.html but I cat get it to work.

Thanks

Anthony
Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #9 on: October 02, 2009, 10:44:20 PM »

.
I only volunteer my services here. I will try to help you (or others) use CalendarScript but there is a limit of what I will do for free. If anyone wants me to do the work for them, I'm available for hire.


Here is some free help:

** What I want is for the map.swf file to appear with caleandars A, B C and D, but map2.swf with calendars E, F G and H **

This is pseudo (not actual) code just to give you an idea:

Print out most of the common HTML code that adds the map menu. Then using template programing do something like:

if (calendar A, B C or D)
print <param name="movie" value="http://www.mywebsite.com/website/Map.swf">
else
print <param name="movie" value="http://www.mywebsite.com/website/Map2.swf">

Then print out the rest of the common map code.


** Can I run two copies of calendarscript side by side on teh same server? **

You can run a hundred... depending on the server resources available. You can also run two independent calendars using a single calendar installation.


** Could I copy the whole thing into a second dir cgi-bin/calendarscriptB and then link to the relevant pages there? **

I don't know what you mean by "then link to the relevant pages there" nor what it is suppose to accomplish.


** Failing that - can you point me to an example conditional (perhaps in teh archive or on the web) and I can have a go at learning how to do it. **

The forum messages titled "Color coding Events", "add color choice [for] display of event title" and "adding icons" which are linked from the Links section of the Unofficial CalendarScript - Mods and Plugins site all (and probably others) show conditional template statements which could be viewed to get an idea of how such coding is used.

JMO

Dan O.

« Last Edit: October 02, 2009, 10:47:01 PM by DanO » Logged
diggers253
New Member
*

Karma: 0
Offline Offline

Posts: 32


« Reply #10 on: October 03, 2009, 09:58:16 AM »

Thanks - I'll give this a go - how much do you charge to to sort out this kind of problem directly?

Anthony
Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #11 on: October 03, 2009, 03:11:23 PM »

You can email me if you'd like to discuss hiring my services.

Dan O.
« Last Edit: October 03, 2009, 11:59:49 PM by DanO » Logged
Pages: [1]   Go Up
Print
Jump to: