Ok. Figured it out on my own.
In case anyone else wants to know how to do it, go into the BxDolTwigModuleDB.php and:
Change: (currently at line 273)
function joinEntry($iEntryId, $iProfileId, $isConfirmed)
{
$isConfirmed = $isConfirmed ? 1 : 0;
$iRet = $this->query ("INSERT IGNORE INTO `" . $this->_sPrefix . $this->_sTableFans . "` SET `id_entry` = '$iEntryId', `id_profile` = '$iProfileId', `confirmed` = '$isConfirmed', `when` = '" . time() . "'");
if ($iRet && $isConfirmed)
$this->query ("UPDATE `" . $this->_sPrefix . "main` SET `" . $this->_sFieldFansCount . "` = `" . $this->_sFieldFansCount . "` + 1 WHERE `id` = '$iEntryId'");
return $iRet;
}
To:
function joinEntry($iEntryId, $iProfileId, $isConfirmed)
{
$isPeopleCount = $this->getOne ("SELECT `Sex` FROM `Profiles` WHERE `ID` = '$iProfileId' LIMIT 1");
switch ($isPeopleCount) {
case "Female":
$isPCount = 1;
break;
case "Male":
$isPCount = 1;
break;
case "Couple":
$isPCount = 2;
break;
}
$isConfirmed = $isConfirmed ? 1 : 0;
$iRet = $this->query ("INSERT IGNORE INTO `" . $this->_sPrefix . $this->_sTableFans . "` SET `id_entry` = '$iEntryId', `id_profile` = '$iProfileId', `confirmed` = '$isConfirmed', `when` = '" . time() . "'");
if ($iRet && $isConfirmed)
$this->query ("UPDATE `" . $this->_sPrefix . "main` SET `" . $this->_sFieldFansCount . "` = `" . $this->_sFieldFansCount . "` + $isPCount WHERE `id` = '$iEntryId'");
return $iRet;
}
Then Change:
function leaveEntry ($iEntryId, $iProfileId)
{
$isConfirmed = $this->getOne ("SELECT `confirmed` FROM `" . $this->_sPrefix . $this->_sTableFans . "` WHERE `id_entry` = '$iEntryId' AND `id_profile` = '$iProfileId' LIMIT 1");
$iRet = $this->query ("DELETE FROM `" . $this->_sPrefix . $this->_sTableFans . "` WHERE `id_entry` = '$iEntryId' AND `id_profile` = '$iProfileId'");
if ($iRet && $isConfirmed)
$this->query ("UPDATE `" . $this->_sPrefix . "main` SET `" . $this->_sFieldFansCount . "` = `" . $this->_sFieldFansCount . "` - 1 WHERE `id` = '$iEntryId'");
return $iRet;
}
To:
function leaveEntry ($iEntryId, $iProfileId)
{
$isPeopleCount = $this->getOne ("SELECT `Sex` FROM `Profiles` WHERE `ID` = '$iProfileId' LIMIT 1");
switch ($isPeopleCount) {
case "Female":
$isPCount = 1;
break;
case "Male":
$isPCount = 1;
break;
case "Couple":
$isPCount = 2;
break;
}
$isConfirmed = $this->getOne ("SELECT `confirmed` FROM `" . $this->_sPrefix . $this->_sTableFans . "` WHERE `id_entry` = '$iEntryId' AND `id_profile` = '$iProfileId' LIMIT 1");
$iRet = $this->query ("DELETE FROM `" . $this->_sPrefix . $this->_sTableFans . "` WHERE `id_entry` = '$iEntryId' AND `id_profile` = '$iProfileId'");
if ($iRet && $isConfirmed)
$this->query ("UPDATE `" . $this->_sPrefix . "main` SET `" . $this->_sFieldFansCount . "` = `" . $this->_sFieldFansCount . "` - $isPCount WHERE `id` = '$iEntryId'");
return $iRet;
}
Works perfectly.