Ajax Event Calendar Support Product Page

Answered

How to display events from a calendar based on URL parameter

14 years ago kenneth burnett posted:
hello,

i just purchased ajax event calendar from dmxzones.com. im trying to filter the calendar so it only shows info based on the hotel being shown on that page. it is a bahama hotel reservation site. the hotel page is dynamic and comes from a recordset. so on the item detial page i have the ajax event calendar. my question is how do i filter and show only events for that item in the ajax calender based on URL paremeter wich is the product ID?

here is what im using.

microsoft access database
asp/vbs script.

can you tell me the detailed easy instructions on how to populate the calendar based on the URL parementer ID? your help would be SOOO MUCH APPRECIATED.

thanks you so much in advanced and GOD bless.

regards,
kenneth burnett
eric6250@comcast.net

Promoted Answers

Replied 13 years ago
Here some instructions:
NOTE:
Those instructions require working in CODE view mode and are for Advanced users!

1. First you need to pass the variable to the script that populates the Calendar.
You will find the script path in Scrip tag that is right after the calendar markup. Generally looking like this:


<div class="dmx_ajax_event_calendar elegant_blue" id="dmxAjaxCalendar1" style="width:700px;"></div>
<script type="text/javascript">
  // <![CDATA[
jQuery(document).ready(
   function()
     {
       jQuery("#dmxAjaxCalendar1").dmxAjaxCalendar(
{id:"dmxAjaxCalendar1", width:700, height:500, allowed_display_types:[true, true, true, true], legend_position:"bottom", display_type:3, events_type:[{number:0, name:"Australian", color:"#000099", background_color:"#FFFFFF", border_color:"#FF0000"}, {number:1, name:"Canadian", color:"#FF0000", background_color:"#FFFFFF", border_color:"#FF0000"}, {number:2, name:"China", color:"#FFFF00", background_color:"#FF0000", border_color:"#FF0000"}, {number:3, name:"German", color:"#000000", background_color:"#FF0000", border_color:"#FFFF00"}, {number:4, name:"Indian", color:"#FFFFFF", background_color:"#336600", border_color:"#FF9900"}, {number:5, name:"Russian", color:"#FFFFFF", background_color:"#0000CC", border_color:"#FF0000"}, {number:6, name:"USA", color:"#FF0000", background_color:"#FFFFFF", border_color:"#0000CC"}], google_feeds:[], ajax_feeds:[{url:"calendar_ajax/calendar_get_events1.asp"}], link_google_events:true, use_working_hours:true, working_hours_start:8, working_hours_stop:18}       );
     }
);
  // ]]>
</script>


So, you are looking for following :

ajax_feeds:[{url:"calendar_ajax/calendar_get_events1.asp"}]



2. Here you need to add your URL param like this:

 ajax_feeds:[{url:"calendar_ajax/calendar_get_events1.asp?ParamName=<%= QueryString("ParamVariable")%>"}]


Where ParamName is the name of the URL Variable that will be passed to the calendar Script and ParamVariable is the name of your current URL variable name.
3. Once this is set on your calendar page you need to open the calendar_ajax/calendar_get_events1.asp
There you need to retrieve the URL variable passed in the path on the Calendar page so change following:
3.1. On line 22 add “, request_Filter “ so the line look like :

Dim request_Start, request_Stop, request_Filter


3.2. Go to the end of line 25 and set a new line.
3.3. On the new line ( must be number 26) set following :

request_Filter = Request.QueryString("ParamName")


Go to line 46 where the SELECT statement is defined and change it ot:

dmxEventsRs_cmd.CommandText = "…[Truncated]… WHERE columnName [ = , != , LIKE] 's' AND DATEDIFF('s',#01-01-1970#,[start]) <= ? AND (DATEDIFF('s',#01-01-1970#,[stop]) >= ? OR ([stop] IS NULL AND DATEDIFF('s',#01-01-1970#,[start]) >= ?))"


3.4. Go to end of the line 46 and set new line ( number 47 ) and set there following (set one of the types 3 or 200 depending of what type is your variable ID – Integer – type 3 , text – String – type 200 ):

dmxEventsRs_cmd.Parameters.Append dmxEventsRs_cmd.CreateParameter("@filter", [3 - integer , 200 - string], 1, , request_Filter)


Well… save the files and upload them . Test and if any problems call back.

Replies

Replied 14 years ago
14 years ago Miroslav Zografski replied:
Hello Kenneth,

I have sent you a detailed description on your mail.

Regards,
Replied 14 years ago
14 years ago Denis Hoffmann replied:
Hey Miro,

can you please explain how that works, I need that information, too.

Cheers
Denis
Replied 13 years ago
13 years ago Rusty Monette replied:
This would be great if it was shared with the rest of the calendar users... Can you post it here for future users to use a URL to filter results?
Replied 13 years ago
13 years ago Miroslav Zografski replied:
Here some instructions:
NOTE:
Those instructions require working in CODE view mode and are for Advanced users!

1. First you need to pass the variable to the script that populates the Calendar.
You will find the script path in Scrip tag that is right after the calendar markup. Generally looking like this:


<div class="dmx_ajax_event_calendar elegant_blue" id="dmxAjaxCalendar1" style="width:700px;"></div>
<script type="text/javascript">
  // <![CDATA[
jQuery(document).ready(
   function()
     {
       jQuery("#dmxAjaxCalendar1").dmxAjaxCalendar(
{id:"dmxAjaxCalendar1", width:700, height:500, allowed_display_types:[true, true, true, true], legend_position:"bottom", display_type:3, events_type:[{number:0, name:"Australian", color:"#000099", background_color:"#FFFFFF", border_color:"#FF0000"}, {number:1, name:"Canadian", color:"#FF0000", background_color:"#FFFFFF", border_color:"#FF0000"}, {number:2, name:"China", color:"#FFFF00", background_color:"#FF0000", border_color:"#FF0000"}, {number:3, name:"German", color:"#000000", background_color:"#FF0000", border_color:"#FFFF00"}, {number:4, name:"Indian", color:"#FFFFFF", background_color:"#336600", border_color:"#FF9900"}, {number:5, name:"Russian", color:"#FFFFFF", background_color:"#0000CC", border_color:"#FF0000"}, {number:6, name:"USA", color:"#FF0000", background_color:"#FFFFFF", border_color:"#0000CC"}], google_feeds:[], ajax_feeds:[{url:"calendar_ajax/calendar_get_events1.asp"}], link_google_events:true, use_working_hours:true, working_hours_start:8, working_hours_stop:18}       );
     }
);
  // ]]>
</script>


So, you are looking for following :

ajax_feeds:[{url:"calendar_ajax/calendar_get_events1.asp"}]



2. Here you need to add your URL param like this:

 ajax_feeds:[{url:"calendar_ajax/calendar_get_events1.asp?ParamName=<%= QueryString("ParamVariable")%>"}]


Where ParamName is the name of the URL Variable that will be passed to the calendar Script and ParamVariable is the name of your current URL variable name.
3. Once this is set on your calendar page you need to open the calendar_ajax/calendar_get_events1.asp
There you need to retrieve the URL variable passed in the path on the Calendar page so change following:
3.1. On line 22 add “, request_Filter “ so the line look like :

Dim request_Start, request_Stop, request_Filter


3.2. Go to the end of line 25 and set a new line.
3.3. On the new line ( must be number 26) set following :

request_Filter = Request.QueryString("ParamName")


Go to line 46 where the SELECT statement is defined and change it ot:

dmxEventsRs_cmd.CommandText = "…[Truncated]… WHERE columnName [ = , != , LIKE] 's' AND DATEDIFF('s',#01-01-1970#,[start]) <= ? AND (DATEDIFF('s',#01-01-1970#,[stop]) >= ? OR ([stop] IS NULL AND DATEDIFF('s',#01-01-1970#,[start]) >= ?))"


3.4. Go to end of the line 46 and set new line ( number 47 ) and set there following (set one of the types 3 or 200 depending of what type is your variable ID – Integer – type 3 , text – String – type 200 ):

dmxEventsRs_cmd.Parameters.Append dmxEventsRs_cmd.CreateParameter("@filter", [3 - integer , 200 - string], 1, , request_Filter)


Well… save the files and upload them . Test and if any problems call back.

Reply to this topic