Phase transitions in a model porous medium.