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

Dowload all Hotspots entries
Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
0 Replies
Posted on Sunday, 06 April 2025
  • #kml
  • #download
Set number of hotspots / user groups
Hi, I'm working with Hotspots for my new website and I love it! After trying ...
0 Replies
Posted on Monday, 31 March 2025
J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
1 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
Text size in the comment input form
Hello. How can I increase the font size in the comment input field? For examp...
0 Replies
Posted on Wednesday, 26 February 2025
  • #CComment 6
Problem with enlarged image
Hello. When you click on the image in the comments, it does not appear in the ce...
1 Replies
Posted on Wednesday, 26 February 2025