passing id_item to the calendar, not in the addressbar.

Help with installation and general calendar setttings

passing id_item to the calendar, not in the addressbar.

Postby BobbyWright » Wed Jul 21, 2010 3:47 pm

Hello,
I have four properties that I have on the same calendar install.
I have a seprate page for each property and with to only show the calendar for that property.
I could pass id_item in the address bar but I would like to keep the address clean.

Is there away to pass id_item to the page without using the address bar and without a large re-write?

I tried this, but it does'nt work
<?php
$_REQUEST["id_item"]=2;
include('../Calendar/index.php');
?>

thank you.
BobbyWright
 
Posts: 2
Joined: Wed Jul 21, 2010 3:38 pm

Re: passing id_item to the calendar, not in the addressbar.

Postby chris » Wed Jul 21, 2010 4:16 pm

Hi,
$_REQUEST["id_item"]=2;
include('../Calendar/index.php');

That *should* work and indeed does on my test version.

Any chance you could send me an url (via pm if you prefer) for me to take a look?

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: passing id_item to the calendar, not in the addressbar.

Postby BobbyWright » Fri Jul 23, 2010 2:36 pm

Hello,

Thank you for your quick responce.
If I call this:-
<?php
$_REQUEST["id_item"]=2;
$id_item=2;
$_POST["id_item"]=2;
$_GET["id_item"]=2;
$row["id"]=2;
include('../Calendar/index.php');
?>

then the the corect name is selected in the drop down menu in form in the <div id="cal_admin">
but the callender displayed if for id_item=1

my testing site is:-
http://ralleyho.doughball.net/en/

a page with the Calendar is
http://ralleyho.doughball.net/en/GrangeCambasque.php
The id_item calendar that I want to put on this page is 2

if you put in the address
http://ralleyho.doughball.net/en/Grange ... ?id_item=2
Then the calendar is set to the correct one, I put in test dates so you can see a change.


I think I need to pass a value to the line:
$row=mysql_fetch_assoc($res);
define("ID_ITEM", $row["id"]);
in the file /calendar/ac-includes/cal.inc.php
If I change $row['id'] to 2 then the correct calendar is displayed.
This, unfortunatly, this is where my knowlage of php stops, it is a new language to me.

thank you for your help, it is much appreciated.
Bobby.
BobbyWright
 
Posts: 2
Joined: Wed Jul 21, 2010 3:38 pm

Re: passing id_item to the calendar, not in the addressbar.

Postby chris » Fri Jul 23, 2010 3:03 pm

One thing that you need to make sure is that you define the id_item "before" the javascript is defined as the actual calendar months are called via the javascript file.

So, the $_REQUEST["id_item"]=2; should be towards the top of the page and definately before any javascript.
This would explain why it works when you pass it in the url but not when you define it on the page.

Let me know if you how this goes ;)

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron