Klez Posted February 1, 2004 Report Share Posted February 1, 2004 (edited) Lieta taada, ka direktorijaa meetaajas kaadas 100 bildes. Tiku tik taalu, kad lietotaajas, kas skataas bildes ievada cik bildes paraadaiit vienaa lapaa. piem 10. tachu vajag dabuut linku uz naakoshajaam 10 bildeem. nu taa arii ir taa probleema. varbuut kaadam kaads scripts jau ir gadavs. luudzu paliidziet! P.S negribas shitajaa visaa MYSQL piit iekshaa! Edited February 1, 2004 by Klez Link to comment Share on other sites More sharing options...
hu_ha Posted February 1, 2004 Report Share Posted February 1, 2004 nu tu paraadi kaads tev ir tas skripts.. tad veel pastaasti, kaadi ir nosaukumi bildeem, tipa 1.jpg, 2jpg utt, vai kaut kaadi "asdas.jpg", "erytr.jpg".. viens variants ir paarnosaukt bildes ar cipariem 1,2,3.. .jpg un tad vareesi no $_GET['bildes_id'] njemt naakamaas 10 bildes ja nav numureetas, tad laikam nekas cits neatliek, kaa dziit visu direktoriju masiivaa un attieciigi izvaakt pirmaas 10, tad naakoshaas utt.. Link to comment Share on other sites More sharing options...
Klez Posted February 1, 2004 Author Report Share Posted February 1, 2004 (edited) <? $ic = $HTTP_GET_VARS['ic']; $d_handle = opendir("./"); while(($f_name = readdir($d_handle)) != false){ if((substr($f_name,-3,3) == "jpg") || (substr($f_name,-3,3) == "gif")){ $m_arr[count($m_arr)] = $f_name; } } closedir($d_handle); sort($m_arr); if (!$ic){ $ic = 5; } $i = 1; while($m_item = each($m_arr)){ $i++; $len = strlen($m_item[1])-6; $m_item_id = substr($m_item[1],2,$len); //echo $m_item; print ("<img src='$m_item[1]'><br>"); if ($i > $ic) { echo "<a href='?ic=$ic'>Next $ic images</a>"; exit; } } ?> </body> </html> mainiigais $ic to caur get nodod cik bildes raadiit lapaa nu shitaads. varbuut buus vieglaak uztaisiit rename scriptu, kas bildes nosaukumus paartaisa 1.jpg 2.jpg utt Edited February 1, 2004 by Klez Link to comment Share on other sites More sharing options...
Recommended Posts