Many thread especially in gambling board are having their own referral links in the first post, yet the moderators didn't delete the thread. They also didn't mention if their thread contain referral links too.
Many posts have been deleted due to referral links. I don't know about gambling, maybe that's one of the reasons why many members consider the gambling section on the forum to be a spam fest.
Approving referral links in posts could drag the forum in a completely different direction.
Read this.
However, if you are using the forum as a publishing platform to host something really substantial and useful, selling ads in that substantial work is allowed. To be eligible for this, your post must be in a topic that you started, and your post must be substantial and long enough to make the ad seem entirely insignificant. If in doubt, ask me.
Ads and referral links are not the same thing.
I've seen similar situations before, but it was emphasized that it was a referral link, and right next to it there was an option without ref. code.