squiffythewombat Posted May 3, 2006 Posted May 3, 2006 HI Guys, Im chopping about a gallery contribution and having quite a hard time getting it to look right! Here it is so far : clicky the linky As you can see its display 2 colums and X many rows, however what i want to do is to have the first row as 2 colums and then every row after 3 colums. I just cant quite figure the code out and have tried hunting forums and wiki to no avail! heres the code im using: <?php /* $Id: gallery.php,v 1.1 2003/06/16 16:15:01 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Made by Shpurlos, [email protected] De-buged by Alex, [email protected] Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GALLERY); $breadcrumb->add(NAvb script:self.close()\"><img src=\""+img+"\" width=\""+foto.width+"\" height=\""+foto.height+"\" border=\"10\" alt=\"click here to close the window\"></a><\/p><\/td><\/tr>"); output.document.writeln("<\/table><\/body><\/html>"); output.focus(); } // --> </script> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table cols="2" border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"> <table border="0" width="99%" cellspacing="0" cellpadding="0" align="center"> <tr> <FONT COLOR="ffffff"> <td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt=""></td> <td width="100%" height="14" class="infoBoxHeading"></td> <td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td> </tr> </table> <table border="0" width="99%" cellspacing="0" cellpadding="1" class="infoBox" align="center"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents"> <tr> </tr> <tr> <td class="main"><b><?php echo HEADING_TITLE; ?></b> <!-- Gallery Script Begin //--> <? $nmbr=25; //qty pics per page $file="gallery.php"; //main file $rep1="sm_$rpd"; //thumbnain prefix ;) $rp="gallery/$rpd"; // path to gallery folders $rep="gallery/$rep1"; // another path to gallery folders // LISTING DE TOUTES LES IMAGES $i=0; $handle=@opendir("$rep"); //let us scan your dirs for pics function txt1($cle) { global $txt0; $txtt="gallery.ini"; $filetxt = file($txtt); $counttxt = count($filetxt); for ($b = 0; $b < $counttxt; $b++) { list($namejpg,$comment)=explode("::", $filetxt[$b]); if ($cle==$namejpg){ $txt0= "$comment<br>"; return; } else { $txt0=""; } } } while ($fichier = @readdir($handle)) { $extension=substr($fichier,-3); if($fichier!="." && $fichier!=".." && (eregi("gif",$extension)||eregi("jpg",$extension))) { $listing[$fichier]=filemtime("$rp/$fichier"); $per[$i]=$fichier; } $i++; } @closedir($handle); //If found pics - show them, if nothing - show text_gallery_information if(!is_array($listing)) { echo TEXT_GALLERY_INFORMATION; } else { arsort($listing); //Sorting ;) $i=1; $rw=1; $xyz=1; $kolvo=0; while (list($cle,$val) = each($listing)) { if($kolvo==0){ $xzy=date("d.m.y ",filemtime("$rp/$cle")); $xzyz=$cle; } if(!$namezzz) { $namezzz=$xzyz; } // View Tumbnails and Code - Anzeige der Tumbnails und Code $im[$xyz].="<td align=\"center\" valign=\"top\" style=\"padding: 3\"><a href=\"$file?rpd=$rpd&rrr=$rrr&namezzz=$cle\"><IMG border=\"0\" SRC=\"$rep/$cle\"alt=\"Uploaded: " .date("d.m.y ",filemtime("$rp/$cle"))."\nToday: " .date("d.m.y ")."\"> </a><br><font size=\"1\">"; txt1($cle); if(date("d.m.y ")==date("d.m.y ",filemtime("$rp/$cle"))){ $im[$xyz].=$txt0."<br>"; } else { $im[$xyz].=$txt0.date("d.m.y ",filemtime("$rp/$cle")); } $im[$xyz].="</font></b></td>\n"; if($i==$nmbr){if($xyz==$rrr){ $linew.="<b>[$xyz]</b>\n"; } else { $linew.="<a href=\"$file?rpd=$rpd&rrr=$xyz&namezzz=$namezzz\">[$xyz]</a> \n"; } $i=0;$xyz++;} if($rw==2){$rw=0;$im[$xyz].="</tr><tr>";} $i++; $rw++; $kolvo++; } if($i<$nmbr&&$i>0){if($xyz==$rrr){ } else { $linew.="<a href=\"$file?rpd=$rpd&rrr=$xyz&namezzz=$namezzz\">[$xyz]</a> ";$i=0;$xyz++;} } if($xyz==25){$linew.="<br>";}; if($rr<5&&$rr>0){$rr=0;$im[$xyz].="<tr><tr>";} if(file_exists("$rep/$image")) { $size = getimagesize ("$rp/$cle/$namezzz"); $imgsize="width=\"250\" height=\"".$size[1]*250/$size[0]."\""; echo "<center>$linew<p>\n"; echo "<table border=\"0\" bordercolor=\"#D2E9FF\" style=\"border-collapse: collapse\" width=\"720\">"; echo "<TD vAlign=top align=middle rowspan=\"2\"><a href=\"java script:ViewImage('$rp/$cle/$namezzz')\"><img border=\"0\" src=\"$rp/$cle/$namezzz\" $imgsize alt=\"$namezzz\" cols=\"2\"></a></td>"; echo "$im[$rrr]"; echo "</tr></table>"; echo "<p>$linew<p>\n"; } } ?> <?php echo TEXT_INFORMATION; ?> <?php echo "<br><b>Instructions</b>: Click the thumbnails on the right to display the photo, then click the larger image on the left to see the full size photo. The numbers along the top are used to navigate the different galleries. Thanks goto our customers for these great photos!"; //include "footer.html"; ?> <!-- Gallery Script EOF //--> </td> </tr> </table> </td> </tr> </table> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> THANKS TO THE GUY WHO MADE THIS CONTRIBUTION! Mods, wasnt sure if this was a "general question" or contribution question, please move if ive got it wrong! Many thanks all Toby
squiffythewombat Posted May 5, 2006 Author Posted May 5, 2006 bit of a bump.....can anybody help??? this is driving me MAD!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.