#Ranged attackers don't affect or gain bonuses from flanking.
The flanking rules state:
When making a melee attack, you get a +2 flanking bonus if your opponent is threatened by another enemy character or creature on its opposite border or opposite corner.
And also:
Only a creature or character that threatens the defender can help an attacker get a flanking bonus.
Emphasis mine. So, you have to be making a melee attack and your enemy has to be threatened by one of your allies in order to gain a flanking bonus. The rules on Threatened Squares state:
You threaten all squares into which you can make a melee attack, even when it is not your turn.
Emphasis mine. Thus, you don't threaten the squares that you can target with a ranged attack, and thus can't help someone give a flanking bonus.
There is no place in the flanking rules that talks about a difference between "flanking" and "gaining a flanking bonus". You gain a flanking bonus when you are flanking, and you are flanking when you gain a flanking bonus; the two phrases refer to the same state.
The only exception to the rule that you can't flank with a ranged weapon is the case where you threaten squares with a ranged weapon, like if you have Improved Snap Shot. If you have such a feat, then you can help someone else flank, but since you aren't using a melee weapon, you cannot flank someone yourself.