Designing the functional building blocks for syntheses of organic and organic-inorganic hybrid porous materials