SkyD Posted February 8, 2006 Report Share Posted February 8, 2006 Hmmzz.. Nu varbuut kaads pastaastiis, kaa dariit, lai vareetu komenteet bildes, kuras ir sabaaztas dazhaadaakajaas mapees.. Nu es piem izvadu aaaraa galerijas, tad uzejot uz vinjam atveras bildes, uzspiezhot uz kādu bildi lai padod vinju uz bildes_komenteet.php un tur var komenteet. Lai komentāri glabājas iekš MySQL. Un tad izvadīt tai bildei tos komentus.. Vo es tieši nesaprotu, pēc kā tās bildes atlasīt, jo viņām jau ID nav. Piem. velkot aaraa ierakstus ir ... (SELECT * FROM blabla WHERE id='$id') .., bet bildei - kā??! Varbūt kāds ir kko tml uztaisījis un var iedot man aplūkot. Link to comment Share on other sites More sharing options...
Vebers Posted February 8, 2006 Report Share Posted February 8, 2006 Uztaisi tabulu kurā ir bildes ID , URL un otru tabulu kurā ir bildes ID, komentārs, autors, utt. Tad arī velc bildes url ārā no mysql, un būs Tev ID ar visiem komentiem.. Link to comment Share on other sites More sharing options...
SkyD Posted February 8, 2006 Author Report Share Posted February 8, 2006 nu bet piem. ir direktorija -> bildes tur ieksh ir -> kruti.jpg, bilde1.jpg utt, ID buus tie nosaukumi?!! Link to comment Share on other sites More sharing options...
Vebers Posted February 8, 2006 Report Share Posted February 8, 2006 Nē, id liec (int) autoincrement, nu skaitli kas pats visu laiku pieaugs par vienu vienību, bet url ieliec bildes/kruti.jpg utt. piem., ID | URL 1 | bildes/kruti.jpg 2 | citas_bildes/bilde.jpg 3 | bildes/animacija.gif Link to comment Share on other sites More sharing options...
SkyD Posted February 8, 2006 Author Report Share Posted February 8, 2006 Nu krch /bildes/bilde1.jpg vajadzeetu, lai uzraada: ?dir=bildes&bilde=bilde1 .. A kad man vinjsh taas bildes ID ieliks ieksh MySQL ? Pie komentēšanas... Vai pie apskates?!! Link to comment Share on other sites More sharing options...
Vebers Posted February 8, 2006 Report Share Posted February 8, 2006 (edited) Uztaisi skriptu, kas visas bildes no direktorijas nolasa un ieliek to adresi iekš mysql, ar visu URL un id jau automātiski piešķirsies. Pie attēlošanas $q=mysql_query("SELECT * FROM tabula LIMIT 0, 10"); while($q=mysql_fetch_row($q)){ echo '<img src="'.$q[1].'" alt="bilde" />'; } Edited February 8, 2006 by MakaTaNaw Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 8, 2006 Report Share Posted February 8, 2006 glabaa bildes nosaukumu atseviskjaa char laukaa... tabula 1 bildes_id/nosaukums/ tabula 2 id. bildes_id.komentaars atlasiit(dabuut kursh komentaars kurai bildei) $mape='tava mape kur glabaajas bilde'; $bilde=''; SELECT ID FROM tabula1 WHERE nosaukums='nosaukums' SELECT komentars FROM tabula2 WHERE bildes_id='$bildes_ide_ko_dabuju_no_tabulas_1' -------- apmeeram taa P.S. galerijas vislabaak veidot ar SQL (protams ja vajag komentarus/parakstus utt) Link to comment Share on other sites More sharing options...
SkyD Posted February 8, 2006 Author Report Share Posted February 8, 2006 <? if ($handle = opendir('bilde/')) { while (false != ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<a href='bilde/".$file."'><img src='bilde/".$file."' width='20%' style='border: 1px solid green;'></a>\n"; } } closedir($handle); } ?> Tur man arii izmet thumbs.db .. Kaa dabuut vinju aara?? Link to comment Share on other sites More sharing options...
bubu Posted February 8, 2006 Report Share Posted February 8, 2006 jopcig... if ($file=="thums.db") { blabla } Link to comment Share on other sites More sharing options...
SkyD Posted February 8, 2006 Author Report Share Posted February 8, 2006 un ko lai es izdaru? :DD exit; ?? neder, paareejaas bildes vairs neraada. Link to comment Share on other sites More sharing options...
bubu Posted February 8, 2006 Report Share Posted February 8, 2006 Vairāk atbildēšu tev te, kad sapratīsi kā konstruē algoritmus un uzzīmēsi man blokshēmu savas problēmas atrisinājumam. Link to comment Share on other sites More sharing options...
SkyD Posted February 9, 2006 Author Report Share Posted February 9, 2006 Kādam, nav kāds vienkārš gallery skripts, kur var komentēt, kautvai, lai komenti saglabājas .txt dokumentos.. Vajag steidzami. Parakņāšos arī pa google.lv un citos resursos, bet palīdziet.. ! Link to comment Share on other sites More sharing options...
Paulinjsh Posted February 9, 2006 Report Share Posted February 9, 2006 (edited) Gatavu nerakstīsim, varam mēģināt palabot! Ideju jau tev tak uzrakstīja :P vai arī slikti meklē tantē :P~ Edited February 9, 2006 by Paulinjsh Link to comment Share on other sites More sharing options...
v3rb0 Posted February 9, 2006 Report Share Posted February 9, 2006 kāpēc visi domāt ka glabāt iekš flat txt failiem ir vienkāršāk nekā viens inserts un viens selects? un webā pa velti dabūjami galeriju scripti ir kaudzēm. Link to comment Share on other sites More sharing options...
SkyD Posted February 9, 2006 Author Report Share Posted February 9, 2006 Es nesaku, ka txt failos ir vieglaak glabaat. Link to comment Share on other sites More sharing options...
Recommended Posts