Added database script for view view_posts (not completed yet)