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

Anzeige von mehrtägigen Events auf Buchungsseite
We have been using Matukio for quite some time now. Unfortunately, we have been ...
5 Replies
Posted on Sunday, 03 August 2025
  • Resolved
  • Is Ccomment still alive?
    Is Ccomment still being supported? It's time for my Pro renewal but I haven't se...
    2 Replies
    Posted on Thursday, 14 August 2025
  • Resolved
  • Assistance Needed – Error When Posting Comments
    Hello, I’m experiencing an issue when trying to submit a comment on my site u...
    0 Replies
    Posted on Sunday, 10 August 2025
    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