Change FansCount (in Events) by 2 for Couples

Hello, strange question perhaps... But I would like the "FansCount" in the Events to increment +/- by two for members that are couples. How would I do that? I've looked through a lot of the code and can't find it.

 

Any help will be greatly appreciated.

 

~Sean

Quote · 18 Oct 2016

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.
Quote · 18 Oct 2016
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.