[hack] show all items in single calendar

Help with installation and general calendar setttings

Re: [hack] show all items in single calendar

Postby chris » Mon Jun 20, 2011 10:25 pm

hmm, so have you modified the calendar file so that it uses this new function
Code: Select all
draw_mycal()
as opposed to the original draw_cal() function?

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

Re: [hack] show all items in single calendar

Postby calnewb » Mon Jun 20, 2011 10:35 pm

Referring to calendar.ajax.php? I copied the info the OP posted for this file, but maybe I have this incorrect as well?

Code: Select all
<?php
/***********************************************/
/*
File:         calendar.ajax.php
Author:       cbolson.com
Script:       availability calendar
Version:      3.02
Url:          http://www.ajaxavailabilitycalendar.com
Date Created:    2009-07-29   
Date Modified:    2010-01-30

Use:         Called via ajax to draw calendar

Receives:      $_REQUEST["id_item"]    - id of the item
            $_REQUEST["month"]      - calendar month
            $_REQUEST["year"]      - calendar year
*/
/***********************************************/

// include common file for ajax settings
$the_file=dirname(__FILE__)."/ajax-common.inc.php";
if(!file_exists($the_file)) die("<b>".$the_file."</b> not found");
else      require_once($the_file);

//   define variables
$id_item   = $_REQUEST["id_item"];
$the_month   = $_REQUEST["month"];
$the_year   = $_REQUEST["year"];

//   required data
if($id_item=="")    die("no item defined");
if($the_month=="")    die("no month defined");
if($the_year=="")    die("no year defined");

// create the calendar
if ($id_item ==0 )
  echo draw_mycal($id_item,$the_month,$the_year);
else
  echo draw_cal($id_item,$the_month,$the_year);
?>
calnewb
 
Posts: 4
Joined: Mon Jun 20, 2011 8:48 pm

Re: [hack] show all items in single calendar

Postby chris » Mon Jun 20, 2011 11:01 pm

OK, thinking about it, the fact that your calendar is showing two items must mean that you have that function and that it is being called properly. Sorry for wasting your time on that.

So, the problem appears to be that it isn`t getting the full number of days in the month correctly......

ah.... do you by any chance have your start date set to Sunday in the config panel?

On closer inspection of Sypriano's code it hasn't been adapted to show the full month if it is set to start on a Sunday.
Take a look at this snippet in the new draw_mycal() function:
Code: Select all
if(AC_START_DAY=="sun"){
      //$cal_row_counter=0;
     
      for($k=0; $k<7; $k++){
         $weekday = substr($lang["day_".$k.""],0,1);
         $list_day_titles.='<li class="cal_weekday"> '.$weekday.'</li>';
      }
   }else{

This part:
Code: Select all
for($k=0; $k<7; $k++){
should probably be something like this:
Code: Select all
for($k=0; $k<$days_in_this_month; $k++){


Check your start date and, if it is set to Sunday, either change it to Monday or make that change .

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

Re: [hack] show all items in single calendar

Postby calnewb » Mon Jun 20, 2011 11:10 pm

Yes, Sunday was what I was using for the start of the week. So it does work now!

Thank you so much Chris!
calnewb
 
Posts: 4
Joined: Mon Jun 20, 2011 8:48 pm

Re: [hack] show all items in single calendar

Postby alter_mann » Wed Jul 27, 2011 4:14 pm

Hi Chris

First of all let congratulate you for an excellent app you have here... I'm using the calendar has part of my degree finishing project....

I'm new at PHP, JS and ajax, but well... Google teaches :)

But now I cant solve one thing... I'd like to use this function to display the all the items in a single calendar and I cant manage to get it working... My understanding of the code is medium, but I cant get this thing working...

I wonder if you give me a little help...

I'l send you the link via PM.

Thanks in advance for time and you can be pretty sure I'll donate in the end of the work...
alter_mann
 
Posts: 7
Joined: Mon Jul 25, 2011 5:53 pm

Re: [hack] show all items in single calendar

Postby chris » Wed Jul 27, 2011 5:21 pm

Hi,
The link that you sent me in the PM is not working.

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

Re: [hack] show all items in single calendar

Postby chris » Wed Jul 27, 2011 5:26 pm

Take that back, it is working now.
However as far as I can tell it is just the default calendar installation. I can't see any sign of it having been modified.

What is it that you are stuck on?

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

Re: [hack] show all items in single calendar

Postby alter_mann » Wed Jul 27, 2011 5:34 pm

chris wrote:Take that back, it is working now.
However as far as I can tell it is just the default calendar installation. I can't see any sign of it having been modified.

What is it that you are stuck on?

Chris


its exactly that I'm stuck on... I can't manage to get the calendar working this way

Image


If I understand the Cypriano's code correctly he creates a new way of drawing the calendar (called mycal ), and when the item is fixed to 0 it should choose mycall. right?
alter_mann
 
Posts: 7
Joined: Mon Jul 25, 2011 5:53 pm

Re: [hack] show all items in single calendar

Postby chris » Wed Jul 27, 2011 6:26 pm

f I understand the Cypriano's code correctly he creates a new way of drawing the calendar (called mycal ), and when the item is fixed to 0 it should choose mycall. right?

Yes, that is basically what it does. I have not tried implementing Cyprian's code myself so don't know how well it works.
However, as I say, from the link that you sent me it doesn't look like you have done anything.
Where is your modified version so that maybe I can spot the problem?

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

Re: [hack] show all items in single calendar

Postby alter_mann » Wed Jul 27, 2011 6:52 pm

pm sent with the link
alter_mann
 
Posts: 7
Joined: Mon Jul 25, 2011 5:53 pm

PreviousNext

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron