Index: modules/image/image.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/image/image.css,v retrieving revision 1.1 diff -u -F^f -r1.1 image.css --- modules/image/image.css 24 Mar 2005 05:05:25 -0000 1.1 +++ modules/image/image.css 3 Apr 2005 13:35:17 -0000 @@ -37,4 +37,32 @@ margin : 1em; width : 30%; height : 200px; +} + +.image_view .nav { + border-top: 1px solid #888; + border-bottom: 1px solid #888; + padding-bottom: 3em; + padding-top: 1em; + clear: both; +} + +.image_view .nav .links { + clear: both; +} + +.image_view .nav .titles { + clear: both; +} + +.image_view .nav .prev { + float: left; + text-align: left; + width: 45%; +} + +.image_view .nav .next { + float: right; + text-align: right; + width: 45%; } \ No newline at end of file Index: modules/image/image.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v retrieving revision 1.142 diff -u -F^f -r1.142 image.module --- modules/image/image.module 1 Apr 2005 07:54:43 -0000 1.142 +++ modules/image/image.module 3 Apr 2005 13:35:21 -0000 @@ -278,8 +278,10 @@ function image_view(&$node, $main = 0, $ } $request = ($_GET['size']) ? $_GET['size'] : 'preview'; $node = node_prepare($node, $main); + $prev = db_fetch_object(db_query_range(db_rewrite_sql('SELECT n.nid, n.title FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid = %d AND (n.sticky < %d OR (n.sticky = %d AND (n.created < %d OR (n.created = %d AND n.nid < %d)))) AND n.nid != %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC, n.nid DESC'), $p->tid, $node->sticky, $node->sticky, $node->created, $node->created, $node->nid, $node->nid, 0, 1)); +$next = db_fetch_object(db_query_range(db_rewrite_sql('SELECT n.nid, n.title FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid = %d AND (n.sticky > %d OR (n.sticky = %d AND (n.created > %d OR (n.created = %d AND n.nid > %d)))) AND n.nid != %d AND n.status = 1 ORDER BY n.sticky ASC, n.created ASC, n.nid ASC'), $p->tid, $node->sticky, $node->sticky, $node->created, $node->created, $node->nid, $node->nid, 0, 1)); $node->teaser = l(image_display($node, 'thumbnail'), 'node/'.$node->nid, array(), NULL, NULL, FALSE, TRUE) . $node->teaser; - $node->body = image_display($node, $request) . $node->body; + $node->body = theme('image_view', image_display($node, $request), $node->body, $prev, $next); } @@ -478,6 +480,46 @@ function image_admin_album($edit = array } /** + * Theme an image node's previous and next links + */ +function theme_image_view($image_html, $description, $prev, $next) { + $content = ''; + + drupal_set_html_head(''); + + if($prev) { + $links .= ''; + $titles .= ''; + } + else { + $links .= ''; // Make an empty div to fill the space. + } + + if($next) { + $links .= ''; + $titles .= ''; + } + else { + $links .= ''; // Make an empty div to fill the space. + } + + $content .= '
'; + $content .= $image_html; + $content .= $description; + $content .= ''; + $content .= '
'; + + return $content; +} + +/** * Theme a gallery page */ function theme_image_album($albums, $images) {