Problème avec fond dépendant du N° de Forum

4 participants

Voir le sujet précédent Voir le sujet suivant Aller en bas

Résolu Problème avec fond dépendant du N° de Forum

Message par Zuny Lun 7 Oct 2013 - 11:38

Bonjour!
J'ai récemment installé le script ci-dessous...


Code:
var id_forum;
var bg_forum;
function BackgroundForum(id_forum,bg_forum){
   this.id_forum = id_forum;
   this.bg_forum = bg_forum;
}

var tableau_background_id = new Array();
tableau_background_id[0] = new BackgroundForum("21","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[1] = new BackgroundForum("178","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[2] = new BackgroundForum("176","http://img11.hostingpics.net/pics/788164OniFond.jpg");
tableau_background_id[3] = new BackgroundForum("121","http://img11.hostingpics.net/pics/596658CinqFlches.jpg");
tableau_background_id[4] = new BackgroundForum("204","http://img11.hostingpics.net/pics/200927Hemato.jpg");
tableau_background_id[5] = new BackgroundForum("183","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[6] = new BackgroundForum("180","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[7] = new BackgroundForum("144","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[8] = new BackgroundForum("151","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[9] = new BackgroundForum("147","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[10] = new BackgroundForum("148","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[11] = new BackgroundForum("149","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[12] = new BackgroundForum("150","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[13] = new BackgroundForum("166","http://img11.hostingpics.net/pics/194716MilitaryFond.jpg");
tableau_background_id[14] = new BackgroundForum("15","http://img11.hostingpics.net/pics/522804MandresFonds.jpg");
tableau_background_id[15] = new BackgroundForum("16","http://img11.hostingpics.net/pics/144729MemoryFOND.jpg");
tableau_background_id[16] = new BackgroundForum("14","http://img11.hostingpics.net/pics/315248TheHeartFond.jpg");
tableau_background_id[17] = new BackgroundForum("179","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[18] = new BackgroundForum("181","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[19] = new BackgroundForum("182","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[20] = new BackgroundForum("225","http://img11.hostingpics.net/pics/708301SlaveMarket.jpg");
tableau_background_id[21] = new BackgroundForum("175","http://img4.hostingpics.net/pics/326466Bibliotheque.png");
tableau_background_id[22] = new BackgroundForum("28","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[23] = new BackgroundForum("27","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[24] = new BackgroundForum("26","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[25] = new BackgroundForum("22","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[26] = new BackgroundForum("224","http://img4.hostingpics.net/pics/411356Appartement.png");
tableau_background_id[27] = new BackgroundForum("159","http://img4.hostingpics.net/pics/411356Appartement.png");

function findBackgroundByURL(url){
   for(i=0;i<tableau_background_id.length;i++){
      if(url.search("f"+tableau_background_id[i].id_forum) != -1){
         return tableau_background_id[i];
      }
      if($("a.nav:last").attr("href").search("f"+tableau_background_id[i].id_forum) != -1){
         return tableau_background_id[i];
      }
   }
   return null;
}

$(function(){
   var background_id = findBackgroundByURL(document.URL);
   if(background_id != null){
      $("body").css("background-image","url("+background_id.bg_forum+")");
   }
});


Dernière édition par Zuny le Ven 11 Oct 2013 - 8:31, édité 1 fois
Zuny

Zuny
**

Féminin
Messages : 94
Inscrit(e) le : 11/04/2013

http://esgalduin.fantastique.tv/
Zuny a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Problème avec fond dépendant du N° de Forum

Message par Zuny Lun 7 Oct 2013 - 13:16

-> Up
J'ai trouvée une solution provisoire (mettre les plus gros chiffres en premier) mais ça ne marche pas complétement. (en gros ça marche pour les fonds qui sont dans les lignes, mais je voudrais aussi le fond par défaut là où je n'ai rien demandé et ça, ça marche pas en mettant les plus grand nombre à la fin.) J'ai donc toujours besoin d'une correction de code. Un petit élément pour dire "tu t'arrêtes au chiffre demandé, point".
Zuny

Zuny
**

Féminin
Messages : 94
Inscrit(e) le : 11/04/2013

http://esgalduin.fantastique.tv/
Zuny a été remercié(e) par l'auteur de ce sujet.
  • 0

Résolu Re: Problème avec fond dépendant du N° de Forum

Message par MasDan Mar 8 Oct 2013 - 1:44

Bonjour Zuny,

Il y a toujours un tiret après le numéro, il s'agit de l'ajouter lors de la recherche.

Donc au lieu de rechercher «F3» utiliser plutôt «F3-»; ainsi plus de confusion avec 3, 30, 300.
MasDan

MasDan
Membre habitué

Masculin
Messages : 1538
Inscrit(e) le : 24/05/2011

http://projetAumMdn.forumactif.com
MasDan a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Problème avec fond dépendant du N° de Forum

Message par Zuny Mer 9 Oct 2013 - 10:48

Hey!
Merci beaucoup. Ça a l'air de marcher.
Sujet résolu donc Smile
Zuny

Zuny
**

Féminin
Messages : 94
Inscrit(e) le : 11/04/2013

http://esgalduin.fantastique.tv/
Zuny a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Problème avec fond dépendant du N° de Forum

Message par Chacha Mer 9 Oct 2013 - 10:52

Problème avec fond dépendant du N° de Forum Check10Bonjour,

Afin de faciliter la gestion des problèmes, si votre problème est résolu, pensez à :
  • éditer votre premier message,
  • cocher l'icône résolu
  • Et enregistrer en cliquant sur Problème avec fond dépendant du N° de Forum Envoi10


Vous pouvez également remercier les personnes qui vous ont aidé, en cliquant sur le bouton Problème avec fond dépendant du N° de Forum 50378

A bientôt sur ForumActif Smile
Chacha

Chacha
Modéractif
Modéractif

Masculin
Messages : 69301
Inscrit(e) le : 21/08/2010

https://forum.forumactif.com/
Chacha a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Problème avec fond dépendant du N° de Forum

Message par AenigmA Mer 9 Oct 2013 - 11:58

Juste un merci à MasDan car j'utilise aussi ce java de ZZ10 (je crois) +1
AenigmA

AenigmA
Membre actif

Masculin
Messages : 2228
Inscrit(e) le : 10/03/2005

http://aenigma.forumactif.fr/
AenigmA a été remercié(e) par l'auteur de ce sujet.

Voir le sujet précédent Voir le sujet suivant Revenir en haut


Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum