There are some ways to prevent it, but first tell her to go to the doctor, she needs to give in a urine sample. If its cystitis, then she should get some antibiotics for it. If it doesn't help, get tested for STI's.
I got this from a website:
Preventing cystitis
1) If you make some simple changes in your daily routine, it may help to prevent some attacks of cystitis.
2) Drink at least one to two litres (three or four pints) of water every day.
Pass urine as soon as you need to, rather than trying to "hang on".6
3) Wipe from front to back after using the toilet.
4)Wipe your bottom cleanly after using the toilet to stop bacteria spreading to the urethra - consider using moist toilet paper.
5)Make sure your bladder is completely emptied.
6)Avoid perfumed soaps, vaginal deodorants, bubble baths, etc.
7)Wear cotton underwear and avoid wearing tight trousers as this can create a warm, moist, airless condition around your genitals in which bacteria may thrive.
8) Consider drinking cranberry juice or taking capsules of cranberry concentrate. But tell your GP if you plan to take cranberry supplements as they may interfere with other medications that you are taking.4,6,7
To help prevent cystitis related to sex:
1) Go and empty your bladder soon after sex.
2) Use a lubricant to reduce friction during sex.