rendered paste body function showThumbs( $id, $folder, $title, $description, $page ) { global $mosConfig_live_site, $params, $Itemid; // number of pictures on index page $layout = $params->get( 'cols' ) * $params->get( 'rows' ); $basedir = $params->get( 'fold' ) . '/' . $folder . '/'; echo $title; // get page number from url if ($page < 1) { $page = 1; } $query = $page * $layout - ($layout-1); for ( $i=0; $i < $layout; $i++){ $image[] = sprintf( '%02d', intval($query+$i) ); } ?> <table align="center" border="0"> <tr> <td align="center"><p>Page <?php echo $page; ?></p></td> <td align="center"><p><?php ?></p></td> <td align="center"> <?php $fname = $folder . '-' . ($query+$layout) . '.jpg'; $nextfile = $basedir . $fname; if (file_exists( $nextfile )) { $page = $page+1; $link = 'index.php?option=com_rollerpics&id='. $id .'&page=' . $page . '&Itemid=' . $Itemid; echo '<a href=" ' . $link . '"> [next page]</a>'; } else { $link = 'index.php?option=com_rollerpics&Itemid=' . $Itemid; echo '<a href=" ' . $link . '"> [gallery index]</a>'; }; ?> </td> </tr> <?php $i=0; for ( $r=1; $r <= $rows; $r++){ ?> <tr> <?php for ( $c=1; $c <= $cols; $c++){ ?> <td><?php $fname = $folder . '-' . ($image[$i]) . '.jpg'; $localfile = $basedir . $fname; if (file_exists( $localfile )) { $link = 'index.php?option=com_rollerpics&id='. $id .'&img_id=' . $image[$i] . '&Itemid=' . $Itemid; $tn = $basedir . 'tn-' . $folder . '-' . $image[$i] . '.jpg';@@ echo '<a href="' . $link . '" rel="lightbox[page]"><img src="' . $tn . '" width=150 height=100 border=0 alt="Click Here"></a></td>';/* Instead of $tn, you should get the actual IMAGE */ } else { ?> </td> <?php } //end of if statement $i++; } //end of $c for loop ?> </tr> <?php } //end of $r for loop ?> </table> <?php }