Displaying all items in base

Help with installation and general calendar setttings

Displaying all items in base

Postby denis88 » Thu Jul 29, 2010 11:35 am

First of all great script! ;)

Now... I have a problem (perhaps really simple one) which is really troubling me. I would like to take all items which are inserted into base and draw calendars for them and display them on one page, something like that (let's say we have 3 items in database):

Item1
****CALENDAR****

Item2
*****CALENDAR****

Item3
****CALENDAR****

I have managed to get how many items are inserted (using sql MAX) and then I used for ($i=1; $i <= $max; $i++) and I get 3 calendars but all of them are for one item. I deleted in cal.inc (I think) function which gives default item and tried to define item with $i, so that with each loop item id should be increasing... But it doesn't :)

Does anyone know how to solve this? :roll:

Best regards, Denis
denis88
 
Posts: 3
Joined: Tue Nov 25, 2008 3:21 pm

Re: Displaying all items in base

Postby chris » Thu Jul 29, 2010 11:53 am

Hi,
I'm not exactly sure as to what you are trying to do, but you need to bear in mind that the calendad (original code) uses a php constant ID_ITEM to identify the calendar dates to show etc.
So you will need to modify how this works so that it can accept a variable (eg $id_item).
Secondly you will need to alter the JavaScript code as it is that which actually calls the ajax file to draw the calendar. If you want to show more than one calendar (differeing items) on the same page you will need to adjust the JavaScript code too.

Of course you could just use 3 iframes..... ;)

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

Re: Displaying all items in base

Postby denis88 » Thu Jul 29, 2010 12:05 pm

Hi, tnx for reply.

Yes I am trying to display multiple items on one page. I noticed that constraint ITEM_ID and I was trying to save id and send it as a variable, but I didn't looked really hard at any js file yet... I thought that solution will be something like that but I was just wondering if there is any easier way to solve this ;)

Hmm... I could use iframes but there won't be always only 3 items... Must get them all (that's why I used sql max) and show them on one page. Perhaps I could try to make that with each item you add a file is created with number (calendar display code) and than loop which would display all of those files in one page (php include)...

Thanks for your help!
denis88
 
Posts: 3
Joined: Tue Nov 25, 2008 3:21 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron