Le Deal du moment : -34%
-34% LG OLED55B3 – TV OLED 4K 55″ 2023 ...
Voir le deal
919 €

Terrible :: Cimetière des codes :: Codes forum
Awful
Lun 12 Juin - 23:42
Awful
Another angle 1514405914-angle-min

Another angle 1514405914-angle2-min

J'utilise les variables CSS pour les couleurs de ce codage. Il suffit d'éditer les hexa dans :root pour changer les couleurs de plusieurs éléments à la fois. Par exemple, en changeant la variable 'main-color', on édite la couleur du titre de catégorie, du bloc forum mais aussi des pseudo-éléments qui donnent cette impression d'image oblique, ça fait donc une seule modification pour plusieurs éléments et on se facilite la vie.

Le filtre jaune sur l'image correspond à un nouveau message. On peut changer la couleur dans le code.

Créditez-moi quelque part sur votre forum si vous utilisez ces codes

La scrollbar est seulement stylée sous Chrome


Codes et explications

Pour activer l'affichage des sous-forums, panneau d'administration > Affichage > Page d'accueil > Structure et hiérarchie. Dans le bloc en bas, à "Lien vers les niveaux inférieurs", cocher "oui".

Dans votre panneau d'administration, Affichage > Templates > Général > Overall_header, copiez et collez le code suivant, après l'ouverture de la balise head :

Code:
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,900|Playfair+Display" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">


Dans votre panneau d'administration, Affichage > Templates > Général > index_box, remplacez l'intégralité du template par le suivant :

Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
 <tr>
 <td valign="bottom">
 <!-- BEGIN switch_user_logged_in -->
 <span class="gensmall">{LAST_VISIT_DATE}<br />
 {CURRENT_TIME}<br />
 </span>
 <!-- END switch_user_logged_in -->
 <div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
 </td>
 <td class="gensmall" align="right" valign="bottom">
 <!-- BEGIN switch_user_logged_in -->
 <a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
 <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
 <!-- END switch_user_logged_in -->
 <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
 </td>
 </tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead -->

<div class="titre-cate">{catrow.tablehead.L_FORUM}</div>
 
<!-- END tablehead -->
 <!-- BEGIN cathead -->
 <!-- END cathead -->
 <!-- BEGIN forumrow -->
 <div class="wrap-forum">
         <div class="forum-titre">
         <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a>
         </div>
         <div class="forum-desc">
                   <div class="forum-desc-content">
                   {catrow.forumrow.FORUM_DESC}
                     </div>
                 </div>
            <div class="forum-img">
              <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
            </div>
         <div class="forum-stats">
                  <div><b>{catrow.forumrow.TOPICS}</b> sujets</div>
                  <div><b>{catrow.forumrow.POSTS}</b> posts</div>
         </div>
          
            <div class="forum-last">
              <div>
              {catrow.forumrow.LAST_POST}
              </div>
            </div>
        </div>
<div class="sous-forum">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</div>
<script>
  $(document).ready(function(){
  $('.forum-img img[title="Nouveaux messages"]').closest('.wrap-forum').addClass('nouveau');
  });
</script>
 <!-- END forumrow -->
 <!-- BEGIN catfoot -->

 <!-- END catfoot -->
 <!-- BEGIN tablefoot -->
<!-- END tablefoot --><!-- END catrow -->


Enfin, dans Affichage > Images et couleurs > Couleurs et dans le petit onglet Feuille de style CSS, collez le code suivant :

Code:
/*PERSONNALISATION DES FORUMS ET CATEGORIES PAR AWFUL*/
/*Variables CSS pour les couleurs*/
 :root {
     --main-color: #4a4a4a;
    /*Bloc forum, titre catégorie, triangles sur l'image de description*/
     --accent-color: #e3e37f;
    /*Titre de forum, liens du dernier topic*/
     --accent-color-two: #645e71;
    /*Couleur au survol des liens, couleur de texte du bloc forum*/
}
/*Titre de catégorie*/
 .titre-cate {
     width: 800px;
     margin: 0 auto;
     position: relative;
}
 .titre-cate:after {
     content: "";
     position: absolute;
     height: 2px;
     width: 100px;
     background: var(--main-color);
     bottom: -10px;
}
 .titre-cate h2 {
     font-weight: 900;
     font-size: 30px;
     text-transform: uppercase;
     letter-spacing: 1px;
     font-family: 'Playfair Display', serif;
     color: var(--main-color)!important;
}
/*Bloc Forum*/
 .wrap-forum {
     width: 800px;
     height: 150px;
     background: var(--main-color);
     position: relative;
     font-family: 'Source Sans Pro', sans-serif;
     margin: 0 auto 15px;
     color: #e8e8e8;
     overflow: hidden;
}
 .wrap-forum a, .wrap-forum a:hover, .sous-forum a:hover {
     text-decoration: none!important;
}
/*Titre de forum*/
 .forum-titre {
     position: absolute;
     height: 100%;
     width: 500px;
     box-sizing: border-box;
     padding: 7px 15px;
}
 .forum-titre a {
     font-weight: 900;
     font-size: 20px;
     text-transform: uppercase;
     letter-spacing: 1px;
     font-family: 'Playfair Display', serif;
     color: var(--accent-color)!important;
     -webkit-transition: all 0.3s;
     transition: all 0.3s;
}
 .forum-titre a:hover {
     color: var(--accent-color-two)!important;
}
 .forum-titre:after {
     content: "";
     width: 0;
     height: 0;
     border-style: solid;
     border-width: 150px 70px 0 0;
     border-color: var(--main-color) transparent transparent transparent;
     position: absolute;
     right: -70px;
     top: 0;
     z-index: 2;
}
/*Statistiques des forums*/
 .forum-stats {
     position: absolute;
     bottom: 10px;
     left: 15px;
}
 .forum-stats div {
     display: inline-block;
     text-align: center;
     text-transform: uppercase;
     letter-spacing: 1px;
     font-size: 9px;
     margin-right: 10px;
}
 .forum-stats div b {
     display: block;
}
/*Description de forum*/
 .forum-desc {
     position: absolute;
     left: 15px;
     top: 40px;
}
 .forum-desc-content {
     height: 60px;
     font-size: 10px;
     width: 400px;
     box-sizing: border-box;
     padding-right: 7px;
     overflow: auto;
     text-align: justify;
}
 .forum-desc-content img {
     height: 150px;
     width: 200px;
     position: absolute;
     left: 485px;
     top: -40px;
}
/*Image new/no new de forum*/
 .forum-img {
     position: absolute;
     right: 100px;
     height: 150px;
     width: 200px;
}
 .forum-img img {
     opacity: 0;
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
/*En cas de nouveau message, on applique un filtre coloré sur l'image de description*/
 .wrap-forum.nouveau .forum-img:before {
     content: "";
     background: #ffe65e;
     height: 100%;
     width: 100%;
     position: absolute;
     top: 0;
     left: 0;
     mix-blend-mode: multiply;
}
/*Dernier message*/
 .forum-last {
     position: absolute;
     height: 100%;
     width: 100px;
     background: var(--main-color);
     right: 0;
}
 .forum-last a {
     -webkit-transition: all 0.3s;
     transition: all 0.3s;
}
 .forum-last a:hover, .forum-last a[href^="/t"]:last-child:hover:after{
     color: var(--accent-color-two);
}
 .forum-last:after {
     content: "";
     width: 0;
     height: 0;
     border-style: solid;
     border-width: 0 0 150px 70px;
     border-color: transparent transparent var(--main-color) transparent;
     position: absolute;
     left: -70px;
     top: 0;
}
 .forum-last div {
     width: 120px;
     position: absolute;
     bottom: 20px;
     right: 0;
     z-index: 2;
     font-size: 11px;
}
 .forum-last div > span > a {
     text-transform: uppercase;
     font-size: 8px;
     font-weight: bold;
     letter-spacing: 1px;
     color: var(--accent-color);
}
 .forum-last a[href^="/t"]:last-child {
     position: relative;
}
 .forum-last a[href^="/t"]:last-child img {
     display: none;
}
 .forum-last a[href^="/t"]:last-child:after {
     font-family: "Font Awesome 5 Free";
     font-weight: 900;
     content: "\f3e5";
     font-style: normal;
     color: var(--accent-color);
     font-size: 10px;
     line-height: 14px;
     margin-left: 3px;
     -webkit-transition: all 0.3s;
     transition: all 0.3s;
}
/*sous forums*/
 .sous-forum {
     margin: -10px auto 15px;
     width: 800px;
     border: 1px solid #ccc;
     box-sizing: border-box;
     bottom: -25px;
     min-height: 20px;
     font-size: 0;
     padding: 0 10px;
}
/*Si le forum n'a pas de sous-forums, on supprime le bloc sous forums*/
 .sous-forum:empty {
     display: none;
}
 .sous-forum a {
     font-size: 8px;
     margin-right: 10px;
     line-height: 18px;
     text-transform: uppercase;
     color: var(--main-color)!important;
     font-weight: bold;
     letter-spacing: 1px;
     -webkit-transition: all 0.3s;
     transition: all 0.3s;
}
 .sous-forum a:hover {
     color: var(--accent-color)!important;
}
/*Customisation de la scrollbar sous Chrome*/
 .forum-desc-content::-webkit-scrollbar {
     width: 2px;
}
 .forum-desc-content::-webkit-scrollbar-track {
     background-color: #383838;
}
 .forum-desc-content::-webkit-scrollbar-thumb {
     background: var(--accent-color);
}