tk1 Posted December 29, 2006 Report Share Posted December 29, 2006 Nu uztaisiju taa lai vareetu uploudot ateelus, taakaa negribeeju nemties ar db viss ir ta ka bildes saglabaajas web/var papee, un tgd man vajadzetu kaadu skriptu kas visus tajaa mapee atrodamos img failus vareetu izvadiit tabulaa piem pa 50 bildem! Tas ir iespejams vai man labak caur db jav sakt taisit :D ??? Link to comment Share on other sites More sharing options...
Delfins Posted December 29, 2006 Report Share Posted December 29, 2006 DB vari glabāt nosaukumus Link to comment Share on other sites More sharing options...
andrisp Posted December 29, 2006 Report Share Posted December 29, 2006 php.net/opendir Link to comment Share on other sites More sharing options...
tk1 Posted December 29, 2006 Author Report Share Posted December 29, 2006 Cik es sapratu tas opendir parada kadi faili atrodas noraaditaja papee, a ka izdariit taa lai raada bildi piem 120x120 kautvai vinja ir 950x700 ? Bet pats galvenais lai vsp bildi parada nevis tas nosaukumu! Link to comment Share on other sites More sharing options...
march Posted December 29, 2006 Report Share Posted December 29, 2006 echo "<img src=\"$bildes_nosaukums\" width=\"120\" height=\"120\">"; Link to comment Share on other sites More sharing options...
andrisp Posted December 29, 2006 Report Share Posted December 29, 2006 width un height vari dabūt ar imagex un imagey fjām. Link to comment Share on other sites More sharing options...
tk1 Posted December 29, 2006 Author Report Share Posted December 29, 2006 march tu nesaprati! :D Piemeram skripts <?phpif ($handle = opendir('var/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file\n"; } } closedir($handle); } ?> Vins parada tikai bilzu nosaukumus bet man vajag lai vinjs paraditu bildes izmeros 75x100! Link to comment Share on other sites More sharing options...
march Posted December 29, 2006 Report Share Posted December 29, 2006 Ko es nesapratu? echo "$file\n"; vietā liec echo "<img src=\"var/$file\" width=\"75\" height=\"100\">"; Link to comment Share on other sites More sharing options...
tk1 Posted December 29, 2006 Author Report Share Posted December 29, 2006 Ko es nesapratu? echo "$file\n"; vietā liec echo "<img src=\"var/$file\" width=\"75\" height=\"100\">"; Pladies :) Link to comment Share on other sites More sharing options...
Stopp Posted December 29, 2006 Report Share Posted December 29, 2006 Nu, resaizojot HTML-ā, ielādējas liela bilde, kas aizņem padaudz laika. Turklāt pārlūkprogramma parasti resaizo ļoti nekvalitatīvi. Labāk ņem ar imagecreatefromjpeg, imageresize, imagejpeg, imagedestroy funkcijām. Un tad citā failā ar HTML parādīt jau PHP resaizoto bildi. Visdrīzāk shēma varētu būt aptuveni tāda - <img src="resaizotabile.php?bilde=kautkas.jpg&augstums=200&platums=250"/> Nu, tad tai PHP failā paņem mērus no GET masīva. Drošāk gan būtu kaut kādā veidā izvairīties no paša faila nosaukšanas caur URLi. Link to comment Share on other sites More sharing options...
Slammer Posted December 29, 2006 Report Share Posted December 29, 2006 tk1 tikai neaizmirsti uztaisīt tā lai varētu ielādēt tikai bildes nevis visādus citus brīnumus.. r57 :D Link to comment Share on other sites More sharing options...
tk1 Posted December 30, 2006 Author Report Share Posted December 30, 2006 Nja censos! stc tgd man deretu tada manta ka no tas papes izvaditu tikai 1 attelu un nejausu izmeros kur uz 100x150! Butu kads manualis? Link to comment Share on other sites More sharing options...
SkyD Posted December 30, 2006 Report Share Posted December 30, 2006 <? $bildes=10; //bilzhu skaits mapee! $rnd=rand(1,$bildes); echo '<img src="bildes/bilde_'.$rnd.'.jpg" width="150px" height="100px">'; //bilzhu nosaukumiem jabuut bilde_1.jpg, bilde_2.jpg ?> Link to comment Share on other sites More sharing options...
tk1 Posted December 30, 2006 Author Report Share Posted December 30, 2006 paldies Link to comment Share on other sites More sharing options...
andrisp Posted December 30, 2006 Report Share Posted December 30, 2006 (edited) stc tgd man deretu tada manta ka no tas papes izvaditu tikai 1 attelu un nejausu izmeros kur uz 100x150! Tu mums par idiotiem turi ? Ja gribi, lai tev palīdz, tad piedomā līdzi kā un ko raksti. 5 reizes dabūju pārlasīt vienu teikumu, lai saprastu. Izmanto komatus galu galā! Edited December 30, 2006 by andrisp Link to comment Share on other sites More sharing options...
Recommended Posts