Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: 35mm Slide Gallery
Forum PHP.pl > Forum > Gotowe rozwiązania
lilith123
Widzę, że jest tu mnóstwo dobrych duszyczek winksmiley.jpg
I wszyscy sobie pomagają, więc może i mi ktosik pomoże...

Mam taki szablon stronki ...

  1. <table> <tr>
  2. <td> menu prawe </td>
  3. <td bgcolor="#FFF6ED"> //tu się wyświetlają PODSTRONY
  4. [php]
  5.  <?
  6. ="ok";
  7. if (!isset() || ==""){ = Array['s']; };
  8. if(==""){ include("podst.php"); }
  9. else if (file_exists(".php")) { include(".php"); }
  10. else { include("er404.php");};
  11. ?>
  12.  [/php]
  13. </td>
  14. <td> menu lewe </td>
  15. </tr></table>
  16. </body></html>




oraz mam śliczną galeryjkę 35mm Slide Gallery snitch.gif


Skrypt działa w ten sposób, że otwiera się osobno w nowym oknie i katalogi z galeriami musza byc w tym samym katalogu co sam plik index.php

BARDZO mi zależy aby galeria otwierała się w tym samym miejscu co inne podstrony (jako podstrona) i żeby katalogii galerii znajdowały sie w zbiorczym katalogu "galeria"


Ma on taki kod:

### plik confif.php

  1. <?php
  2.  
  3. //Slide gallery variables
  4. $place = &#092;".\"; //directory of the slide mount images, no need to change
  5. $col = 3; //no. of columns in a page
  6. $maxrow = 2; //no. of rows in a page
  7. $dir=&#092;".\"; //directory for this script, no need to change
  8. $thumb = true ; //setting it to TRUE will generate real thumbnails on-the-fly, supports jpg file only and requires GD library. Setting it to FALSE will re
  9. ize the original file to fit the thumbnail size, long download time. Turn it off
  10. if thumbnails don't show properly.
  11. $croptofit = true ; //TRUE will crop the thumbnail to fit the aspect ratio of the slide mount if they 
  12. ren't the same. False won't crop the thumbnail but it will be distorted if both aspect ratios are not the 
  13. ame.
  14. $rollover = true ; //thumbnail rollover effect for IE only
  15.  
  16. //Upload/Delete Module variables
  17. $LOGIN = \"admin\";
  18. $PASSWORD = \"admin\";
  19. $abpath = \"/usr/local/apache/vhosts\"; //Absolute path to where images are uploaded. No trailing slash
  20. $sizelim = \"no\"; //Size limit, yes or no
  21. $size = \"2500000\"; //Size limit if there is one
  22. $number_of_uploads = 5; //Maximum number of uploads in one time
  23.  
  24. ?>



### plik header.php
  1. <?php
  2.  
  3.  
  4. <html>
  5. <head>
  6.  <title>35mm Slide Gallery</title>
  7. <link rel=&#092;"stylesheet\" type=\"text/css\" href=\"gallery.css\">
  8. </head>
  9. <div id=&#092;"header\"><h1>35mm Slide Gallery --demo--</h1><div align=\"right\"><font size=\"1\">powered by <a href=\"http://www.andymack.com/freescripts/\">35mm 
  10. Slide Gallery</a></font></div></div>
  11.  
  12. <body bgcolor=&#092;"#666666\">
  13.  
  14. ?>



### plik index.php
  1. <?php
  2. $imgdir = $_GET['imgdir']; 
  3. $page = $_GET['page'];
  4. $a_img = array();
  5.  
  6. include(&#092;"header.inc\");
  7. require('config.php');
  8.  
  9. if ($rollover)
  10. {
  11. include('rollover.txt');
  12. }
  13.  
  14. ///// for captioning
  15. function caption($filename) {
  16.  $is_captioned = check_perms($filename);
  17. if ($is_captioned) {
  18. print&#092;"<br><font face='Arial, Helvetica, sans-serif' size=2 color='#999999'>\";
  19. include($filename);
  20. print&#092;"</font>\";
  21. }
  22. }
  23.  
  24. ///// for album description
  25. function album($filename) {
  26.  $is_captioned = check_perms($filename);
  27. if ($is_captioned) {
  28. print&#092;"<font face='Arial, Helvetica, sans-serif' size=3 color='#cccccc'>\";
  29. include($filename);
  30. print&#092;"</font><br>\";
  31. }
  32. }
  33.  
  34.  
  35. ////check file permission
  36. function check_perms($filename) {
  37.  
  38. if (! file_exists($filename)) return false;
  39.  
  40. $fileperms = fileperms($filename);
  41. $isreadable = $fileperms & 4;
  42. if ( is_file($filename) ) {
  43. // pictures, thumbnails, config files and comments only need to be readable
  44. if (! $isreadable) {
  45. if (MODE_WARNING) print &#092;"$filename: wrong permission <br>\";
  46. }
  47. return $isreadable;
  48. }
  49. else if ( is_dir($filename) ) {
  50. // galleries need to be both readable and executable
  51. $isexecutable = $fileperms & 1;
  52. if (! $isreadable || ! $isexecutable)
  53. if (MODE_WARNING) print &#092;"$filename: wrong permission <br>\";
  54. return ( $isreadable && $isexecutable); // ($dirperms & 5) == 5 ?
  55. }
  56.  
  57. // default behavior: the filename does not exist
  58. return false;
  59. }
  60.  
  61.  
  62. $dh = opendir($dir);
  63.  while($file = readdir($dh))
  64.  {
  65. if ($file != &#092;".\" && $file != \"..\" && is_dir($file))  
  66. {$dname[] = $file;
  67. sort($dname);
  68. reset ($dname);
  69.  }
  70. }
  71.  
  72.  
  73. print &#092;"<script language=\"JavaScript\">\";
  74. print &#092;"function MM_jumpMenu(targ,selObj,restore){eval(targ+\".location='\"+selObj.options[selObj.selectedIndex].value+\"'\");\";
  75. print &#092;" if (restore) selObj.selectedIndex=0;}\";
  76. print &#092;"</script>\";
  77. print &#092;"<form name=\"form1\">\";
  78. print &#092;"<select name=\"menu1\" onChange=\"MM_jumpMenu('parent',this,0)\">\";
  79. print &#092;"<option value=\"#\">Go to...</option><br>n\";
  80. $u=0;
  81.  foreach($dname as $key=>$val)
  82. { if($dname[$u])  
  83. { print &#092;"<option value=\"index.php?imgdir=$dname[$u]\">$dname[$u]</option>n\";
  84. $u++;
  85. }
  86. }
  87. print &#092;"</select>\";
  88.  
  89.  
  90. if ($imgdir ==&#092;"\")
  91. {$imgdir = $dname[0];
  92. }
  93.  
  94. $dimg = opendir($imgdir);
  95.  while($imgfile = readdir($dimg))
  96.  {
  97.  if( (substr($imgfile,-3)==&#092;"gif\") || (substr($imgfile,-3)==\"jpg\") || (substr($imgfile,-3)==\"JPG\") || (substr($imgfile,-3)==\"GIF\") )
  98.  {
  99.  $a_img[count($a_img)] = $imgfile;
  100. sort($a_img);
  101. reset ($a_img);
  102.  } 
  103. }
  104.  
  105.  
  106. print &#092;"<h2>$imgdir</h2>\";
  107.  
  108.  $totimg = count($a_img); // total images number
  109.  $totxpage = $col*$maxrow; // images x page
  110.  $totpages = ($totimg%$totxpage==0)?((int)$totimg/$totxpage):((int)($totimg/$totxpage)+1); // number of total pages
  111.  
  112.  if($totimg == false)
  113.  print &#092;"<br><font size=2 face=verdana>No Images available in your \"IMAGES\" directory yet!!</font><br>\";
  114.  else
  115.  {
  116.  
  117.  
  118. print &#092;"</form>\";
  119.  
  120. ///print album description
  121. $album_name = &#092;"$imgdir/album.txt\";
  122. album($album_name);
  123.  
  124.  
  125. print &#092;"<center><table width=700 bgcolor=#474747 border=0 bordercolor=#ffffff cellpadding=2 c
  126. llspacing=3>n\";
  127.  
  128. // start page
  129. if($page==\"\" || $page==1)
  130. {
  131.  $x=0;
  132.  $page = 1;
  133. }
  134. else
  135.  $x = (($page-1)*($totxpage));
  136. $r=0;
  137.  
  138. // print of table
  139. foreach($a_img as $key=>$val)
  140. {
  141.  
  142.  
  143.  
  144. $caption_name = \"$imgdir/$a_img[$x].txt\";
  145.  
  146.  if(($x%$col)==0)
  147. print \"<tr>n\";
  148.  if($a_img[$x])
  149.  {
  150. $size = getimagesize (\"$imgdir/$a_img[$x]\");
  151. $halfw = round($size[0]/2);
  152. $halfh = round($size[1]/2);
  153. $quarterw = round($size[0]/4);
  154. $quarterh = round($size[1]/4);
  155.  
  156.  
  157.  
  158. if($size[1] < $size[0])
  159. {
  160. $height = 86;
  161. $width = 130;
  162. $imgnumber = ($x+1);
  163. if(\"$imgdir/$a_img[$x]\" !=\"\")
  164.  
  165. if ($thumb){
  166. $thumbnail = \"thumbs.php?image=$imgdir/$a_img[$x]&newheight=86&newwidth=130&width=$size[0]&height=$size[1]\";
  167. }
  168. else 
  169. {
  170. $thumbnail = \"$imgdir/$a_img[$x]\";
  171. }
  172.  
  173. print \"<td align=center valign=top>\";
  174. print \"<TABLE WIDTH=198 BORDER=0 CELLPADDING=0 CELLSPACING=0>\";
  175. print \"<TR><TD COLSPAN=3><IMG SRC=\"$place/slide_01.gif\" WIDTH=198 HEIGHT=47></TD></TR>\";
  176. print \"<TR><TD><IMG SRC=\"$place/slide_02.gif\" WIDTH=33 HEIGHT=86></TD>\";
  177. print \"<TD><a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$size[0]&h=$size[1]&t=$imgdir $imgnumber','$x','width=$size[0],height=$size[1],directories=no,location=no,menubar=no,scrollbars=
    no,status=no,toolbar=no,re
  178. izable=no');return false\" target=\"_blank\"><img src=\"$thumbnail\" height=$height width=$width border=0 alt='$a_img[$x]' style=\"filter:alpha(opacity=100)\" onmouseout=\"gradualfade(this,100,30,4)\" onmouseover=\"gradualfade(this,40,50,100)\"></a></TD>\";
  179. print \"<TD><IMG SRC=\"$place/slide_04.gif\" WIDTH=35 HEIGHT=86></TD></TR><TR>\";
  180. print \"<TD COLSPAN=3><IMG SRC=\"$place/slide_05.gif\" WIDTH=198 HEIGHT=56><br><font size=\"1\"><a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$size[0]&h=$size[1]&t=$imgdir $imgnumber','$x','width=$size[0],height=$size[1],directories=no,location=no,menubar=no,scrollbars=
    no,status=no,toolbar=no,re
  181. izable=no');return false\" target=\"_blank\">$size[0] x $size[1]</a> | <a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$halfw&h=$halfh&t=$imgdir $imgnumber','$x','width=$halfw,height=$halfh,directories=no,location=no,menubar=no,scrollbars=no,s
  182. atus=no,toolbar=no,resizable=no');return false\" target=\"_blank\">1/2</a> | <a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$quarterw&h=$quarterh&t=$imgdir $imgnumber','$x','width=$quarterw,height=$quarterh,directories=no,location=no,menubar=no,scrollbar
  183. =no,status=no,toolbar=no,resizable=no');return false\" target=\"_blank\">1/4 size</a></font>\";
  184. caption($caption_name);
  185. print \"</TD></TR>\";
  186. print \"</TABLE></center>\";
  187. print \"</td>n\";
  188. }
  189. else
  190. { $height = 130;
  191. $width = 86;
  192.  
  193. if ($thumb){
  194. $thumbnail = \"thumbs.php?image=$imgdir/$a_img[$x]&newheight=130&newwidth=86&width=$size[0]&height=$size[1]\";
  195. }
  196. else 
  197. {
  198. $thumbnail = \"$imgdir/$a_img[$x]\";
  199. }
  200.  
  201.  $imgnumber = ($x+1);
  202. if(\"$imgdir/$a_img[$x]\" !=\"\")
  203. print \"<td align=center valign=top>\";
  204. print \"<TABLE WIDTH=198 BORDER=0 CELLPADDING=0 CELLSPACING=0>\";
  205. print \"<TR><TD COLSPAN=3><IMG SRC=\"$place/slidev_01.gif\" WIDTH=198 HEIGHT=28></TD></TR>\";
  206. print \"<TR><TD><IMG SRC=\"$place/slidev_02.gif\" WIDTH=56 HEIGHT=130></TD>\";
  207. print \"<TD><a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$size[0]&h=$size[1]&t=$imgdir $imgnumber','$x','width=$size[0],height=$size[1],directories=no,location=no,menubar=no,scrollbars=
    no,status=no,toolbar=no,re
  208. izable=no');return false\" target=\"_blank\"><img src=\"$thumbnail\" height=$height width=$width border=0 alt='$a_img[$x]' style=\"filter:alpha(opacity=100)\" onmouseout=\"gradualfade(this,100,30,4)\" onmouseover=\"gradualfade(this,40,50,100)\"></a></TD>\";
  209. print \"<TD><IMG SRC=\"$place/slidev_04.gif\" WIDTH=56 HEIGHT=130></TD></TR><TR>\";
  210. print \"<TD COLSPAN=3><IMG SRC=\"$place/slidev_05.gif\" WIDTH=198 HEIGHT=31><br><font size=\"1\"><a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$size[0]&h=$size[1]&t=$imgdir $imgnumber','$x','width=$size[0],height=$size[1],directories=no,location=no,menubar=no,scrollbars=
    no,status=no,toolbar=no,re
  211. izable=no');return false\" target=\"_blank\">$size[0] x $size[1]</a> | <a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$halfw&h=$halfh&t=$imgdir $imgnumber','$x','width=$halfw,height=$halfh,directories=no,location=no,menubar=no,scrollbars=no,s
  212. atus=no,toolbar=no,resizable=no');return false\" target=\"_blank\">1/2</a> | <a href='#' onclick=\"window.open('popup.php?img=$imgdir/$a_img[$x]&w=$quarterw&h=$quarterh&t=$imgdir $imgnumber','$x','width=$quarterw,height=$quarterh,directories=no,location=no,menubar=no,scrollbar
  213. =no,status=no,toolbar=no,resizable=no');return false\" target=\"_blank\">1/4 size</a></font>\";
  214. caption($caption_name);
  215. print \"</TD></TR>\";
  216. print \"</TABLE>\";
  217. print \"</td>n\";
  218. }  
  219. }
  220.  
  221.  if(($x%$col) == ($col-1))
  222.  {
  223. print \"</tr>n\";
  224. $r++;
  225.  }
  226. // print \"r=$r - maxrow=$maxrow<br>\";
  227.  if($r==$maxrow)
  228.  {
  229. break;
  230.  }
  231.  else
  232.  $x++;
  233. }
  234. print \"</table>n\";
  235.  }
  236.  // page break
  237.  
  238.  
  239.  
  240. $imgdir = str_replace(\" \", \"%20\", $imgdir); 
  241.  
  242. //page number
  243. print \"<p><font size=2 face=verdana>\";
  244.  if($totimg>$totxpage)
  245.  {
  246. if($totpages>$page)
  247. {
  248.  $next = $page+1;
  249.  $back = ($page>1)?($page-1):\"1\";
  250.  if($page>1)
  251.  {
  252. $back = $page-1;
  253. print \"<a href=index.php?imgdir=$imgdir&page=1>first page</a> | <a href=index.php?imgdir=$imgdir&page=$back><< back </a>\";
  254.  }
  255.  print \" &nbsp;&nbsp; <b>page $page of $totpages</b> &nbsp;&nbsp;<a href=index.php?imgdir=$imgdir&page=$next>next >></a> | <a href=index.php?imgdir=$imgdir&page=$totpages>last page</a>\";
  256. }
  257. else
  258. {
  259.  $next = (($page-1)==0)?\"1\":($page-1);
  260.  print \"<a href=index.php?imgdir=$imgdir&page=1>first page</a> | <a href=index.php?imgdir=$imgdir&page=$next><< back</a>&nbsp;&nbsp; <b>page $page of $totpages</b> &nbsp;&nbsp;\";
  261.  
  262. print \"</center>\";
  263. }
  264.  }
  265. include(\"footer.inc\");
  266. ?>



### plik popup.php
  1. <?php 
  2.  
  3. $img = $_GET['img'];
  4. $w = $_GET['w'];
  5. $h = $_GET['h'];
  6. $t = $_GET['t'];
  7.  
  8. print &#092;"<html>\";
  9. print &#092;"<head>\";
  10. print &#092;"<title>$t</title>\";
  11. print &#092;"</head>\";
  12. print &#092;"<body bgcolor=\"Black\" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onblur=\"self.close();\" onload=\"self.focus();\">\";
  13. print &#092;"<img src=\"$img\" width=$w height=$h border=0>\";
  14. print &#092;"</body>\";
  15. ?>



### plik rollover.txt
  1.  
  2.  
  3. gradualfadeObjects = new Object();
  4. gradualfadeTimers = new Object();
  5.  
  6.  
  7. function gradualfade(object, final, speed, change){
  8. if (!document.all)
  9. return
  10. if (object != "[object]"){
  11. setTimeout("gradualfade("+object+","+final+","+speed+","+change+")",0);
  12. return;
  13. }
  14.  
  15. clearTimeout(gradualfadeTimers[object.sourceIndex]);
  16.  
  17. diff = final-object.filters.alpha.opacity;
  18. direction = 1;
  19. if (object.filters.alpha.opacity > final){
  20. direction = -1;
  21. }
  22. change=Math.min(direction*diff,change);
  23. object.filters.alpha.opacity+=direction*change;
  24.  
  25. if (object.filters.alpha.opacity != final){
  26. gradualfadeObjects[object.sourceIndex]=object;
  27. gradualfadeTimers[object.sourceIndex]=setTimeout("gradualfade(gradualfadeObjects["+object.sourceIndex+"],"+final+","+speed+","+change+")",speed);
  28. gradualfadeTimers[object.sourceIndex]=setTimeout("gradualfade(gradualfadeObjects["+object.sourceIndex+"],"+final+","+speed+","+change+")",speed);
  29. }
  30. }



...uff...

Nie mam bladego pojęcia jak zmodyfikować ten kod, by dopasować go do moich potrzeb. Musze się przyznać, ze próbowałam co nieco go zmieniać, ale naprawdę nikt nie chce wiedzieć z jakimi skutkami sadsmiley02.gif

BARDZO bym prosiła o pomoc, czyli o modyfikacje skryptu lub chociaż jego wytłumaczenie sad.gif

Ja wiem, że pewnie zmiany o które mi chodzi sa banalne, ale ja NAPRAWD nie wiem jak go zmienić... chlip..

POMOŻECIE :?:
zbig13
Jeśli chcesz aby galeria otwierała się w tym samym miejscu co inne podstrony, możesz zmodyfikować pliki galerii header.inc i footer.inc i dodać do nich część kodu swojej strony. Plik header.inc powinien wyglądać mniej więcej tak:
  1. <title>35mm Slide Gallery</title>
  2. <link rel="stylesheet" type="text/css" href="gallery.css">
  3. </head>
  4. <body bgcolor="#666666">
  5. <table> <tr>
  6. <td> menu lewe </td>
  7. <td bgcolor="#FFF6ED"> //tu się wyświetlają PODSTRONY
  8. <div id="header"><h1>35mm Slide Gallery --demo--</h1><div align="right"><font size="1">powered by <a href="http://www.andymack.com/freescripts/">35mm
  9. Slide Gallery</a></font></div></div>

a plik footer.inc to nie pokaże Ci jak, bo go nie umieściłaś w swoim poście smile.gif W każdym razie ten footer.inc musisz zmodyfikować podobnie jak header.inc, tylko zamiast górnej części swojej strony musisz dodać dolną, czyli:
  1. </td>
  2. <td> menu prawe </td>
  3. </tr></table>

Pozdrawiam!
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.