CRYING FOUL: ESPN was embarrassed by Post reports about the affair between its production assistant Brooke Hundley (above) and baseball analyst Steve Phillips.CBS

Steve Phillips (AP)

(
)

For years, ESPN operated like a lawless frat house, with more sexual shenanigans than a roadside brothel.

A married executive was sleeping with a senior vice president. A female manager told an assistant that men acting like pigs was routine at the network.

Only after baseball analyst Steve Phillips’ salacious affair with an assistant was exposed by The Post, embarrassing the network, did the cable giant begin a serious crackdown on sexual harassment, according to a new report.

The affair “taught the company it had to have a no-tolerance approach, which they hadn’t really had before,” an insider told the sports-news Web site Deadspin.

“People are much more careful. People were scared straight because the administration said that employees had to disclose personal relationships with each other, as a result of the Phillips thing.”

The so-called “Worldwide Leader in Sports” was already known in circles for its skirt-chasing culture when Phillips — the former general manager of the Mets — invited a young, $10-an-hour production assistant to his hotel room after an All-Star Game event in St. Louis.

Brooke Hundley accepted the invitation, but not before checking in with her boss, production coordinator Joya Caskey, and telling her about Phillips’ proposition.

“Get used to it, kid,” Caskey said, according to Deadspin, quoting court papers.

“If I had a dollar for every time I was sexually harassed at ESPN, I would be a millionaire.”

Confidential human-resources notes gave a slightly different account.

“This is television,” Caskey said, according to an HR transcript.

“That’s what happens. It goes with the industry.”

So, too, does media scrutiny.

While executives were working behind the scenes to put out the fire of what would become an inferno of a scandal, The Post was hammering away at the workplace culture exposing the seedy shenanigans.

The Post broke the Phillips story with a number of front-page exclusives, exposing how Hundley ratted out the philanderer to his wife after he made her the subject of office gossip.

“You see I’m the woman he’s been seeing for awhile now, and I’m not just some random girl he had sex with in parking lots,” Hundley said in a letter to Phillips’ wife, Marni.

“I’m actually a close friend who works with him on a frequent basis.”

The Post reports followed a series of stories about how a creep videotaped ESPN reporter Erin Andrews through a hotel-room peephole.

ESPN execs tried to punish The Post for its coverage by banning all of the newspaper’s reporters from appearing on any of its programs.

The ban lasted not much longer than an ESPN “SportsCenter” update — with one exec firing out an e-mail regretting getting The Post “riled up,” according to Deadspin.

Phillips’ sordid affair began when, after a drink at a St. Louis bar and a quick kiss, he invited Hundley to his hotel room, according to a court deposition from her suit against the network.

“You should come upstairs with me,” Phillips said, as Hundley would later recall. “I got a suite.”

After talking with her boss, Caskey, Hundley called Phillips and went to his hotel, where Hundley and the married Phillips got naked. Phillips masturbated, and launched into a conversation about how they could help each other out, the deposition said.

“He just kind of . . . laid down next to me and just kind of pinned his arm on top of mine while he talked to me,” Hundley said in the deposition.

“He talked to me about how—you know, not to worry. It would have been OK if we had had sex, because he had a vasectomy. Told me about how it was it OK, because how everybody at ESPN does this kind of thing.”

Hundley said Phillips told her, “I will put in a good word for you” with her bosses.

Later, though, she would change her story, telling the human-resources department that Phillips sexually assaulted her.

“I told him I would come to his room to talk, after hearing his sob story about his failing marriage and miserable life, but just to talk,” Hundley said, according to Deadspin.

“When I got there, he immediately came after me physically. I told him to stop several times, reminded him that that was not why I was there and if he didn’t want to talk I should go.

“I attempted to leave, but he blocked the door, and then proceeded to push me up against it and put his hands up inside me. I asked him to stop but he continued and eventually I just stopped resisting.”

Whichever version happened, the encounter was nevertheless followed up by a couple of parking-lot trysts and raunchy e-mails.

On July 31, Hundley agreed to meet Phillips in a Target parking lot near ESPN’s Bristol, Conn., headquarters.