Forum gratuit: forum de suport al utilizatorilor
Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

Problema script logo change on refresh

Pagina 1 din 2 1, 2  Urmatorul

Vezi subiectul anterior Vezi subiectul urmator In jos

Rezolvat Problema script logo change on refresh

Mesaj Scris de domi Joi Iul 07, 2011 12:25 am

Deci , am reusit sa fac un script pentru ca , atunci cand dai refresh la pagina logo-ul sa se schimbe , dar nu stiu cum se poate pune .
Script-ul :
Cod:
<SCRIPT LANGUAGE="JavaScript">

var theImages = new Array()

theImages[0] = 'http://img824.imageshack.us/img824/2517/logo1dw.jpg'
theImages[1] = 'http://img706.imageshack.us/img706/3752/logo2fv.jpg'
theImages[2] = 'http://img818.imageshack.us/img818/8099/logo3eu.jpg'
theImages[3] = 'http://img854.imageshack.us/img854/7679/logo4q.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
  preBuffer[i] = new Image()
  preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->
</script>


Ultima editare efectuata de catre domi in Joi Iul 07, 2011 12:03 pm, editata de 2 ori
avatar

domi
Membru nou

Mesaje : 6
Data înscrierii : 07/07/2011
Mulțumiri : 0
Internet Explorer

http://rsmtest.forumz.ro/
domi a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de Qouk Joi Iul 07, 2011 12:30 am

Ce versiune folosesti?
Qouk

Qouk
Membru Forumgratuit

Mesaje : 314
Varsta : 29
Localizare : ForumGratuit
Data înscrierii : 03/07/2011
Mulțumiri : 0
Internet Explorer phpBB2

Qouk a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de domi Joi Iul 07, 2011 12:32 am

Folosesc phpBB2


Ultima editare efectuata de catre domi in Joi Iul 07, 2011 12:54 am, editata de 1 ori
avatar

domi
Membru nou

Mesaje : 6
Data înscrierii : 07/07/2011
Mulțumiri : 0
Internet Explorer

http://rsmtest.forumz.ro/
domi a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de Qouk Joi Iul 07, 2011 12:36 am

Spoiler:

P.A. => Afisare => Template-uri => General => overall_header.
Inlocuiesti:
Cod:

                  <!-- END switch_logo_left -->
                  <td align="center" width="100%" valign="middle">
                     <!-- BEGIN switch_logo_center -->
                     <a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a>
                     <br />
                     <!-- END switch_logo_center -->
                     <div class="maintitle">{MAIN_SITENAME}</div>
                     <br />
                     <span class="gen">{SITE_DESCRIPTION}<br />  </span>
                  </td>
                  <!-- BEGIN switch_logo_right -->
                  <td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
                  <!-- END switch_logo_right -->

cu:
Cod:

    <SCRIPT LANGUAGE="JavaScript">

    var theImages = new Array()

    theImages[0] = 'http://img824.imageshack.us/img824/2517/logo1dw.jpg'
    theImages[1] = 'http://img706.imageshack.us/img706/3752/logo2fv.jpg'
    theImages[2] = 'http://img818.imageshack.us/img818/8099/logo3eu.jpg'
    theImages[3] = 'http://img854.imageshack.us/img854/7679/logo4q.jpg'

    var j = 0
    var p = theImages.length;
    var preBuffer = new Array()
    for (i = 0; i < p; i++){
      preBuffer[i] = new Image()
      preBuffer[i].src = theImages[i]
    }
    var whichImage = Math.round(Math.random()*(p-1));
    function showImage(){
    document.write('<img src="'+theImages[whichImage]+'">');
    }

    //  End -->
    </script>

P.S. Nu sunt sigur ca va functiona Supărat
Qouk

Qouk
Membru Forumgratuit

Mesaje : 314
Varsta : 29
Localizare : ForumGratuit
Data înscrierii : 03/07/2011
Mulțumiri : 0
Internet Explorer phpBB2

Qouk a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de domi Joi Iul 07, 2011 12:46 am

Am inlocuit
Cod:
  <!-- END switch_logo_left -->
                  <td align="center" width="100%" valign="middle">
                    <!-- BEGIN switch_logo_center -->
                    <a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a>
                   

                    <!-- END switch_logo_center -->
                    <div class="maintitle">{MAIN_SITENAME}</div>
                   

                    <span class="gen">{SITE_DESCRIPTION}
  </span>
                  </td>
                  <!-- BEGIN switch_logo_right -->
                  <td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
                  <!-- END switch_logo_right -->
cu
Cod:

    <SCRIPT LANGUAGE="JavaScript">

    var theImages = new Array()

    theImages[0] = 'http://img824.imageshack.us/img824/2517/logo1dw.jpg'
    theImages[1] = 'http://img706.imageshack.us/img706/3752/logo2fv.jpg'
    theImages[2] = 'http://img818.imageshack.us/img818/8099/logo3eu.jpg'
    theImages[3] = 'http://img854.imageshack.us/img854/7679/logo4q.jpg'

    var j = 0
    var p = theImages.length;
    var preBuffer = new Array()
    for (i = 0; i < p; i++){
      preBuffer[i] = new Image()
      preBuffer[i].src = theImages[i]
    }
    var whichImage = Math.round(Math.random()*(p-1));
    function showImage(){
    document.write('<img src="'+theImages[whichImage]+'">');
    }

    //  End -->
    </script>

si cand apas butonul "inregistrare" primesc eroarea :
Cod:
"Baliza a fost inchisa inainte de a fi deschisa sau baliza nu a fost deschisa."

Si nu se schimba nimic =/

EDIT :

Am pus script-ul putin mai sus la begin switch logo left si am reusit sa evit acea eroare , dar acum logo-ul a disparut si primul lucru pe pagina este navigation bar-ul .
avatar

domi
Membru nou

Mesaje : 6
Data înscrierii : 07/07/2011
Mulțumiri : 0
Internet Explorer

http://rsmtest.forumz.ro/
domi a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de ApLy aLx Joi Iul 07, 2011 1:19 am

Stiu eu care e problema cred ca ai pus codul dupa </html> -> ceea ce e inchiderea codului.
Incearca sa l pozitionezi mai sus.
ApLy aLx

ApLy aLx
Membru Forumgratuit

Mesaje : 73
Localizare : Fotball
Data înscrierii : 23/06/2011
Mulțumiri : 0
Internet Explorer phpBB2

http://aply-zone.forumz.ro
ApLy aLx a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de domi Joi Iul 07, 2011 1:25 am

Nu , am pus codul mai sus de /html ...
Ar trebuii sa postez tot codul din overall_header ? Asta ar ajuta ?
avatar

domi
Membru nou

Mesaje : 6
Data înscrierii : 07/07/2011
Mulțumiri : 0
Internet Explorer

http://rsmtest.forumz.ro/
domi a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de ApLy aLx Joi Iul 07, 2011 1:32 am

Qouk a scris:
Spoiler:

P.A. => Afisare => Template-uri => General => overall_header.
Inlocuiesti:
Cod:

                  <!-- END switch_logo_left -->
                  <td align="center" width="100%" valign="middle">
                     <!-- BEGIN switch_logo_center -->
                     <a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a>
                     

                     <!-- END switch_logo_center -->
                     <div class="maintitle">{MAIN_SITENAME}</div>
                     

                     <span class="gen">{SITE_DESCRIPTION}
  </span>
                  </td>
                  <!-- BEGIN switch_logo_right -->
                  <td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
                  <!-- END switch_logo_right -->

cu:
Cod:

    <SCRIPT LANGUAGE="JavaScript">

    var theImages = new Array()

    theImages[0] = 'http://img824.imageshack.us/img824/2517/logo1dw.jpg'
    theImages[1] = 'http://img706.imageshack.us/img706/3752/logo2fv.jpg'
    theImages[2] = 'http://img818.imageshack.us/img818/8099/logo3eu.jpg'
    theImages[3] = 'http://img854.imageshack.us/img854/7679/logo4q.jpg'

    var j = 0
    var p = theImages.length;
    var preBuffer = new Array()
    for (i = 0; i < p; i++){
      preBuffer[i] = new Image()
      preBuffer[i].src = theImages[i]
    }
    var whichImage = Math.round(Math.random()*(p-1));
    function showImage(){
    document.write('<img src="'+theImages[whichImage]+'">');
    }

    //  End -->
    </script>

P.S. Nu sunt sigur ca va functiona Supărat


Daca te ai gandit la ce am spus eu si face ce a zis el va merge.
Te rog fi atent la detalii.
ApLy aLx

ApLy aLx
Membru Forumgratuit

Mesaje : 73
Localizare : Fotball
Data înscrierii : 23/06/2011
Mulțumiri : 0
Internet Explorer phpBB2

http://aply-zone.forumz.ro
ApLy aLx a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de Qouk Joi Iul 07, 2011 1:39 am

Am testat pe un forum de teste, nu functioneaza. Problema script logo change on refresh Icon_rolleyes
E din cauza script-ului...
Qouk

Qouk
Membru Forumgratuit

Mesaje : 314
Varsta : 29
Localizare : ForumGratuit
Data înscrierii : 03/07/2011
Mulțumiri : 0
Internet Explorer phpBB2

Qouk a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de domi Joi Iul 07, 2011 1:53 am

Am incercat si eu si am observat ca e gresit asa ca l-am corectat
Cod:
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()

//Random-loading images
theImages[0] = 'http://img824.imageshack.us/img824/2517/logo1dw.jpg'
theImages[1] = 'http://img706.imageshack.us/img706/3752/logo2fv.jpg'
theImages[2] = 'http://img818.imageshack.us/img818/8099/logo3eu.jpg'
theImages[3] = 'http://img854.imageshack.us/img854/7679/logo4q.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=452 height=181></a>');
}
else if(whichImage==1){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=823 height=306></a>');
}
else if(whichImage==2){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=823 height=306></a>');
}
else if(whichImage==3){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=823 height=306></a>');
}
else if(whichImage==4){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=823 height=306></a>');
}

}

</script>

<script>showImage();</script>

Doar ca nu reusesc sa-l fac sa apara in locul logo-ului .
avatar

domi
Membru nou

Mesaje : 6
Data înscrierii : 07/07/2011
Mulțumiri : 0
Internet Explorer

http://rsmtest.forumz.ro/
domi a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de ApLy aLx Joi Iul 07, 2011 1:58 am

domi a scris:Deci , am reusit sa fac un script pentru ca , atunci cand dai refresh la pagina logo-ul sa se schimbe , dar nu stiu cum se poate pune .
Script-ul :
Cod:
<SCRIPT LANGUAGE="JavaScript">

var theImages = new Array()

theImages[0] = 'http://img824.imageshack.us/img824/2517/logo1dw.jpg'
theImages[1] = 'http://img706.imageshack.us/img706/3752/logo2fv.jpg'
theImages[2] = 'http://img818.imageshack.us/img818/8099/logo3eu.jpg'
theImages[3] = 'http://img854.imageshack.us/img854/7679/logo4q.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
  preBuffer[i] = new Image()
  preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->
</script>

Probabil ai creat scriptul gresit.
ApLy aLx

ApLy aLx
Membru Forumgratuit

Mesaje : 73
Localizare : Fotball
Data înscrierii : 23/06/2011
Mulțumiri : 0
Internet Explorer phpBB2

http://aply-zone.forumz.ro
ApLy aLx a fost mulțumit de autorul acestui subiect.

Rezolvat Re: Problema script logo change on refresh

Mesaj Scris de Emanuel. Joi Iul 07, 2011 7:30 am

Greu , greu....
Cauta :
Cod:

            <table width="100%" cellspacing="0" cellpadding="0" border="0">
               <tr>
                  <!-- BEGIN switch_logo_left -->
                  <td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
                  <!-- END switch_logo_left -->
                  <td align="center" width="100%" valign="middle">
                     <!-- BEGIN switch_logo_center -->
                     <a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a>
                     <br />
                     <!-- END switch_logo_center -->
                     <div class="maintitle">{MAIN_SITENAME}</div>
                     <br />
                     <span class="gen">{SITE_DESCRIPTION}<br />  </span>
                  </td>
                  <!-- BEGIN switch_logo_right -->
                  <td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
                  <!-- END switch_logo_right -->
               </tr>
            </table>
Iar dupa adaugi:

Cod:


<script language="JavaScript">
images = new Array(4);

images[0] = "<a href = 'LINK:1'><img src='http://img824.imageshack.us/img824/2517/logo1dw.jpg'></a>";
images[1] = "<a href = 'LINK:2'><img src='http://img706.imageshack.us/img706/3752/logo2fv.jpg'></a>";
images[2] = "<a href = 'LINK:3'><img src='http://img818.imageshack.us/img818/8099/logo3eu.jpg'></a>";
images[3] = "<a href = 'LINK:4'><img src='http://img854.imageshack.us/img854/7679/logo4q.jpg'></a>";

index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</script>
avatar

Emanuel.
Membru Forumgratuit

Mesaje : 367
Varsta : 18
Data înscrierii : 24/04/2011
Mulțumiri : 0
Internet Explorer phpBB2

http://onlinesupport.wikiforum.net
Emanuel. a fost mulțumit de autorul acestui subiect.

Pagina 1 din 2 1, 2  Urmatorul

Vezi subiectul anterior Vezi subiectul urmator Sus

- Subiecte similare

Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum