All modes contain the same repeating sequence of 7 pitch classes. The only difference is where in the sequence you start.
- do-re-mi-fa-sol-la-ti-do = Ionian (major)
- re-mi-fa-sol-la-ti-do-re = Dorian
- mi-fa-sol-la-ti-do-re-mi = Phrygian
- fa-sol-la-ti-do-re-mi-fa = Lydian
- sol-la-ti-do-re-mi-fa-sol = Mixolydian
- la-ti-do-re-mi-fa-sol-la = Aeolian (natural minor)
- ti-do-re-mi-fa-sol-la-ti = Locrian
Personally, I think that the traditional names of the modes are a needless complication imposed by academic types who still buy into the silly idea that speaking in Greek makes one sound “smarter”. I prefer to just call them do-mode, re-mode, etc. Nevertheless, since that terminology seems to be “confusing” to some people, I will use the Greek names in this answer.
Now, let's assign each note a number from 0 to 11 based on the usual convention of twelve equal semitones in an octave: do=0, re=2, mi=4, fa=5, sol=7, la=9, ti=11. (That's one semitone for the mi-fa and ti-do intervals, and two semitones for the others.)
- Ionian (do) mode = 0-2-4-5-7-9-11-0
- Dorian (re) mode = 2-4-5-7-9-11-0-2
- Phrygian (mi) mode = 4-5-7-9-11-0-2-4
- Lydian (fa) mode = 5-7-9-11-0-2-4-5
- Mixolydian (sol) mode = 7-9-11-0-2-4-5-7
- Aeolian (la) mode = 9-11-0-2-4-5-7-9
- Locrian (ti) mode = 11-0-2-4-5-7-9-11
By subtracting the number assigned to the starting note or “tonic”, and adding 12 (one octave) to any number that goes negative, we can derive the notes of each scale as a sequence of semitones from the tonic.
- Ionian = 0-2-4-5-7-9-11-0
- Dorian = 0-2-3-5-7-9-10-0
- Phrygian = 0-1-3-5-7-8-10-0
- Lydian = 0-2-4-6-7-9-11-0
- Mixolydian = 0-2-4-5-7-9-10-0
- Aeolian = 0-2-3-5-7-8-10-0
- Locrian= 0-1-3-5-6-8-10-0
You may prefer to refer to notes by letters instead of numbers, though. So let's assign the number “0” to the ever-popular tonic of C. Recall that 0=C, 2=D, 4=E, 5=F, 7=G, 9=A, and 11=B. The five “black key” notes (1, 3, 6, 8, 10) will need to use sharps or flats as appropriate.
- C Ionian scale = C-D-E-F-G-A-B-C
- C Dorian scale = C-D-E♭-F-G-A-B♭-C
- C Phygian scale = C-D♭-E♭-F-G-A♭-B♭-C
- C Lydian scale = C-D-E-F♯-G-A-B-C
- C Mixolydian scale = C-D-E-F-G-A-B♭-C
- C Aeolian scale = C-D-E♭-F-G-A♭-B♭-C
- C Locrian scale = C-D♭-E♭-F-G♭-A♭-B♭-C
The mapping of numbers to letters is context-sensitive: Note 6 is “F♯” in the Lydian scale, but “G♭” in the Locrian scale. This is needed in order to satisfy the requirement that each note in a scale use a unique letter.
For instance: dorian [re-mode] has 2b (flats), and lydian [fa-mode] has 1# (sharp).
This is indeed the case for scales starting on C. As you can see from my lists of notes above: C Dorian has two flats (E♭ and B♭) and C Lydian has one sharp (F♯).
But as you suspected, this only applies if you're starting from C. Let's try starting from E instead. Then 0=E, 1=F, 3=G, 5=A, 7=B, 8=C, and 10=D, so:
- E Ionian scale = E-F♯-G♯-A-B-C♯-D♯-E
- E Dorian scale = E-F♯-G-A-B-C♯-D-E
- E Phyrgian scale = E-F-G-A-B-C-D-E
- E Lydian scale = E-F♯-G♯-A♯-B-C♯-D♯-E
- E Mixolydian scale = E-F♯-G♯-A-B-C♯-D-E
- E Aeolian scale = E-F♯-G-A-B-C-D-E
- E Locrian scale = E-F-G-A-B♭-C-D-E
E Dorian now has two sharps, and E Lydian has five sharps. If you compare the E scales to the corresponding C scales, you see that they all have exactly four more sharps or four fewer flats than the C-based counterpart.