Do flanking and sneak attack apply to a creature that is flanked by other characters?

This came up in a game recently in a 3.5 game. Two of our warriors were flanking a big-bad from either side. Then the party's Rogue attacked from another side of the big bad:

$$\\begin{array}{|c|c|c|} \hline \\ \hline W & B & W \\ \hline & R & \\ \hline \end{array}\$$

Key:
B: Big Bad, W: Warriors, R: Rogue

My questions are:

1. Who gets the flanking bonuses to hit? Clearly the warriors do, but does the Rogue? the Rogue is not technically flanking with anyone, but the opponent is flanked.

2. Does the Rogue get sneak attack? If the Rogue gets the flanking bonus in the previous question, I think the answer is pretty clearly yes. But if not, does the Rogue have to be flanking to apply sneak attack, or can it be applied to a flanked enemy?

No, It does not.

FLANKING

When making a melee attack, you get a +2 flanking bonus if your opponent is threatened by a character or creature friendly to you on the opponent’s opposite border or opposite corner.

When in doubt about whether two friendly characters flank an opponent in the middle, trace an imaginary line between the two friendly characters’ centers. If the line passes through opposite borders of the opponent’s space (including corners of those borders), then the opponent is flanked.

The rogue is not in a flanking position. So does not get the bonus.

Sneak Attack

If a rogue can catch an opponent when he is unable to defend himself effectively from her attack, she can strike a vital spot for extra damage.

The rogue’s attack deals extra damage any time her target would be denied a Dexterity bonus to AC (whether the target actually has a Dexterity bonus or not), or when the rogue flanks her target.

Key words here, Her attack. The rogue does not have a flanking position bonus so does not get to sneak attack.

1. The warrior get flanking bonus to hit. The rogue does not.
2. No. The rogue does not get sneak attack.
• Quick rule of thumb: Flanking is a condition on the attackers, not the defender. Question that must be asked is, Who flanks? Not: Is X flanked? Nov 12, 2018 at 16:49

By default, no.

When making a melee attack, you get a +2 flanking bonus if your opponent is threatened by a character or creature friendly to you on the opponent’s opposite border or opposite corner.

(Flanking rules)

You only get this bonus if you are flanking with a partner on the opposite side: if two allies flank the target and you are coming from a different angle (without a partner), the target is not “threatened by a character or creature friendly to you on the opponent’s opposite border or opposite corner,” so you do not get a flanking bonus. The fact that your allies are flanking the target (and do get that bonus when they attack themselves) is not relevant at all.

The rogue’s attack deals extra damage any time [...] when the rogue flanks her target.

(Sneak attack rules)

This specifies that the rogue must be flanking the target, rather than the target merely be flanked. Note how this contrasts with the other option, “any time her target would be denied a Dexterity bonus to AC,” which only cares that the target is in that state, not how it came to be or whether the rogue caused it. The subject of the denied-Dex condition is the target itself, while the subject of the flanking condition is the rogue.

However, there are ways to work around this.

The easiest and most effective is probably island of blades, a Shadow Hand stance from Tome of Battle. While in this stance, you and your allies flank merely by both being adjacent to a target, rather than having to be on opposite sides of the target. That would allow the rogue here to be flanking, gaining its intrinsic bonus as well as enabling sneak attack. In fact, island of blades would allow the rogue to flank and sneak attack with just one of the warriors, and also lets that warrior also flank.

A rogue can pick up island of blades as early as 3rd level by taking the Martial Study feat for any Shadow Hand maneuver at 1st, and then the Martial Stance feat at 3rd to pick up island of blades. Both Martial Study and Martial Stance are feats in Tome of Battle itself. Alternatively, the swordsage base class from the same can get island of blades as a 1st-level class feature, making that an attractive multiclass option for a rogue. Having a Shadow Hand stance also enables the use of the excellent Shadow Blade feat, allowing you to use Dexterity instead of Strength to your damage with certain weapons—most rogues will appreciate that.

Other, similar effects exist; it seems beyond the scope of this question to attempt to list them all here.