Installer une "en-tête" sur un sous-forum

2 participants

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

Résolu Installer une "en-tête" sur un sous-forum

Message par Enopee Ven 29 Aoû 2014 - 12:34

Bonjour,

J'ignore si la question vous a déjà été posée, mais je souhaiterais pouvoir installer dans une sous-section de mon forum une en-tête, qui pourrait contenir un widget ou une simple image. Mon forum est un forum de discussion généraliste, qui comporte les sous-sections "Cinéma" et "RPG", dans lesquelles j'aimerais ajouter en en-tête des sujets un widget d'actu ciné (Lien ici http://www.commeaucinema.com/widgets-rss) et la map du RPG.

Un petit schéma pour que vous puissiez mieux comprendre ce que je tente d'expliquer :

Installer une "en-tête" sur un sous-forum 1409308381-schema

Est-ce qu'il y a possibilité de le faire ? Comment dois-je m'y prendre ?

Merci pour votre aide !


Dernière édition par Enopee le Sam 30 Aoû 2014 - 14:40, édité 1 fois
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par [Nihil] Ven 29 Aoû 2014 - 13:22

Alors oui c'est possible, en modifiant le template affichant la liste des sujets et avec du javascript Smile

Au niveau du template topics_list_box, il faut trouver cette partie là :
Code:
<tr>
    <th colspan="{topics_list_box.row.header_table.COLSPAN}" align="center" nowrap="nowrap">&nbsp;{topics_list_box.row.L_TITLE}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="80">&nbsp;{topics_list_box.row.L_REPLIES}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="100">&nbsp;{topics_list_box.row.L_AUTHOR}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="50">&nbsp;{topics_list_box.row.L_VIEWS}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="150">&nbsp;{topics_list_box.row.L_LASTPOST}&nbsp;</th>
    <!-- BEGIN multi_selection -->
    <th align="center" nowrap="nowrap" width="20"><input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" /></th>
<!-- END multi_selection -->
</tr>

On va rajouter un id "topics_list_box__header" à la ligne, ça donne donc :
Code:
<tr id="topics_list_box__header">
    <th colspan="{topics_list_box.row.header_table.COLSPAN}" align="center" nowrap="nowrap">&nbsp;{topics_list_box.row.L_TITLE}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="80">&nbsp;{topics_list_box.row.L_REPLIES}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="100">&nbsp;{topics_list_box.row.L_AUTHOR}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="50">&nbsp;{topics_list_box.row.L_VIEWS}&nbsp;</th>
    <th align="center" nowrap="nowrap" width="150">&nbsp;{topics_list_box.row.L_LASTPOST}&nbsp;</th>
    <!-- BEGIN multi_selection -->
    <th align="center" nowrap="nowrap" width="20"><input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" /></th>
<!-- END multi_selection -->
</tr>

Grâce à ça, on pourra facilement retrouver en Javascript l'élément en écrivant : $('#topics_list_box__header')
Ensuite, on rajoutera du contenu en plus en JS.

Pour le javascript, est ce que tu pourrais d'abord éclaircir certains points :
- il y aura plusieurs pages où le mettre ? Pourrait-on avoir les liens de ces pages s'il te plait ?
- le contenu insérer sera-t-il différent en fonction des pages ou toujours le même ?

Voilà voilà ^^
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par Enopee Ven 29 Aoû 2014 - 14:31

Merci de ta réponse !

Oui, ce serait pas mal de pouvoir voir le contenu affiché sur toutes les pages (J'entends par là les sous-sections des sections RPG et Cinéma). Le contenu sera toujours le même dans les sous-sections, même s'il sera distinct sur les deux sections en question (Comme j'ai expliqué plus haut).

Je ne peux pas fournir les liens pour la section RPG, qui est encore en construction et donc encore invisible pour les invités et membres. :/ Quant à la section cinéma, les voilà :

http://www.quartierjeunes.com/f45-cinema
http://www.quartierjeunes.com/f46-television
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par [Nihil] Sam 30 Aoû 2014 - 11:50

D'accord je comprends, merci des précisions Smile

Avant que je fasse le javascript, pourrais tu d'abord faire la manipulation que je t'ai dit dans le message précédent pour le template s'il te plait ?


Dernière édition par [Nihil] le Sam 30 Aoû 2014 - 11:59, édité 1 fois
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par Enopee Sam 30 Aoû 2014 - 11:58

C'est fait déjà. ^^
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par [Nihil] Sam 30 Aoû 2014 - 12:06

Peux tu vérifier si tu as bien publié le template O0 ? En effet quand je regarde dans le code source, je ne vois pas la modification :s

2ème petite question quand même, quand tu parles de sous sections, tu parles de sous forums ?
En effet quand je suis ici http://www.quartierjeunes.com/f45-cinema je ne vois pas de sous forum. Peut être est ce un sous forum non visible pour les invités ?
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par Enopee Sam 30 Aoû 2014 - 13:59

Au temps pour moi, le template n'avait pas été publié, juste enregistré. Erreur corrigée !

J'avoue ne pas avoir été claire rapport à ma section "Cinéma", voici comment elle se présente :

Une section "Cinéma et télévision" : http://www.quartierjeunes.com/f19-cinema-et-television
Deux sous sections, "Cinéma" et "Télévision" : http://www.quartierjeunes.com/f46-television et http://www.quartierjeunes.com/f45-cinema

Je préfère parler de "sections" que de "forums" en fait, puisque pour moi le forum est le site en lui-même qui englobe toutes les rubriques. ^^'

Pour le RPG, c'est sensiblement la même chose, sauf que la section "RPG" contient plusieurs sous-sections avec le nom de chaque zone jouable.
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par [Nihil] Sam 30 Aoû 2014 - 14:11

Enopee a écrit:Au temps pour moi, le template n'avait pas été publié, juste enregistré. Erreur corrigée !

Peux tu me copier / coller l'intégralité de ton template s'il te plait ? Il semblerait qu'il y ait une petite erreur à un endroit ^^

Je comprends mieux, merci pour les précisions :p
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par Enopee Sam 30 Aoû 2014 - 14:12

Code:
<!-- BEGIN topics_list_box --><!-- BEGIN row --><!-- BEGIN header_table --><!-- BEGIN multi_selection -->
<script type="text/javascript">
function check_uncheck_main_{topics_list_box.row.header_table.BOX_ID}() {
   var all_checked = true;
   for (i = 0; (i < document.{topics_list_box.FORMNAME}.elements.length) && all_checked; i++) {
      if (document.{topics_list_box.FORMNAME}.elements[i].name == '{topics_list_box.FIELDNAME}[]{topics_list_box.row.header_table.BOX_ID}') {
         all_checked = document.{topics_list_box.FORMNAME}.elements[i].checked;
      }
   }
   document.{topics_list_box.FORMNAME}.all_mark_{topics_list_box.row.header_table.BOX_ID}.checked = all_checked;
}
function check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}() {
   for (i = 0; i < document.{topics_list_box.FORMNAME}.length; i++) {
      if (document.{topics_list_box.FORMNAME}.elements[i].name == '{topics_list_box.FIELDNAME}[]{topics_list_box.row.header_table.BOX_ID}') {
         document.{topics_list_box.FORMNAME}.elements[i].checked = document.{topics_list_box.FORMNAME}.all_mark_{topics_list_box.row.header_table.BOX_ID}.checked;
      }
   }
}
</script>
<!-- END multi_selection -->

<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
   <tr> id="topics_list_box__header">
      <th colspan="{topics_list_box.row.header_table.COLSPAN}" align="center" nowrap="nowrap">&nbsp;{topics_list_box.row.L_TITLE}&nbsp;</th>
      <th align="center" nowrap="nowrap" width="80">&nbsp;{topics_list_box.row.L_REPLIES}&nbsp;</th>
      <th align="center" nowrap="nowrap" width="100">&nbsp;{topics_list_box.row.L_AUTHOR}&nbsp;</th>
      <th align="center" nowrap="nowrap" width="50">&nbsp;{topics_list_box.row.L_VIEWS}&nbsp;</th>
      <th align="center" nowrap="nowrap" width="150">&nbsp;{topics_list_box.row.L_LASTPOST}&nbsp;</th>
      <!-- BEGIN multi_selection -->
      <th align="center" nowrap="nowrap" width="20"><input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" /></th>
   <!-- END multi_selection -->
   </tr>
   <!-- BEGIN pagination -->
   <tr>
      <td class="row1" colspan="7" align="right"><span class="gensmall">{PAGINATION}</span></td>
   </tr>
   <!-- END pagination -->
   <!-- END header_table --><!-- BEGIN header_row -->
   <tr>
      <td class="row3" colspan="{topics_list_box.row.COLSPAN}"><span class="gensmall">&nbsp;<b>{topics_list_box.row.L_TITLE}</b></span></td>
   </tr>
<!-- END header_row -->

<!-- BEGIN topic -->
{topics_list_box.row.END_TABLE_STICKY}
   <tr>
      <!-- BEGIN single_selection -->
      <td class="{topics_list_box.row.ROW_CLASS}" align="center" valign="middle" width="20"><input type="radio" name="{topics_list_box.FIELDNAME}" value="{topics_list_box.row.FID}" {topics_list_box.row.L_SELECT} /></td>
      <!-- END single_selection -->
      <td class="{topics_list_box.row.ROW_FOLDER_CLASS}" align="center" valign="middle" width="20"><img title="{topics_list_box.row.L_TOPIC_FOLDER_ALT}" src="{topics_list_box.row.TOPIC_FOLDER_IMG}" alt="{topics_list_box.row.L_TOPIC_FOLDER_ALT}" /></td>
      <!-- BEGIN icon -->
      <td class="{topics_list_box.row.ROW_CLASS}" align="center" valign="middle" width="20">{topics_list_box.row.ICON}</td>
      <!-- END icon -->
      <td class="{topics_list_box.row.ROW_CLASS}" onmouseover='this.className="row2"' onmouseout='this.className="{topics_list_box.row.ROW_CLASS}"' width="100%">
         <div class="topictitle">
            {topics_list_box.row.NEWEST_POST_IMG}{topics_list_box.row.PARTICIPATE_POST_IMG}{topics_list_box.row.TOPIC_TYPE}
            <h2 class="topic-title">
               <a class="topictitle" href="{topics_list_box.row.U_VIEW_TOPIC}">{topics_list_box.row.TOPIC_TITLE}</a>
            </h2>
         </div>

         <!-- BEGIN switch_description -->
         <span class="genmed">
            <br />
            {topics_list_box.row.topic.switch_description.TOPIC_DESCRIPTION}
         </span>
         <!-- END switch_description -->
         <span class="gensmall">{topics_list_box.row.TOPIC_ANNOUNCES_DATES}{topics_list_box.row.TOPIC_CALENDAR_DATES}</span>&nbsp;
         <span class="gensmall">{topics_list_box.row.GOTO_PAGE}<!-- BEGIN nav_tree -->{topics_list_box.row.TOPIC_NAV_TREE} <!-- END nav_tree --></span>
      </td>

      <td class="row2" align="center" valign="middle"><span class="postdetails">{topics_list_box.row.REPLIES}</span></td>
      <td class="row3" align="center" valign="middle"><span class="name"><strong>{topics_list_box.row.TOPIC_AUTHOR}</strong></span></td>
      <td class="row2" align="center" valign="middle"><span class="postdetails">{topics_list_box.row.VIEWS}</span></td>
      <td class="row3Right" onmouseover='this.className="row1"' onmouseout='this.className="row3Right"' align="center" valign="middle" nowrap="nowrap">
            <!-- BEGIN avatar -->
            <div style="width: 200px;"></div>
            <span class="lastpost-avatar">{topics_list_box.row.topic.avatar.LAST_POST_AVATAR}</span>
            <!-- END avatar -->

            <span class="postdetails">{topics_list_box.row.LAST_POST_TIME}<br />{topics_list_box.row.LAST_POST_AUTHOR} {topics_list_box.row.LAST_POST_IMG}</span>
        </td>
<!-- BEGIN multi_selection -->
      <td class="row2" align="center" valign="middle"><span class="postdetails"><input onclick="javascript:check_uncheck_main_{topics_list_box.row.BOX_ID}();" type="checkbox" name="{topics_list_box.FIELDNAME}[]{topics_list_box.row.BOX_ID}" value="{topics_list_box.row.FID}" {topics_list_box.row.L_SELECT} /></span></td>
   <!-- END multi_selection -->
   </tr>
   <!-- END topic --><!-- BEGIN no_topics -->
   <tr>
      <td class="row1" colspan="{topics_list_box.row.COLSPAN}" align="center" valign="middle" height="30"><span class="gen">{topics_list_box.row.L_NO_TOPICS}</span></td>
   </tr>
   <!-- END no_topics --><!-- BEGIN bottom -->
   <tr>
      <td class="catBottom" colspan="{topics_list_box.row.COLSPAN}" valign="middle">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td>&nbsp;<span class="gensmall">{PAGINATION}</span></td>
               <td align="right"><a href="#top">{L_BACK_TO_TOP}</a>&nbsp;</td>
            </tr>
         </table>
      </td>
   </tr>
<!-- END bottom --><!-- BEGIN footer_table -->
</table><!-- END footer_table --><!-- BEGIN spacer --><br class="gensmall" /><!-- END spacer --><!-- END row --><!-- END topics_list_box -->

Le voici !
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par [Nihil] Sam 30 Aoû 2014 - 14:21

Le voici bien :
Code:
    <!-- BEGIN topics_list_box --><!-- BEGIN row --><!-- BEGIN header_table --><!-- BEGIN multi_selection -->
    <script type="text/javascript">
    function check_uncheck_main_{topics_list_box.row.header_table.BOX_ID}() {
      var all_checked = true;
      for (i = 0; (i < document.{topics_list_box.FORMNAME}.elements.length) && all_checked; i++) {
          if (document.{topics_list_box.FORMNAME}.elements[i].name == '{topics_list_box.FIELDNAME}[]{topics_list_box.row.header_table.BOX_ID}') {
            all_checked = document.{topics_list_box.FORMNAME}.elements[i].checked;
          }
      }
      document.{topics_list_box.FORMNAME}.all_mark_{topics_list_box.row.header_table.BOX_ID}.checked = all_checked;
    }
    function check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}() {
      for (i = 0; i < document.{topics_list_box.FORMNAME}.length; i++) {
          if (document.{topics_list_box.FORMNAME}.elements[i].name == '{topics_list_box.FIELDNAME}[]{topics_list_box.row.header_table.BOX_ID}') {
            document.{topics_list_box.FORMNAME}.elements[i].checked = document.{topics_list_box.FORMNAME}.all_mark_{topics_list_box.row.header_table.BOX_ID}.checked;
          }
      }
    }
    </script>
    <!-- END multi_selection -->

    <table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
      <tr id="topics_list_box__header">
          <th colspan="{topics_list_box.row.header_table.COLSPAN}" align="center" nowrap="nowrap">&nbsp;{topics_list_box.row.L_TITLE}&nbsp;</th>
          <th align="center" nowrap="nowrap" width="80">&nbsp;{topics_list_box.row.L_REPLIES}&nbsp;</th>
          <th align="center" nowrap="nowrap" width="100">&nbsp;{topics_list_box.row.L_AUTHOR}&nbsp;</th>
          <th align="center" nowrap="nowrap" width="50">&nbsp;{topics_list_box.row.L_VIEWS}&nbsp;</th>
          <th align="center" nowrap="nowrap" width="150">&nbsp;{topics_list_box.row.L_LASTPOST}&nbsp;</th>
          <!-- BEGIN multi_selection -->
          <th align="center" nowrap="nowrap" width="20"><input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" /></th>
      <!-- END multi_selection -->
      </tr>
      <!-- BEGIN pagination -->
      <tr>
          <td class="row1" colspan="7" align="right"><span class="gensmall">{PAGINATION}</span></td>
      </tr>
      <!-- END pagination -->
      <!-- END header_table --><!-- BEGIN header_row -->
      <tr>
          <td class="row3" colspan="{topics_list_box.row.COLSPAN}"><span class="gensmall">&nbsp;<b>{topics_list_box.row.L_TITLE}</b></span></td>
      </tr>
    <!-- END header_row -->

    <!-- BEGIN topic -->
    {topics_list_box.row.END_TABLE_STICKY}
      <tr>
          <!-- BEGIN single_selection -->
          <td class="{topics_list_box.row.ROW_CLASS}" align="center" valign="middle" width="20"><input type="radio" name="{topics_list_box.FIELDNAME}" value="{topics_list_box.row.FID}" {topics_list_box.row.L_SELECT} /></td>
          <!-- END single_selection -->
          <td class="{topics_list_box.row.ROW_FOLDER_CLASS}" align="center" valign="middle" width="20"><img title="{topics_list_box.row.L_TOPIC_FOLDER_ALT}" src="{topics_list_box.row.TOPIC_FOLDER_IMG}" alt="{topics_list_box.row.L_TOPIC_FOLDER_ALT}" /></td>
          <!-- BEGIN icon -->
          <td class="{topics_list_box.row.ROW_CLASS}" align="center" valign="middle" width="20">{topics_list_box.row.ICON}</td>
          <!-- END icon -->
          <td class="{topics_list_box.row.ROW_CLASS}" onmouseover='this.className="row2"' onmouseout='this.className="{topics_list_box.row.ROW_CLASS}"' width="100%">
            <div class="topictitle">
                {topics_list_box.row.NEWEST_POST_IMG}{topics_list_box.row.PARTICIPATE_POST_IMG}{topics_list_box.row.TOPIC_TYPE}
                <h2 class="topic-title">
                  <a class="topictitle" href="{topics_list_box.row.U_VIEW_TOPIC}">{topics_list_box.row.TOPIC_TITLE}</a>
                </h2>
            </div>

            <!-- BEGIN switch_description -->
            <span class="genmed">
                <br />
                {topics_list_box.row.topic.switch_description.TOPIC_DESCRIPTION}
            </span>
            <!-- END switch_description -->
            <span class="gensmall">{topics_list_box.row.TOPIC_ANNOUNCES_DATES}{topics_list_box.row.TOPIC_CALENDAR_DATES}</span>&nbsp;
            <span class="gensmall">{topics_list_box.row.GOTO_PAGE}<!-- BEGIN nav_tree -->{topics_list_box.row.TOPIC_NAV_TREE} <!-- END nav_tree --></span>
          </td>

          <td class="row2" align="center" valign="middle"><span class="postdetails">{topics_list_box.row.REPLIES}</span></td>
          <td class="row3" align="center" valign="middle"><span class="name"><strong>{topics_list_box.row.TOPIC_AUTHOR}</strong></span></td>
          <td class="row2" align="center" valign="middle"><span class="postdetails">{topics_list_box.row.VIEWS}</span></td>
          <td class="row3Right" onmouseover='this.className="row1"' onmouseout='this.className="row3Right"' align="center" valign="middle" nowrap="nowrap">
                <!-- BEGIN avatar -->
                <div style="width: 200px;"></div>
                <span class="lastpost-avatar">{topics_list_box.row.topic.avatar.LAST_POST_AVATAR}</span>
                <!-- END avatar -->

                <span class="postdetails">{topics_list_box.row.LAST_POST_TIME}<br />{topics_list_box.row.LAST_POST_AUTHOR} {topics_list_box.row.LAST_POST_IMG}</span>
            </td>
    <!-- BEGIN multi_selection -->
          <td class="row2" align="center" valign="middle"><span class="postdetails"><input onclick="javascript:check_uncheck_main_{topics_list_box.row.BOX_ID}();" type="checkbox" name="{topics_list_box.FIELDNAME}[]{topics_list_box.row.BOX_ID}" value="{topics_list_box.row.FID}" {topics_list_box.row.L_SELECT} /></span></td>
      <!-- END multi_selection -->
      </tr>
      <!-- END topic --><!-- BEGIN no_topics -->
      <tr>
          <td class="row1" colspan="{topics_list_box.row.COLSPAN}" align="center" valign="middle" height="30"><span class="gen">{topics_list_box.row.L_NO_TOPICS}</span></td>
      </tr>
      <!-- END no_topics --><!-- BEGIN bottom -->
      <tr>
          <td class="catBottom" colspan="{topics_list_box.row.COLSPAN}" valign="middle">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td>&nbsp;<span class="gensmall">{PAGINATION}</span></td>
                  <td align="right"><a href="#top">{L_BACK_TO_TOP}</a>&nbsp;</td>
                </tr>
            </table>
          </td>
      </tr>
    <!-- END bottom --><!-- BEGIN footer_table -->
    </table><!-- END footer_table --><!-- BEGIN spacer --><br class="gensmall" /><!-- END spacer --><!-- END row --><!-- END topics_list_box -->

J'ai corrigé :
Code:
<tr> id="topics_list_box__header">
Par
Code:
<tr id="topics_list_box__header">

Si tu rajoutes un javascript avec ceci (il faut cocher "sur toutes les pages"), dis moi si tu vois écrit "Message de texte" dans les parties Cinéma après ^^ :
Code:
if (document.location.pathname == '/f19-cinema-et-television' || document.location.pathname == '/f46-television' || document.location.pathname == '/f45-cinema') {
    $(function(){
   
        var message = 'Message de test';
       
        $('#topics_list_box__header').after('<tr><td colspan="7" class="row1">' + message + '</td></tr>');
       
    });
}
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par Enopee Sam 30 Aoû 2014 - 14:27

ça marche ! Merci beaucoup ! =)

EDIT : Par contre, le widget que je souhaitais ajouter ne s'affiche pas ; y'a-t-il une chose supplémentaire à faire pour que ce soit le cas ?

Le code :

Code:
<div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlashBox" width="100%" height="300" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://www.commeaucinema.com/flashboxprx.php" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="flashvars" value="rub=home&ext=1" /><embed src="http://www.commeaucinema.com/flashboxprx.php" quality="high"    width="100%" height="300" name="FlashBox" align="middle" wmode="transparent"    play="true"    loop="false"    quality="high"    allowScriptAccess="always"    flashvars="rub=home&ext=1"    type="application/x-shockwave-flash"    pluginspage="http://www.adobe.com/go/getflashplayer"></embed><a href="http://www.commeaucinema.com" title="Toute l'actu Cinema et DVD est sur commeaucinema.com">Cinema</a></object><br />&nbsp;&nbsp;<a href="http://www.commeaucinema.com" style="font-size:9px;font-family:Arial">Comme Au Cinema</a></div>
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par [Nihil] Sam 30 Aoû 2014 - 14:38

En fait, ton html comporte le signe ' du coup le javascript croit que c'est la fin du message (en effet, la variable message est une chaine de caractère, ici délimitée par le caractère ').

Il faut donc dire au javascript que ce n'est pas la fin de notre variable message ^^
Pour cela on va rajouter \ devant '. l'actu devient donc l\'actu par exemple.
Ce qui nous donne donc :
Code:
var message = '<div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlashBox" width="100%" height="300" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://www.commeaucinema.com/flashboxprx.php" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="flashvars" value="rub=home&ext=1" /><embed src="http://www.commeaucinema.com/flashboxprx.php" quality="high"    width="100%" height="300" name="FlashBox" align="middle" wmode="transparent"    play="true"    loop="false"    quality="high"    allowScriptAccess="always"    flashvars="rub=home&ext=1"    type="application/x-shockwave-flash"    pluginspage="http://www.adobe.com/go/getflashplayer"></embed><a href="http://www.commeaucinema.com" title="Toute l\'actu Cinema et DVD est sur commeaucinema.com">Cinema</a></object><br />&nbsp;&nbsp;<a href="http://www.commeaucinema.com" style="font-size:9px;font-family:Arial">Comme Au Cinema</a></div>';
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

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

Résolu Re: Installer une "en-tête" sur un sous-forum

Message par Enopee Sam 30 Aoû 2014 - 14:40

ça a marché ! Je te remercie infiniment ! =D

Je suis désolée si mes questions ont pu paraître bête, je suis totalement novice dans le domaine. ^^
avatar

Enopee
Nouveau membre

Messages : 11
Inscrit(e) le : 07/08/2012

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

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

- Sujets similaires

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