4 columns

4 columns

Postby rick » Sun Jan 31, 2010 2:38 pm

Hi all,

I'm playing around with vers.2 and I like it very much so far. I made, with the help of this forum, an admin page and 3 different calendars for 3 different flats for rent. Now I want instead of three columns, (January, February, March) a 4 columns layout (Jan, Feb, March, April), but I didn't found a solution. Maybe somebody ca help me to found one.
Greetings and many thanks in advance, and Chris many thanks for this great scripts.
rick
rick
 
Posts: 3
Joined: Sat Jan 30, 2010 9:39 am

Re: 4 columns

Postby chris » Sun Jan 31, 2010 2:49 pm

Hi there,
Thanks for the comments and I am glad that you like the code :)

To show 4 columns you need to find this snippet of code (in the file that actually displays the calendar):

Code: Select all
foreach($the_months as $key=>$val){
   $cal_months.='<td valign="top" align="center">'.draw_cal(ID_ITEM,$val["month"], $val["year"], $booked_days,1).'</td>';
   if (($j % 3) == 0)$cal_months.="</tr><tr>";
   ++$j;
}

and change the "3" to a 4" like this:
Code: Select all
foreach($the_months as $key=>$val){
   $cal_months.='<td valign="top" align="center">'.draw_cal(ID_ITEM,$val["month"], $val["year"], $booked_days,1).'</td>';
   if (($j % 4) == 0)$cal_months.="</tr><tr>";
   ++$j;
}

That should be all you need to do.

Let me know how it goes,

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

Re: 4 columns

Postby rick » Sun Jan 31, 2010 3:18 pm

Hi Chris,

:D :D :D :D

Many thanks for your fast response!

I changed it and it works great. So far I can not show you my website, it's still offline on a local
account, working with the local server of MAMP. As soon I will have the website online I will put it in
"script on use"
Many thanks again for your great and fast help.
have a nice Sunday. Greetings
rick
rick
 
Posts: 3
Joined: Sat Jan 30, 2010 9:39 am


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron