Last updated

Found a bug?
Let me know so I can sort it out

Last updated

Postby badi3 » Wed May 12, 2010 7:32 pm

Hi Chris, thanks for this calender! one little thing that I can't get the last updated date not working:
on the index.php file it must be this line of code

'.$lang["last_update"].': '.get_cal_update_date(ID_ITEM).'

have a look at the calender please

http://www.giteenfrance.com/disponibilite.html

best regards
badi3
 
Posts: 6
Joined: Wed May 12, 2010 7:18 pm

Re: Last updated

Postby chris » Wed May 12, 2010 7:41 pm

Hi,
Hmmm, interesting.
Without actually being able to "get at" the code it is hard to know what is going wrong.

The first thing to check would be the database to see if the date is being saved.
Can you take a look at "bookings_last_update" table and see if the date has been saved?

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

Re: Last updated

Postby badi3 » Wed May 12, 2010 9:59 pm

Hi Chris, thanks for the reply. I think the table is ok, see screen dump

http://www.giteenfrance.com/db.gif

ragards
badi3
 
Posts: 6
Joined: Wed May 12, 2010 7:18 pm

Re: Last updated

Postby badi3 » Wed May 12, 2010 10:08 pm

INSERT INTO `bookings_items` VALUES (3, 1, 0, 'Sous le Tilleul', 'Sous le Tilleul', 3, 1, 'Sous le Tilleul', 'Sous le Tilleul');

-- --------------------------------------------------------

--
-- Structure de la table `bookings_last_update`
--

CREATE TABLE `bookings_last_update` (
`id` int(10) NOT NULL auto_increment,
`id_item` int(10) NOT NULL default '0',
`date_mod` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `id_item` (`id_item`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

--
-- Contenu de la table `bookings_last_update`
--

INSERT INTO `bookings_last_update` VALUES (1, 3, '2010-05-12 21:49:30');
badi3
 
Posts: 6
Joined: Wed May 12, 2010 7:18 pm

Re: Last updated

Postby chris » Wed May 12, 2010 10:21 pm

Hmm, as you say, the date is being saved to the db table.
(I have edited your last post to just show the relevant data)

In the file: "ac-includes" > "functions.inc.php" can you find the get_cal_update_date() function:
Code: Select all
function get_cal_update_date($id_item){
   if(CAL_DATE_DISPLAY_FORMAT=="us")   $date_format   = "%m-%d-%Y";
   else                         $date_format   = "%d-%m-%Y";
   
   $sql="SELECT DATE_FORMAT(date_mod, '".$date_format."') as date_mod FROM `".T_BOOKING_UPDATE."` WHERE id=".$id_item."";
   $res=mysql_query($sql) or die("error getting last calendar update date");
   $row=mysql_fetch_assoc($res);
   return $row["date_mod"];
}

and temporarily replace it with this:
Code: Select all
function get_cal_update_date($id_item){
   if(CAL_DATE_DISPLAY_FORMAT=="us")   $date_format   = "%m-%d-%Y";
   else                         $date_format   = "%d-%m-%Y";
   
   $sql="SELECT DATE_FORMAT(date_mod, '".$date_format."') as date_mod FROM `".T_BOOKING_UPDATE."` WHERE id=".$id_item."";
   $res=mysql_query($sql) or die("error getting last calendar update date");
   $row=mysql_fetch_assoc($res);
echo $sql;
echo "<br>";
print_R($row);   
return $row["date_mod"];
}

Once you have done that, reload the calendar and let me know what you get.

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

Re: Last updated

Postby chris » Wed May 12, 2010 10:23 pm

Also, if you want me to, you could send me your ftp details (via email or pm) and I will have a play around with it myself.

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

Re: Last updated

Postby chris » Wed May 12, 2010 10:41 pm

Sorted.

Note - this fix is only for versions prior to version 3.03.03.


There is (was in your case as I have fixed it) an error in this function that meant that the code is looking for the date by the row "id" rather than the "id_item".

In the aforementioned function this line:
Code: Select all
$sql="SELECT DATE_FORMAT(date_mod, '".$date_format."') as date_mod FROM `".T_BOOKING_UPDATE."` WHERE id=".$id_item."";

Should be this:
Code: Select all
$sql="SELECT DATE_FORMAT(date_mod, '".$date_format."') as date_mod FROM `".T_BOOKING_UPDATE."` WHERE id_item=".$id_item."";


I will fix this in the next release (or in the current one when I get a second)

Thanks for spotting that one :)

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

Re: Last updated

Postby badi3 » Wed May 12, 2010 10:45 pm

Allways nice to be of help :D . Thanks a lot and if you ever in France! You deserved a night in our gite! Best regards and keep up this excelent service!
badi3
 
Posts: 6
Joined: Wed May 12, 2010 7:18 pm

Re: Last updated

Postby chris » Wed May 12, 2010 11:21 pm

Code: Select all
Thanks a lot and if you ever in France! You deserved a night in our gite!

I must admit that it looks very nice.
I was trying to work out where it actually is but can't seem to find that information on the website :(
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Last updated

Postby badi3 » Thu May 13, 2010 5:16 pm

Hi Chris, Good point! Special for you and all others who what want to find us I've added a map

http://www.giteenfrance.com/contact.html

thanks again,

dirk
badi3
 
Posts: 6
Joined: Wed May 12, 2010 7:18 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests

cron