BxDolProfile::getID PHP Method

getID() public method

public getID ( $vID = false, $bWithEmail = 1 )
    function getID($vID = false, $bWithEmail = 1)
    {
        if (false === $vID) {
            return $this->_iProfileID;
        }
        $oPDb = new BxDolProfileQuery();
        if ($bWithEmail) {
            if (filter_var($vID, FILTER_VALIDATE_EMAIL)) {
                //eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}$", $vID) ) {
                $aMail = $oPDb->getIdByEmail($vID);
                if ((int) $aMail['ID']) {
                    return (int) $aMail['ID'];
                }
            }
        }
        $iID = (int) $vID;
        if (strcmp("{$vID}", "{$iID}") === 0) {
            return $iID;
        } else {
            $aNick = $oPDb->getIdByNickname($vID);
            if ((int) $aNick['ID']) {
                return (int) $aNick['ID'];
            }
        }
        return false;
    }

Usage Example

コード例 #1
0
ファイル: callback.php プロジェクト: noormcs/studoro
function onUnflag($iTopicId, $sUser)
{
    $oProfile = new BxDolProfile($sUser);
    forumAlert('unflag', $iTopicId, $oProfile->getID());
}