[Doc] Plusieurs largeurs de forums dans un même template

Découvrez ici une liste de documents concernant phpBB: son installation, sa mise à jour et enfin son utilisation.
En bref, apprenez ici à vous servir de phpBB2!

Modérateur: Equipe

Règles du forum
A lire impérativement sur notre page : Règlement

[Doc] Plusieurs largeurs de forums dans un même template

Messagepar abble » 17 Aoû 2006 à 17:34

Plusieurs largeurs de forums dans un même template ( par FRANCKYIV )

But du tutoriel :
- Avoir plusieurs "sous-templates" de subSilver ayant une résolution différente, résolutions à choisir dans votre profil.

:arrow: subSilver (avec une résolution horizontale de 100%)
:arrow: subSilver1024 (avec une résolution horizontale de 1024 pixels)
:arrow: subSilver800 (avec une résolution horizontale de 800 pixels)

- Pour notre tutoriel, nous allons débuter avec un forum PHPBB en version 2.0.21 fraichement installé.


    Image Info: Cette documentation est faite à partir d'un thème de base subSilver version 2.0.21.


I) » Mise en variable de la largeur.

    Ouvrir le fichier :
    » /templates/subSilver/overall_header.tpl

II) » Création des "sous-templates".

    Ouvrir le fichier :
    » /templates/subSilver/theme_info.cfg

    Image Ce qu'il faut savoir sur ce fichier :

    $subSilver[0]
    Le chiffre 0 représente le premier "sous-template".

    ['template_name']
    représente le nom du template.

    ['style_name']
    représente le nom du "sous-template".

    ['body_background']
    représente la taille de la largeur du corps.


    Rechercher :
    Code: Tout sélectionner
    <?php
    
    //
    // phpBB 2.x auto-generated theme config file for subSilver
    // Do not change anything in this file!
    //
    
    $subSilver[0]['template_name'] = "subSilver";
    $subSilver[0]['style_name'] = "subSilver";
    $subSilver[0]['head_stylesheet'] = "subSilver.css";
    $subSilver[0]['body_background'] = "";
    $subSilver[0]['body_bgcolor'] = "E5E5E5";
    $subSilver[0]['body_text'] = "000000";
    $subSilver[0]['body_link'] = "006699";
    $subSilver[0]['body_vlink'] = "5493B4";
    $subSilver[0]['body_alink'] = "";
    $subSilver[0]['body_hlink'] = "DD6900";
    $subSilver[0]['tr_color1'] = "EFEFEF";
    $subSilver[0]['tr_color2'] = "DEE3E7";
    $subSilver[0]['tr_color3'] = "D1D7DC";
    $subSilver[0]['tr_class1'] = "";
    $subSilver[0]['tr_class2'] = "";
    $subSilver[0]['tr_class3'] = "";
    $subSilver[0]['th_color1'] = "98AAB1";
    $subSilver[0]['th_color2'] = "006699";
    $subSilver[0]['th_color3'] = "FFFFFF";
    $subSilver[0]['th_class1'] = "cellpic1.gif";
    $subSilver[0]['th_class2'] = "cellpic3.gif";
    $subSilver[0]['th_class3'] = "cellpic2.jpg";
    $subSilver[0]['td_color1'] = "FAFAFA";
    $subSilver[0]['td_color2'] = "FFFFFF";
    $subSilver[0]['td_color3'] = "";
    $subSilver[0]['td_class1'] = "row1";
    $subSilver[0]['td_class2'] = "row2";
    $subSilver[0]['td_class3'] = "";
    $subSilver[0]['fontface1'] = "Verdana, Arial, Helvetica, sans-serif";
    $subSilver[0]['fontface2'] = "Trebuchet MS";
    $subSilver[0]['fontface3'] = "Courier, \'Courier New\', sans-serif";
    $subSilver[0]['fontsize1'] = "10";
    $subSilver[0]['fontsize2'] = "11";
    $subSilver[0]['fontsize3'] = "12";
    $subSilver[0]['fontcolor1'] = "444444";
    $subSilver[0]['fontcolor2'] = "006600";
    $subSilver[0]['fontcolor3'] = "FFA34F";
    $subSilver[0]['span_class1'] = "";
    $subSilver[0]['span_class2'] = "";
    $subSilver[0]['span_class3'] = "";
    $subSilver[0]['img_size_poll'] = "0";
    $subSilver[0]['img_size_privmsg'] = "0";
    
    ?>
    

    Remplacer par :
    Code: Tout sélectionner
    <?php
    
    //
    // phpBB 2.x auto-generated theme config file for subSilver
    // Do not change anything in this file!
    //
    
    $subSilver[0]['template_name'] = "subSilver";
    $subSilver[0]['style_name'] = "subSilver";
    $subSilver[0]['head_stylesheet'] = "subSilver.css";
    $subSilver[0]['body_background'] = "100%";
    $subSilver[0]['body_bgcolor'] = "E5E5E5";
    $subSilver[0]['body_text'] = "000000";
    $subSilver[0]['body_link'] = "006699";
    $subSilver[0]['body_vlink'] = "5493B4";
    $subSilver[0]['body_alink'] = "";
    $subSilver[0]['body_hlink'] = "DD6900";
    $subSilver[0]['tr_color1'] = "EFEFEF";
    $subSilver[0]['tr_color2'] = "DEE3E7";
    $subSilver[0]['tr_color3'] = "D1D7DC";
    $subSilver[0]['tr_class1'] = "";
    $subSilver[0]['tr_class2'] = "";
    $subSilver[0]['tr_class3'] = "";
    $subSilver[0]['th_color1'] = "98AAB1";
    $subSilver[0]['th_color2'] = "006699";
    $subSilver[0]['th_color3'] = "FFFFFF";
    $subSilver[0]['th_class1'] = "cellpic1.gif";
    $subSilver[0]['th_class2'] = "cellpic3.gif";
    $subSilver[0]['th_class3'] = "cellpic2.jpg";
    $subSilver[0]['td_color1'] = "FAFAFA";
    $subSilver[0]['td_color2'] = "FFFFFF";
    $subSilver[0]['td_color3'] = "";
    $subSilver[0]['td_class1'] = "row1";
    $subSilver[0]['td_class2'] = "row2";
    $subSilver[0]['td_class3'] = "";
    $subSilver[0]['fontface1'] = "Verdana, Arial, Helvetica, sans-serif";
    $subSilver[0]['fontface2'] = "Trebuchet MS";
    $subSilver[0]['fontface3'] = "Courier, \'Courier New\', sans-serif";
    $subSilver[0]['fontsize1'] = "10";
    $subSilver[0]['fontsize2'] = "11";
    $subSilver[0]['fontsize3'] = "12";
    $subSilver[0]['fontcolor1'] = "444444";
    $subSilver[0]['fontcolor2'] = "006600";
    $subSilver[0]['fontcolor3'] = "FFA34F";
    $subSilver[0]['span_class1'] = "";
    $subSilver[0]['span_class2'] = "";
    $subSilver[0]['span_class3'] = "";
    $subSilver[0]['img_size_poll'] = "0";
    $subSilver[0]['img_size_privmsg'] = "0";
    
    $subSilver[1]['template_name'] = "subSilver";
    $subSilver[1]['style_name'] = "subSilver1024";
    $subSilver[1]['head_stylesheet'] = "subSilver.css";
    $subSilver[1]['body_background'] = "1024px";
    $subSilver[1]['body_bgcolor'] = "E5E5E5";
    $subSilver[1]['body_text'] = "000000";
    $subSilver[1]['body_link'] = "006699";
    $subSilver[1]['body_vlink'] = "5493B4";
    $subSilver[1]['body_alink'] = "";
    $subSilver[1]['body_hlink'] = "DD6900";
    $subSilver[1]['tr_color1'] = "EFEFEF";
    $subSilver[1]['tr_color2'] = "DEE3E7";
    $subSilver[1]['tr_color3'] = "D1D7DC";
    $subSilver[1]['tr_class1'] = "";
    $subSilver[1]['tr_class2'] = "";
    $subSilver[1]['tr_class3'] = "";
    $subSilver[1]['th_color1'] = "98AAB1";
    $subSilver[1]['th_color2'] = "006699";
    $subSilver[1]['th_color3'] = "FFFFFF";
    $subSilver[1]['th_class1'] = "cellpic1.gif";
    $subSilver[1]['th_class2'] = "cellpic3.gif";
    $subSilver[1]['th_class3'] = "cellpic2.jpg";
    $subSilver[1]['td_color1'] = "FAFAFA";
    $subSilver[1]['td_color2'] = "FFFFFF";
    $subSilver[1]['td_color3'] = "";
    $subSilver[1]['td_class1'] = "row1";
    $subSilver[1]['td_class2'] = "row2";
    $subSilver[1]['td_class3'] = "";
    $subSilver[1]['fontface1'] = "Verdana, Arial, Helvetica, sans-serif";
    $subSilver[1]['fontface2'] = "Trebuchet MS";
    $subSilver[1]['fontface3'] = "Courier, \'Courier New\', sans-serif";
    $subSilver[1]['fontsize1'] = "10";
    $subSilver[1]['fontsize2'] = "11";
    $subSilver[1]['fontsize3'] = "12";
    $subSilver[1]['fontcolor1'] = "444444";
    $subSilver[1]['fontcolor2'] = "006600";
    $subSilver[1]['fontcolor3'] = "FFA34F";
    $subSilver[1]['span_class1'] = "";
    $subSilver[1]['span_class2'] = "";
    $subSilver[1]['span_class3'] = "";
    $subSilver[1]['img_size_poll'] = "0";
    $subSilver[1]['img_size_privmsg'] = "0";
    
    $subSilver[2]['template_name'] = "subSilver";
    $subSilver[2]['style_name'] = "subSilver800";
    $subSilver[2]['head_stylesheet'] = "subSilver.css";
    $subSilver[2]['body_background'] = "800px";
    $subSilver[2]['body_bgcolor'] = "E5E5E5";
    $subSilver[2]['body_text'] = "000000";
    $subSilver[2]['body_link'] = "006699";
    $subSilver[2]['body_vlink'] = "5493B4";
    $subSilver[2]['body_alink'] = "";
    $subSilver[2]['body_hlink'] = "DD6900";
    $subSilver[2]['tr_color1'] = "EFEFEF";
    $subSilver[2]['tr_color2'] = "DEE3E7";
    $subSilver[2]['tr_color3'] = "D1D7DC";
    $subSilver[2]['tr_class1'] = "";
    $subSilver[2]['tr_class2'] = "";
    $subSilver[2]['tr_class3'] = "";
    $subSilver[2]['th_color1'] = "98AAB1";
    $subSilver[2]['th_color2'] = "006699";
    $subSilver[2]['th_color3'] = "FFFFFF";
    $subSilver[2]['th_class1'] = "cellpic1.gif";
    $subSilver[2]['th_class2'] = "cellpic3.gif";
    $subSilver[2]['th_class3'] = "cellpic2.jpg";
    $subSilver[2]['td_color1'] = "FAFAFA";
    $subSilver[2]['td_color2'] = "FFFFFF";
    $subSilver[2]['td_color3'] = "";
    $subSilver[2]['td_class1'] = "row1";
    $subSilver[2]['td_class2'] = "row2";
    $subSilver[2]['td_class3'] = "";
    $subSilver[2]['fontface1'] = "Verdana, Arial, Helvetica, sans-serif";
    $subSilver[2]['fontface2'] = "Trebuchet MS";
    $subSilver[2]['fontface3'] = "Courier, \'Courier New\', sans-serif";
    $subSilver[2]['fontsize1'] = "10";
    $subSilver[2]['fontsize2'] = "11";
    $subSilver[2]['fontsize3'] = "12";
    $subSilver[2]['fontcolor1'] = "444444";
    $subSilver[2]['fontcolor2'] = "006600";
    $subSilver[2]['fontcolor3'] = "FFA34F";
    $subSilver[2]['span_class1'] = "";
    $subSilver[2]['span_class2'] = "";
    $subSilver[2]['span_class3'] = "";
    $subSilver[2]['img_size_poll'] = "0";
    $subSilver[2]['img_size_privmsg'] = "0";
    
    ?>
    

III) » Finalisation.

    installer les deux nouveaux "sous-templates" (1024 & 800).

    Image

    Image
    Les "sous-templates" installés.

    Seulement voila, se pause un problème :
    Le template subSilver d'origine n'est plus à la taille de 100%.

    Image

    Pourquoi ?
    Car il faut désinstaller le thème subSilver pour le réinstaller dans sa nouvelle version.

    Et pour supprimer subSilver par defaut, il faut mettre un autre template par défaut au forum :

    Image

    Choisissez une variante (subSilver1024 ou subSilver800) comme thème par défaut du forum.

    Il ne vous reste plus qu'à supprimer le template subSilver :

    Image

    Pour enfin le réinstaller :

    Image

    Voilà ce tutoriel est fini et vous pouvez maintenant chosir dans votre profil la largeur que vous préfèrez.
    Image Merci à FRANCKYIV pour sa contribution.
Styles phpBB3 uniques et sur mesure :
Cosa Nostra Design
Mon nouveau Resto :
Pizzeria L' Olivier
Avatar de l’utilisateur
abble
Floodeur universel
Floodeur universel
 
Messages: 11882
Enregistré le: 04 Oct 2004 à 10:34
Localisation: Entre la pierre et la plume...

Retourner vers [phpBB 2.0.x] Forum de documentation

 


  • Articles en relation
    Réponses
    Vues
    Dernier message

Qui est en ligne

Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 1 invité