Bilder das vorigen und nächsten Beitrags im Custom Pager einblenden

Kombination der Module ›Image‹ und ›Custom Pagers‹

Bilder das vorigen und nächsten Beitrags

[image:476 align=right size=medium]
template.php
:
 function prevnext_nav($nid) {
   $result = db_query("SELECT i.image_size, f.filepath FROM {image} i INNER JOIN {files} f ON i.fid = f.fid WHERE i.nid = %d", $nid);
   $images = array();
   while ($file = db_fetch_object($result)) {
     $images[$file->image_size] = file_create_path($file->filepath);
  }
 return '<img src="/'. $images['thumbnail'].'">';
}
custom-pager.tpl.php
:
<ul class="custom-pager custom-pager-<?php print $position; ?>">
<div id="icon-pager">
  <li class="previous">
  <?php 
  print '<div class="prev-icon" >'. l(prevnext_nav($nav_array['prev']), 'node/'. $nav_array['prev'], $options = array('html' => TRUE)) .'</div>'; 
  print $previous; ?>
  </li>
  <li class="key"><?php print $key; ?></li>
  <li class="next"><?php 
  print '<div class="next-icon" >'. l(prevnext_nav($nav_array['next']), 'node/'. $nav_array['next'], $options = array('html' => TRUE)) .'</div>'; 
  print $next; ?></li>
</ul>
</div>