Jump to content
php.lv forumi

barons

Reģistrētie lietotāji
  • Posts

    30
  • Joined

  • Last visited

barons's Achievements

Newbie

Newbie (1/14)

  1. Ne redz to es ar gribeeju dabuut gatavu :) Bet ir viens bet, neraad 9 bildes, bet gan 10, katraa naakamaa lapaa saak raadiit ar ieprieksheejaas lapas peedeejo bildi <_<
  2. Bet kad ir $i=0, paarsleedzot lapu piem. page=2, neraad nevienu bildi!
  3. Shaads man ir pilnais kods! $filename = "images.php"; $imagesCount = @file_get_contents('pic/auto/images.txt',r); // sheit nolasa skaitu $page = (int) $_GET['page']; $perPage = 9; //noraad cik buus bildes vienaa lapaspusee $pages = ceil( $imagesCount / $perPage ); //sadal cik buus lapas puses if ($page<1 || $page>$pages) $page = 1; //ja page lielaaks pa noeikto lpp.sk. page ir 1 $start =$perPage * ( $page - 1 ); //apmeeram nojaushu $end =($start+$perPage<$imagesCount) ? $start+$perPage : $imagesCount; // apmeeram nojaushu $dir=opendir("pic/auto/"); $i = $start+1; //print($start."-"); // print($end); while(($fails=readdir($dir)) !=false){ if ( !eregi('(jpg|jpeg)$',$fails) ) continue; //print($i); if ($i<$start) continue; if ($i>$end) break; print("<img src=pic/auto/$fails width=120 height=81 border=1><b>$fails</b> "); if( $i % 3 == 0 ) echo "<br/><br/>"; $i++; } //print($fails); //print($start."-"); //print($end."-"); for ($i = 1; $i<=$pages; $i++) { echo " [<a href='?page=$i'>$i</a>] "; } echo "</center>"; viss itkaa buutu, bet jaanoraad lai cikls turpinaas nevi atkal nolas bilzu mapi no saakuma!
  4. Tik daudz es ar sapratu :) , bet kaa uzrakstiit lai raad naakamaas? To nu nekaadi nevaru izdomaat <_<
  5. Es nomainiiju biski shaadi: $dir=opendir("pic/auto/"); $i = $start+1; //pieveerst uzm. sheit! //print($start."-"); // print($end); while(($fails=readdir($dir)) !=false){ if ( !eregi('(jpg|jpeg)$',$fails) ) continue; //print($i); if ($i<$start) continue; if ($i>$end) break; print("<img src=pic/auto/$fails width=120 height=81 border=1><b>$fails</b> "); if( $i % 3 == 0 ) echo "<br/><br/>"; $i++; } un vish man raad vienas un taas pashas bildes, pirmaas 9! Bet vismaz cikls turpinaas! :blink:
  6. Nee pie page=1 $start = 9 ,page=2 $start = 18 u.t.t.
  7. page=1 vish raad ka $start ir 1 2 3 4 5 6 7 8 9 un naakamaas lapaas +9 tas ir page=2 -> 9 page=3 -> 18 u.t.t.
  8. man tas $i taads aizdomiigs paarsleedzot lapas nemainaas paliek 1, bet pirmaa lapaa veertiiba 10!
  9. Nekaadas izmainjas :( es taa ar dariiju, bet pie nekaadiem secinaajumiem nenonaacu!
  10. man paraad prmaas 9 bildes bet, paarejot uz naakamo lapu neraad neko :unsure: man ar liekas ka ar sho vietu nav kautkas kaartiibaa $i = 1; //ir shaadi, bet vai vajag ??? while(($fails=readdir($dir)) !=false){ if ( !eregi('(jpg|jpeg)$',$fails) ) continue; if ($i<$start) continue; if ($i>$end) break;
  11. Tieshi taa visi ar kautko saak :unsure: <?php $filename = "images.php"; $imagesCount = @file_get_contents('pic/auto/images.txt',r); // sheit nolasa skaitu $page = (int) $_GET['page']; $perPage = 9; //noraad cik buus bildes vienaa lapaspusee $pages = ceil( $imagesCount / $perPage ); //sadal cik buus lapas puses if ($page<1 || $page>$pages) $page = 1; //ja page lielaaks pa noeikto lpp.sk. page ir 1 $start = $perPage * ( $page - 1 ); //apmeeram nojaushu $end = ($start+$perPage<$imagesCount) ? $start+$perPage : $imagesCount-1; // apmeeram nojaushu $dir=opendir("pic/auto/"); $i = 1; while(($fails=readdir($dir)) !=false){ if ( !eregi('(jpg|jpeg)$',$fails) ) continue; if ($i<$start) continue; if ($i>$end) break; print("<img src=pic/auto/$fails width=120 height=81 border=1><b>$fails</b> "); if( $i % 3 == 0 ) echo "<br/><br/>"; $i++; } for ($i = 1; $i<=$pages; $i++) { echo " [<a href=\"$filename?page=$i\">$i</a>] "; } echo "</center>"; ?> bet nu tomeer man kaads pateiks kur iisti ir kljuuda, nu nekaadi nevaru izdomaat, izlasiijos manuaali cauri un cauri bet nekaa... :huh:
  12. Jaa bet ar page=1 uzraad 9 bildes bet page=2 neraad neko :(
  13. $content = file("texsts.txt"); while ($val = each($content)) { $tmp = explode(":",$val[1]); print ($tmp[0]"); print ($tmp[1]"); } kautkaa taa!
  14. Nez kaapeec man liekas ka esmu novirziijies uz nepareizo celju! Varbuut kaads var noraadiit pareizo celju :huh: $imagesCount = @file_get_contents('pic/auto/images.txt',r); // sheit nolasa skaitu $page = (int) $_GET['page']; $perPage = 8; //noraad cik buus bildes vienaa lapaspusee $pages = ceil( $imagesCount / $perPage ); //sadal cik buus lapas puses if ($page<1 || $page>$pages) $page = 1; //ja page lielaaks pa noeikto lpp.sk. page ir 1 $start = $perPage * ( $page - 1 ); //apmeeram nojaushu $end = ($start+$perPage<$imagesCount) ? $start+$perPage : $imagesCount-1; // apmeeram nojaushu for ($i=$start; $i<$end; $i++ ) { $dir=opendir("pic/auto/"); while(($fails=readdir($dir)) !=false){ if ( !eregi('(jpg|jpeg)$',$fails) ) continue; if ($i<$start) continue; if ($i>$end) break;{ print("<img src=pic/auto/$fails width=120 height=81 border=1><b>$fails</b> ");} if(!($i % 3)) { echo "<br/><br/>"; } $i++; } }
×
×
  • Create New...