1. Alexander Gerencser
  2. General
  3. Wednesday, 26 August 2015
  4.  Subscribe via email
Dear Yves Hoppe,

In Old Matukio I Could ad this code to: administrator\components\com_matukio\helper\util_event.php

To make a event unbookable to users that allready has a booked event at the same time, +/- 15 hours from the last bookes event and max 5 events Days in a row.

Where should i put my code now in the newer versioner to make the event unbookable in "Upcoming events and the new Bootstrap/Modern Template?

  $database->setQuery("SELECT MAX(end) FROM #__matukio, #__matukio_bookings Where userid='$usrid' And #__matukio.id = semid");

$tempo = $database->loadResult();

$date1 = strtotime($tempo);
$date2 = strtotime($row->begin);

$hdiff = floor(($date2-$date1)/3600);
$database->setQuery("SELECT MAX(begin) FROM #__matukio, #__matukio_bookings Where userid='$usrid' And #__matukio.id = semid");

$tempo1 = $database->loadResult();

$date3 = strtotime($tempo1);
$date4 = strtotime($row->end);

$hdiff1 = floor(($date3-$date4)/3600);


if ($hdiff < '15' And $hdiff > '-15' OR $hdiff1 < '15' And$hdiff1 > '-15') {
$buchbar = 1;
$buchgraf = 0;
$altbild = "Unbookable - EU's Working Time Directive, 2003/88/EC";
}

$database->setQuery("SELECT begin FROM #__matukio, #__matukio_bookings Where userid='$usrid' And #__matukio.id = semid ORDER BY semid DESC LIMIT 6");
$eresult = $database->loadAssocList();

$edate1=strtotime($row->begin);
$edate2=strtotime($eresult['0']['begin']);
$edate3=strtotime($eresult['1']['begin']);
$edate4=strtotime($eresult['2']['begin']);
$edate5=strtotime($eresult['3']['begin']);
$edate6=strtotime($eresult['4']['begin']);
$edate7=strtotime($eresult['5']['begin']);


if (floor(($edate1-$edate2)/86400) < '2' AND floor(($edate1-$edate2)/86400) > '-2' AND floor(($edate2-$edate3)/86400) < '2' AND floor(($edate2-$edate3)/86400) > '-2' AND floor(($edate3-$edate4)/86400) < '2' AND floor(($edate3-$edate4)/86400) > '-2' AND floor(($edate4-$edate5)/86400) < '2' AND floor(($edate4-$edate5)/86400) > '-2' AND floor(($edate5-$edate6)/86400) < '2' AND floor(($edate5-$edate6)/86400) > '-2' AND floor(($edate6-$edate7)/86400) < '2' AND floor(($edate6-$edate7)/86400) > '-2') {
$buchbar = 1;
$buchgraf = 0;
$altbild = "Unbookable - EU's Working Time Directive, 2003/88/EC";
}


Best Regard
Alex
Responses (1)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Hotspots Pro 6.0.13 compatability with Joomla 5.3.
Running Hotspots Pro 6.0.13 on Joomla 4.4.13 and want to upgrade to Joomla 5.3.1...
2 Replies
Posted on Friday, 04 July 2025
some questions on Hotspots
Hi, On Hotspots extension : 1) is it possible to add our own map layer / v...
0 Replies
Posted on Thursday, 03 July 2025
Trying to resize the image in the comments
Hey everyone, Basically I am trying to make the images in the comments smalle...
9 Replies
Posted on Wednesday, 12 August 2009
J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
2 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
error message when adding/cofiguring email address
When configuring the email plugin that send a email message to admin when a new ...
0 Replies
Posted on Friday, 09 May 2025