Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> galeria problem ze ścieżka
przemol88
post 17.02.2006, 01:43:20
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 3.02.2006

Ostrzeżenie: (0%)
-----


Problem jest tego typu że mam jakis tam skrypt galerii ktory dzieli fajnie na stroni wyswietlane pkiki, jest to do tapetek na komorki, normalnie pliki z folderu. jednak ładuje on pliki z katalgou ktory sie znajduje jak zmodyfikowac ten plik żeby pobieral obrazki z okreslonej ścieżki, porobowalem juz rozmnych rzeczy ale mi nie wychodzi, jak ktoś moze podac co i jak zmienic np zeby pobieralo z folderu obrazki dzięki
  1. <?
  2. $conf["items_per_page"] = 60;
  3. if (!isset($page)) {$page = 0;}
  4. $total = 0;
  5.  
  6. if(!($dp = opendir("./"))) die ("Cannot open ./");
  7. $file_array = array();
  8. while ($file = readdir ($dp))
  9. {
  10. if(substr($file,0,1) != '.' and $file != "index.php")
  11.   {
  12.   $file_array[] =  $file;
  13.   }
  14. }
  15. $file_count = count ($file_array);
  16. sort ($file_array);
  17. ?>
  18.  
  19.  
  20. <p mode="nowrap">
  21.  
  22.   <?
  23.  
  24.   if ($file_count > 0)
  25.    {
  26.    $first_record = $page * $conf["items_per_page"];
  27.    $last_record = $first_record + $conf["items_per_page"];
  28.  
  29.    while (list($fileIndexValue, $file_name) = each ($file_array))
  30.     {
  31.  
  32.     if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
  33.      {
  34.  
  35.      echo "<img src=\"$file_name\" title=\"". round(filesize($file_name)/1024,1) . " kB // $file_name\" qsms.pl></a>
  36.                                         ";
  37.      $total = $total + filesize($file_name);
  38.      }
  39.     }
  40.    echo "<br /><table><td width=\"55\">";
  41.  
  42.    if (($file_count > 0) AND ($page != 0))
  43.     {
  44.     // previous button
  45.     $prev_page = $page -1;
  46.                                 echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Poprzednie</a>";
  47.     }
  48.    echo "<td><td width=80><center><a href=\"../index.php\">Powrót</a></center><td width=\"50\">";
  49.  
  50.    if (($file_count > 0) AND ($last_record < $file_count))
  51.     {
  52.     // next button
  53.     $next_page = $page + 1;
  54.     echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Następne</a>";
  55.     }
  56.    echo "</table><br/><br/><table><td width=\"150\">Znaleziono: <b>$file_count</b> ";
  57.    if ($file_count == 1)
  58.     {echo "tapetę";}
  59.    else
  60.     {echo "tapet";}
  61.  
  62.    echo "</td><td>[<b>" . round($total/1024,1) . " kb</b>]</table>";
  63.    }
  64.   closedir($dp);
  65.   ?>

----------
Prosze uzywac [ php ] dla kodu php.
-- dr_bonzo
Go to the top of the page
+Quote Post
barF
post 17.02.2006, 02:02:05
Post #2





Grupa: Zarejestrowani
Postów: 43
Pomógł: 1
Dołączył: 17.01.2006
Skąd: pionowe

Ostrzeżenie: (0%)
-----


w 6 linijce opendir();
Go to the top of the page
+Quote Post
-Gość_przemol-
post 17.02.2006, 11:43:26
Post #3





Goście







Niestety to pobiera a nie wyswietla gdzies dalej gdzie jest imd scr= ale nie wiem jak tam dodac przed tym
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.07.2025 - 01:14