Behavior of liquid crystals and fluids in porous media