The short answer is: The first code takes the attributes title, image, intro and body (from the data_map) of a node, and displays them with attribute_view_gui
The second code fetches a number of nodes, and displays them with node_view_gui in lineview.
To combine these you probably want to create an override for the lineview of your class.
This is described in the "Building an eZ publish site" tutorial: http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_news_page/overview_of_the_latest_news