barons Posted March 17, 2005 Author Report Share Posted March 17, 2005 tikmēr nesāksi pats domāt par konkrētas lietas realizēšanu tev nekad nekas neizdosies. 15130[/snapback] laikam jau taisniiba vien ir <_< Link to comment Share on other sites More sharing options...
barons Posted March 17, 2005 Author Report Share Posted March 17, 2005 Labs jaatliek shis uz riitdienu, varbuut riit buushu gudraags :rolleyes: Link to comment Share on other sites More sharing options...
rudzis Posted March 17, 2005 Report Share Posted March 17, 2005 Tā gan. Ja nemēģināsi saprast, kā darbojas tas ko tev piedāvā, tad nekā... Link to comment Share on other sites More sharing options...
v3rb0 Posted March 17, 2005 Report Share Posted March 17, 2005 viss ir vienkarsi, tik jaasaliek pareizi pa plauktinjiem :rolleyes: Link to comment Share on other sites More sharing options...
barons Posted March 18, 2005 Author Report Share Posted March 18, 2005 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++; } } Link to comment Share on other sites More sharing options...
Delfins Posted March 18, 2005 Report Share Posted March 18, 2005 (edited) tu kad kodē arī mēģini saprast ko dari ? parasti kodējot ir arī zemapziņā jānoimpretē kas notiks ko tu tur sarakstīji :) 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++; } aizstajam ar $dir=opendir("pic/auto/"); $i = 0; 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++; } Edited March 18, 2005 by Delfins Link to comment Share on other sites More sharing options...
Venom Posted March 18, 2005 Report Share Posted March 18, 2005 eregi - buē, buē print ar () buē, un "" buēē {} pēc break (?) buē (pirmajā piemērā) echo ar " buē * vemj uz paklāja :unsure: * Link to comment Share on other sites More sharing options...
barons Posted March 18, 2005 Author Report Share Posted March 18, 2005 Jaa bet ar page=1 uzraad 9 bildes bet page=2 neraad neko :( Link to comment Share on other sites More sharing options...
Delfins Posted March 18, 2005 Report Share Posted March 18, 2005 eregi - buē, buēprint ar () buē, un "" buēē {} pēc break (?) buē (pirmajā piemērā) echo ar " buē * vemj uz paklāja :unsure: * 15163[/snapback] :) visi jau ar kaut ko sāk... Link to comment Share on other sites More sharing options...
barons Posted March 18, 2005 Author Report Share Posted March 18, 2005 (edited) 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: Edited March 18, 2005 by barons Link to comment Share on other sites More sharing options...
bubu Posted March 18, 2005 Report Share Posted March 18, 2005 Pirmkārt, iemācies likt [ code ] BBtagus, citādi grūti tavu iepastoto kodu lasīt. Un pasaki, kur ir kļūda? Kas nestrādā šajā kodā? P.S. Gadījumā $i nav jāinicializē ar 0, nevis ar 1, kā tev ir? Link to comment Share on other sites More sharing options...
barons Posted March 18, 2005 Author Report Share Posted March 18, 2005 Pirmkārt, iemācies likt [ code ] BBtagus, citādi grūti tavu iepastoto kodu lasīt.Un pasaki, kur ir kļūda? Kas nestrādā šajā kodā? P.S. Gadījumā $i nav jāinicializē ar 0, nevis ar 1, kā tev ir? 15170[/snapback] 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; Link to comment Share on other sites More sharing options...
bubu Posted March 18, 2005 Report Share Posted March 18, 2005 Beigās pamaini savu kodu uz: for ($i = 1; $i<=$pages; $i++) { echo " [<a href='?page=$i'>$i</a>] "; } echo "</center>"; ?> Varbūt līdzēs. Un vispār, paņem padebugo. Uzliec while ciklā, lai drukājas mainīgie $i, $start, $end, paseko vērtību izmaiņām un izdari secinājumus. Link to comment Share on other sites More sharing options...
barons Posted March 18, 2005 Author Report Share Posted March 18, 2005 (edited) Nekaadas izmainjas :( es taa ar dariiju, bet pie nekaadiem secinaajumiem nenonaacu! Edited March 18, 2005 by barons Link to comment Share on other sites More sharing options...
barons Posted March 18, 2005 Author Report Share Posted March 18, 2005 man tas $i taads aizdomiigs paarsleedzot lapas nemainaas paliek 1, bet pirmaa lapaa veertiiba 10! Link to comment Share on other sites More sharing options...
Recommended Posts