Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 9 Pomógł: 0 Dołączył: 14.02.2009 Ostrzeżenie: (0%)
|
Witam mam taką galerię http://www.fiat126p.boo.pl/galeria/gallery.php , a ze względu że się nie bardzo znam na php to gotową ze strony pobrałem i sporo poprzerabiałem, ale nie mam pojęcia jak moge zrobić, aby była pogrubiona albo podkreślona strona galerii na której się znajdujemy. Z góry wielkie dzięki za pomoc.
|
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 9 Pomógł: 0 Dołączył: 14.02.2009 Ostrzeżenie: (0%)
|
Kod <? $scale = 0; $maxwidth = 600; $maxheight = 450; $thumbmaxw = 50; $thumbmaxh = 37; $imgperpage = 12; $imgperrow = 12; $pgperrow = 10; $currentdir = getcwd (); $typelist = array("jpg","jpeg","gif","png","JPG"); $imagelist = array(); $stylesheet = ''; $home = "{$_SERVER['PHP_SELF']}"; $this_page = "{$_SERVER['PHP_SELF']}"; $caption = ""; $captionext = "txt"; if(!isset($_GET['ind'])) $_GET['ind'] = 0; $index = $_GET['ind']; $dp=opendir($currentdir); while ( false != ( $file=readdir($dp) ) ) { if (is_file($file) && $file!="." && $file!=".."){ $extention = explode(".",$file); $extfield = count($extention)-1; $extention = $extention[$extfield]; if( in_array($extention,$typelist) ){ array_push ($imagelist,$file); } } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> </head> <body> <? if($index-1 >= 0) {?> <a href="<?= $this_page ?>?ind=<?= $index-1 ?>#top"><img border=0 src="../images/strzalka1.jpg"></a> <? } ?> <br> </td> <td width="600"> <div align="center"> <? $sizeee = getimagesize ("$imagelist[$index]"); $imgwidth = $sizeee[0]; $imgheight = $sizeee[1]; if ($scale == 1 || $imgwidth > $maxwidth || $imgheight > $maxheight) { // decide if img needs to be scaled $newwidth = $imgwidth/($imgheight/$maxheight); $newheight = $imgheight/($imgwidth/$maxwidth); if ($imgwidth < $imgheight) { if ($newwidth > $maxwidth) { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $maxwidth ?>" height="<?= $newheight ?>" alt="" /> </a> <? } else { ?> <img src="<?= $imagelist[$index] ?>" width="<?= $newwidth ?>" height="<?= $maxheight ?>" alt="" /> <? } } else { if ($newhight > $maxheight) { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $newwidth ?>" height="<?= $maxheight ?>" alt="" /> </a> <? } else { ?> <img src="<?= $imagelist[$index] ?>" width="<?= $maxwidth ?>" height="<?= $newheight ?>" alt="" /> <? } } } else { ?> <img src="<?= $imagelist[$index] ?>" width="<?= $imgwidth ?>" height="<?= $imgheight ?>" alt="" /> <? } ?> </div> </td> <td> <? if($index+1 < count($imagelist) ) {?> <a href="<?= $this_page ?>?ind=<?= $index+1 ?>#top"><img border=0 src="../images/strzalka.jpg"></a> <? } ?> <br> </td> </tr> <tr> <td> </td> <td> Kod <center><? if (file_exists ($imagelist[$index]. "." . $captionext) && is_file ($imagelist[$index]. "." . $captionext) && !is_dir ($imagelist[$index]. "." . $captionext)) include $imagelist[$index]. "." . $captionext; else echo $caption; ?> </center> </td> <td> </td> </tr> </table> <table align="center" border=0> <tr><td> <? $nrpages = ceil( count($imagelist)/$imgperpage ); for($j=0;$j<$nrpages;$j++) { if( $index >= ($j*$imgperpage) && ($index < (($j+1) * $imgperpage)) ) { for($i=($j*$imgperpage);$i<(($j+1) * $imgperpage);$i++) { if(($i%$imgperrow == 0) && ($i > 0)) { ?> </td> <? } if($i <count($imagelist) ) { $path = "$this_page?ind=".$i; ?> <td> <? $sizeee = getimagesize ("$imagelist[$i]"); $imgwidth = $sizeee[0]; $imgheight = $sizeee[1]; $newthumbw = $imgwidth/($imgheight/$thumbmaxh); $newthumbh = $imgheight/($imgwidth/$thumbmaxw); if ($imgwidth < $imgheight) { if ($newthumbw > $thumbmaxw) { ?> <a href="<?= $path ?>#top"> <img src="<?= $imagelist[$i] ?>" width="<?= $thumbmaxw ?>" height="<?= $newthumbh ?>" alt="" /> </a> <? } else { ?> <a href="<?= $path ?>#top"> <img border=1 src="<?= $imagelist[$i] ?>" width="<?= $newthumbw ?>" height="<?= $thumbmaxh ?>" alt="" /> </a> <? } } else { if ($newthumbh > $thumbmaxh) { ?> <a href="<?= $path ?>#top"> <img border=1 src="<?= $imagelist[$i] ?>" width="<?= $newthumbw ?>" height="<?= $thumbmaxh ?>" /> </a> <? } else { ?> <a href="<?= $path ?>#top"> <img border=1 src="<?= $imagelist[$i] ?>" width="<?= $thumbmaxw ?>" height="<?= $newthumbh ?>" alt="" /> </a> <? } } ?> </td> <? } } } } ?> </tr> </table> <center> <? //---this code generates links based on the configuration settings--- //---only puts $pgperrow page links per row to make cleaner--- for ($j=0;$j<$nrpages;$j++) { if(($j%$pgperrow == 0) && ($j > 0)) { ?> <? } ?> <a href="<?= $this_page ?>?ind=<?= ($j*$imgperpage) ?>#top"><font size=2 face="verdana"><?= ($j+1) ?></font></a> <? } ?> musiałem trochę obciąć bo się nie mieściło więc ale chyba wszystko co wazne jest Ten post edytował jgkrzycho 16.02.2009, 15:12:07 |
|
|
|
jgkrzycho [PHP]Galeria w php 16.02.2009, 14:43:19
Foxx Jak mamy Ci pomóc skoro nie znamy kodu tej galerii... 16.02.2009, 14:46:50
peter13135 trudno bedzie ci powiedzieć skoro niemamy kodu 16.02.2009, 14:47:01
zegarek84 wszędzie fragment kodu:
Kod<img border=1 src=... 16.02.2009, 15:46:35
jgkrzycho Hum pomyliłeś się, bo pogrubia obrazek na którym j... 16.02.2009, 16:04:00 
zegarek84 Cytat(jgkrzycho @ 16.02.2009, 16:04:0... 16.02.2009, 16:49:51
jgkrzycho No może i racja, że nie wyraźnie napisałem. Ale z ... 16.02.2009, 17:12:32
zegarek84 w pliku index.html odszukaj linii:
[HTML] pobierz,... 16.02.2009, 17:20:19
jgkrzycho Kurde to znowu się nie zrozumieliśmy. Więc jak wch... 16.02.2009, 17:30:40
zegarek84 ten skrypt:
Kodfor ($j=0;$j<... 16.02.2009, 17:53:26
jgkrzycho Prawie, że idealnievjuż . Już wstawiłem to na głów... 16.02.2009, 18:09:02
zegarek84 czytaj kiedy był edit postu wyżej i to sprawdź ;p ... 16.02.2009, 18:11:46
jgkrzycho Super jesteś szefie =] pomógł posz... 16.02.2009, 18:20:20 ![]() ![]() |
|
Aktualny czas: 27.12.2025 - 19:16 |