diff -ruN image.orig/image.css image/image.css --- image.orig/image.css Fri Apr 15 16:14:52 2005 +++ image/image.css Fri May 27 22:18:01 2005 @@ -35,4 +35,32 @@ ul.images li { float : left; margin : 1em; -} \ No newline at end of file +} + +.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%; +} diff -ruN image.orig/image.module image/image.module --- image.orig/image.module Tue May 10 21:09:56 2005 +++ image/image.module Fri May 27 22:20:58 2005 @@ -280,8 +280,11 @@ } $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 = image_display($node, $request) . $node->body; + $node->body = theme('image_view', image_display($node, $request), $node->body, $prev, $next); } @@ -478,6 +481,46 @@ } return form($form); +} + +/** + * 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; } /**