recent content block with thumbnail? I want to theme the Recent Content block with associated thumbnail of each node. After researching for a long time I found the function node_get_recent(). This function selects data from table 'node', but this table doesn't include any url pointing to the url of an image, which means I am not be able to use $node->(url of this thumbnail) to fetch its thumbnail. I happend to find the url of the thumbnail is located in the table 'file_managed', but I still cannot associated it with table 'node' through leftjoin. 

I do not know how to do it the right way. I do not want to use Views. Thanks!



When I put the following code into my .module file the title displayed for each node is the same.

function example_contents() {
  $number_of_post = 10;
  $result = db_query("select n.title,n.nid,f.entity_id,fm.fid,fm.uri from {node} n left join {field_data_field_image} f on n.nid=f.entity_id left join {file_managed} fm on f.field_image_fid=fm.fid   limit $number_of_post");
  $items = array();
  foreach ($result as $node) {
    $items[] = l($node -&gt; title,'node/'.$node -&gt; nid);
  }
  return array('#markup' =&gt; theme('item_list', array('items' =&gt; $items)));
}


$node -&gt; title turned out to be same, however $node -&gt; nid worked. That is to say the list of nodes used the same title but different urls. What was wrong with my code? Secondly, I do not know where to put my $node -&gt; uri into $items[] in order to display the thumbnail.
to slecet image uri you have to do

selest uri from node
join field_data_filed_image on field_data_filed_image.entity_id = node.nid
join file_managed on filed_image_fid = fid


anfd you can use this function to get thumbnail using uri

&lt;img class="image" src="&lt;?php print image_style_url('thumbnail', $block-&gt;uri) ?&gt;"/&gt;