eT` Posted May 19, 2008 Report Share Posted May 19, 2008 Kāds nevar pateikt kā var uzlikt tā ka pēc katra refresh mainās banneris? piem. kods vienalga kādā secībā ņem no noteikta foldera banneru failus un attēlo. Link to comment Share on other sites More sharing options...
Vebers Posted May 19, 2008 Report Share Posted May 19, 2008 http://php.net/rand ielasi visus failu nosaukumus masīvā, tad izskaiti cik ierakstu ir masīvā (count) un pēc rand attēlo kādu no masīva ierakstiem. Link to comment Share on other sites More sharing options...
eT` Posted May 19, 2008 Author Report Share Posted May 19, 2008 (edited) ne man vajag lai piem. uz refreshu mainas banneris. HTML kodā kautvai pats sadrukāšu viņiem visiem atrašanās vietas bet nezinu kā lai izdara ka uz refresh mainās :( bija ideja ko šādu: <h2>Reklāma</h2> <table width=100% border=1 cellspacing=0 cellpadding=10><tr><td align=left> <table class=main border=1 cellspacing=0 cellpadding=5> <script LANGUAGE="JavaScript"> <!-- Begin var how_many_ads = 1; var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) { url="http://unique.alhost.lv/"; banner="http://access.oo.lv/bildes/ubt.png"; width="468"; height="60"; } document.write('<center>'); document.write('<a href=\"' + url + '\" target=\"_top\">'); document.write('<img src=\"' + banner + '\" width=') document.write(width + ' height=' + height + ' '); document.write('alt=\"' + alt + '\" border=0><br>'); document.write('<small>' + txt + '</small></a>'); document.write('</center>'); // End --> </SCRIPT> </table></td></tr></table> Bet nezinu vai ir pareizi :( Edited May 19, 2008 by eT` Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 19, 2008 Report Share Posted May 19, 2008 tev obligati vajag HTML / JAvaScript?? Link to comment Share on other sites More sharing options...
v3rb0 Posted May 19, 2008 Report Share Posted May 19, 2008 <img src="" id="banneris" /> <script type="text/javascript"> var banneri = ["img1.gif", "img2.gif", "img3.gif"]; document.getElementById("banneris").src= banneri[Math.floor(Math.random() * banneri.length)]; </script> Link to comment Share on other sites More sharing options...
eT` Posted May 19, 2008 Author Report Share Posted May 19, 2008 Grey_Wolf kas tur slikts? :/ Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 19, 2008 Report Share Posted May 19, 2008 eT` --> Es jau nesaku ka slikts ;) Tikai pajautaju vai tiesham tas ir nepiecieshams.... Link to comment Share on other sites More sharing options...
eT` Posted May 21, 2008 Author Report Share Posted May 21, 2008 Nu uzliku šo nezinu vai man tas JS ir nepieciešams vai kā, bet galvenais ka strādā :D Link to comment Share on other sites More sharing options...
Aleksejs Posted May 21, 2008 Report Share Posted May 21, 2008 Iesaku tomēr papūlēties saprast, kas un kāpēc tajā kodā sarakstīts. Citādi brīdī, kad nebūs, kam padomu prasīt, būsi ļoti satraucies. Bet ļoti satraukties ir kaitīgi. ;) Link to comment Share on other sites More sharing options...
eT` Posted May 22, 2008 Author Report Share Posted May 22, 2008 Tātad labāk būtu likt to v3rb0 variantu? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 23, 2008 Report Share Posted May 23, 2008 (edited) eT` --> Viss tachu atkariigs, ko iisti gribi panaakt.... Taadelj arii jautaaju Vai Obligati nepiecieshams JavaScripts...... Abi ieteiktie varianti ir stradajoshi, un izmantojami .... --- PHP dod lielakas iespejas dinamiski mainiit saturu , JS vairak izmantojams Ja lapas saturs praktiski nemainiisies (Runaju par konkreto gadijumu), vai tiks izmantots Bez Php ..... (teiksim baneru exchange variantiem ....) ----- Tieshi baneriem izmantotu PHP .... jo vajadziigs tachu arii mainiit URL .... --------------- Edited May 23, 2008 by Grey_Wolf Link to comment Share on other sites More sharing options...
Recommended Posts