ch1zra Posted February 5, 2007 Report Share Posted February 5, 2007 treba mi (ako postoji) javascript fukncija (ili php, nebitno.. ) koja ce mi vracati broj linija odredjenog txt fajla. iam na ovoj mojoj bedi od stranice neku subscribe listu, pa ocu cisto negde da izbacim display number of subscribers Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
dvnityCker Posted February 5, 2007 Report Share Posted February 5, 2007 evo ti php resenje: $file = "chizra.txt"; $redovi = count(file($file)); echo "U fajlu ".$file." ima ".$redovi." linija"; trebalo bi da radi btw ako ti je stranica u html-u moras kod da stavis u php tagove - <?php kod ?> Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
ch1zra Posted February 6, 2007 Author Report Share Posted February 6, 2007 radi, ali izbacuje pre broja linija neki error... tipa "no such file in adresa/ch1zra/html/main.php on line 111" pa onda izbaci broj ispod ok. /me php megan00b :\ al aj, videcu da zbudzim nesto... samo pitanje, ako mi je fajl.txt u odnosu na main.php ovako : DIR main.php SUBDIR file.txt jel ja navodim ovako : $file = "SUBDIR/file.txt"; $redovi = count(file($file)); echo "U fajlu ".$file." ima ".$redovi." linija"; ? ili... ? Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
dvnityCker Posted February 6, 2007 Report Share Posted February 6, 2007 tako je ono, sutni fajl u main dir ako ponovo izbaci gresku daj kod Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
ch1zra Posted February 6, 2007 Author Report Share Posted February 6, 2007 a ne mogu... zato sto koristim txtlist ( http://txtbox.co.za/ ), a da nju celu prepravljam ne znam btw naterao sam ga da radi :) thanx. Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
ch1zra Posted February 11, 2007 Author Report Share Posted February 11, 2007 novi problem :) dakle, to sto radim, ovi hoce da im se random ucitavaju fotke na glavnoj, i to 3 komada. e sad, ja sam uspeo da skrpim nesto u javascriptu (koji btw dosta lici na mIRC scripting, pa sam se lako skontao) sto radi 3 random broja, pa to trpa u img tagove. fora je sto su sve fotke u istom folderu, numerisane od 0-48, pa samo lupi random broj, i ubaci ga ovako : var i = Math.round(48*Math.random() + 1) document.write('<img src=../img/photo/' + i + '.jpg>') e sad, tu sam posle ubacio provere tipa : var t = i var i = Math.round(48*Math.random() + 1) if (i!=t) { document.write('<img src=../img/photo/' + i + '.jpg>') koje proveravaju da li je broj koji se izbaci vec izbacen u prethodnom, pa da se ne poklapaju, tj da ne bude 2 iste slike, ili sve 3. jedina stvar koja me jebe je sto JS nema GOTO komandu, pa ne mogu da odradim nesto tipa : :PROVERA random broj if (random broj == prethodni random) { goto PROVERA } else { zapisi broj u img tag } ima li iko predstavu kako da sredim to... posto znam da ce ovom majmunu kad mu budem pokazivao sajt da se zadesi da lupi 2, ili cak sva 3 ista broja, pa ce mu ucitati samo 2, ili samo jednu sliku. a dok ja njemu objasnim da je to sve visa matematika, i da su sanse da se to desi 1 prema puno, ima da odlepim. tako da mi je lakse da skontam kako da resim ovo php resenje je isto welcome Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
voodoo_ Posted February 11, 2007 Report Share Posted February 11, 2007 izbegavaj goto, umesto njega odradi ne Quote Link to comment Share on other sites More sharing options...
Sa1Nt Posted February 11, 2007 Report Share Posted February 11, 2007 meni nije jasno zashto se ti toliko jebavash sa tim, kad imash masu php skripti online? Quote Link to comment Share on other sites More sharing options...
dvnityCker Posted February 11, 2007 Report Share Posted February 11, 2007 recimo da su ti slike ove slika_1.jpg slika_2.jpg . . slika_i.jpg <?php readfile("./images/slika_" . rand(1,KRAJNI_BROJ) . ".jpg"); ?> there, probaj tako Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
Junkie Posted February 11, 2007 Report Share Posted February 11, 2007 pusti bre coveka da se uci .. .ako stalno uzimas gotove skripte nece nista znati ko notj Quote Link to comment Share on other sites More sharing options...
dvnityCker Posted February 11, 2007 Report Share Posted February 11, 2007 nisam siguran da li treba neki content type il nesto, probaj ovako pa ako ne ide, ubacicemo kontent type Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
Sa1Nt Posted February 11, 2007 Report Share Posted February 11, 2007 pusti bre coveka da se uci .. .ako stalno uzimas gotove skripte nece nista znati ko notj koji ce mu moj javascript? narochito za ovu glupost :) Quote Link to comment Share on other sites More sharing options...
dvnityCker Posted February 11, 2007 Report Share Posted February 11, 2007 zatrebace mu jednom :) Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
Junkie Posted February 11, 2007 Report Share Posted February 11, 2007 koji ce mu moj javascript? narochito za ovu glupost :) pa ne kazem da mu nece nikad trebati , al to je korak ka samostalnom pisanju koda.... mislim, kolko si ti stvari naucio u zivotu s kojima mozes sad dupe da obrises? Quote Link to comment Share on other sites More sharing options...
dvnityCker Posted February 11, 2007 Report Share Posted February 11, 2007 Ax + By + Cz + D = 0 Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
ch1zra Posted February 12, 2007 Author Report Share Posted February 12, 2007 (edited) dvny, to imam i ja u JS-u odradjeno. ali fazon je sto ima malo slika, pa su sanse relativno velike da od 2 randoma opali 2x isti broj. i onda ce mi zveknuti 2x istu sliku. ili ako postavim uslov da drugi random ne sme da bude isti kao prvi, onda ce mi raspizditi samo jednu sliku (ako npr zelim 2 random da prikazem). e sad.. meni treba nesto tipa rekurzija, ili jebena GOTO komanda, koja u JS-u ne postoji. tako da mi treba nesto sto simulira GOTO. enivej, uradih nesto tipa : <script> var i = Math.round(48*Math.random()) document.write('<img src=../img/photo/' + i + '.jpg>') var t = i var g = i var img = 1 var i = Math.round(48*Math.random()) if (i!=t) { document.write('<img src=../img/photo/' + i + '.jpg>') img = img + 1 } var i = Math.round(48*Math.random()) if (i!=g && i!=t) { document.write('<img src=../img/photo/' + i + '.jpg>') img = img + 1 } if (img==2) { var i = Math.round(48*Math.random()) if (i!=g && i!=t) { document.write('<img src=../img/photo/' + i + '.jpg>') img = img + 1 } } </script> cisto eto.. da ako naleti neko podudaranje, da odradi jos jedan random... pa sad jebati ga ako od 4 randoma izbaci 3 ista. Edited February 12, 2007 by ch1zra Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
Junkie Posted February 12, 2007 Report Share Posted February 12, 2007 e da ... mozes i da uzmes litebox.. vrlo prosto gotovo resenje Quote Link to comment Share on other sites More sharing options...
Sa1Nt Posted February 12, 2007 Report Share Posted February 12, 2007 pa ne kazem da mu nece nikad trebati , al to je korak ka samostalnom pisanju koda.... mislim, kolko si ti stvari naucio u zivotu s kojima mozes sad dupe da obrises? mnogo, narochito u dizajnu ;) Quote Link to comment Share on other sites More sharing options...
dvnityCker Posted February 12, 2007 Report Share Posted February 12, 2007 hm tako mi i treba kad ne citam ceo post ne treba ti goto :) evo jedog od bezbroj nacina da se uradi, optimizovano za tri slike, da me ne mrzi napravio bih univerzalno resenje while ( $a == $b OR $b == $c OR $c == $a) { $a = rand(1,KB); $b = rand(1,KB); $c = rand(1,KB); } i onda ono echo "<img src=\"./images/slika_" . $a . ".jpg\" alt=\"nesto\" />"; i tako sve tri fotke naravno ne zaboravi php tagove <? ?> za vise slika uradi se for struktura sa $nesto promenljivom, gde je i prethodno definisani broj slika Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
ch1zra Posted February 12, 2007 Author Report Share Posted February 12, 2007 nesto mi je bagovalo to, ali sam nasao nacin ;] hohoho, ipak sam ja teh_w1ck3d_scripter elem, folder sa fotkama artista ima 37 slika, numerisanih isto kao i ove, 0-36. i sto bi se ja zajebavao da lupam 6 randoma (koliko mi treba za artiste), kad mogu da odradim jednostavno ovo : <script> var i = Math.round(36*Math.random()) var t = 0 for (t=0;t<6;t++) { document.write('<img src=../img/art/' + i + '.jpg> ') if (i==36) { var i = 0 } i++ } </script> I AM SO SMART !! S - M - R - T !!!! elem :==> http://bluesrockclub.org.yu/ jedino sto je ruzno kod stranice je sto je lik apsolutno zahtevao da se levo na glavnoj loaduju 3 fotke, zato sto ima rezoluciju 15** x 12**, (ne znam tacno koja je, ja furam 1024x768), pa mu "nekako izgleda prazno sa samo 2 slike". al bole me kurac, svakako je lepsa od stare strane, a i ima moju reklamu.. hohohoho, I R teh_masterer Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
dvnityCker Posted February 12, 2007 Report Share Posted February 12, 2007 to nije bas random :) uvek ces imati isti sled slika Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
ch1zra Posted February 12, 2007 Author Report Share Posted February 12, 2007 pa da, samo zavisi od koje ce da pocne a i sajt je posecen do mojega, znas ko ce da primeti... uostalom, interesuje me da li ce iko primetiti i to da svaki put izbacuje razlicite slike nemoj dam i kvaris rados' hohoho, I R teh_masterer ! Quote Ko je nub ne budi mu drug. I mean you harm. Link to comment Share on other sites More sharing options...
dvnityCker Posted February 12, 2007 Report Share Posted February 12, 2007 evo ga ch1zro prijatelju, testirano, ova skripta ce izbacivati $broj razlicitih random brojeva i samim tim i slika; <? $broj = BROJ_SLIKA_ZA_ISPIS; for ($i=1; $i<=$broj; $i++) { $a[$i] = rand(1,KRAJNJI_BROJ); for ($j=1; $j<=$broj; $j++) { if ($i!=$j) { while ($a[$i] == $a[$j]) { $a[$i] = rand(1,KRAJNJI_BROJ); $j = 1; } } } echo "<img src=\"slika_" .$a[i]. ".jpg\" alt=\"nesto\">"; echo "<br />"; } ?> lepote li :) hoho i am teh masterer th3n y0u :P :) Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
Junkie Posted February 12, 2007 Report Share Posted February 12, 2007 (edited) e matori.. 2 stvari... 1) sto si radio u frejmovima a ne u tabelama nesreco??? 2)smanji font slobodno .. meni je u 1280 velik.. a plasim se da smeknem u 1024 mada ni ja nisam bolji kad radim pro-bono... http://www.voodoo-rock-club.co.yu ... s tim sto narafno nigde ne pise ko je radio niti ce edit: sredjen link Edited February 13, 2007 by Junkie Quote Link to comment Share on other sites More sharing options...
dvnityCker Posted February 12, 2007 Report Share Posted February 12, 2007 za pro-bono skinem paket malo optimize i zdravo Quote The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.