mentionner : soucis avec var n = this.title.replace

3 participants

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

Résolu mentionner : soucis avec var n = this.title.replace

Message par Beylin Dim 11 Mar 2018 - 23:58

Détails techniques

Version du forum : ModernBB
Poste occupé : Fondateur
Navigateur(s) concerné(s) : Mozilla Firefox, Google Chrome, Internet Explorer, Opera, Safari
Capture d'écran du problème :
Voir l'image:

Personnes concernées par le problème : Tous les utilisateurs
Problème apparu depuis : depuis toujours
Lien du forum : http://itsallmyfault.forumactif.com

Description du problème

Bonjour, nous aimerions installer le script permettant d'ajouter un bouton mention à côté des boutons "citation, éditer" etc... Nous avons testé le script disponible ici mais il permet d'ajouter une image et non un texte comme sur notre forum. Comment faire pour ajouter un bouton "mention" en texte et non une image ?

De plus, le script ne fonctionne pas...  il met seulement @"" dans le message, sans citer le pseudo  Embarassed

Merci d'avance I love you


Dernière édition par Beylin le Jeu 22 Mar 2018 - 9:06, édité 3 fois
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Beylin Mar 13 Mar 2018 - 8:41

up Snifff
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Feu Ardent Mar 13 Mar 2018 - 21:43

Je dois avouer que ce problème m'intrigue aussi, ayant essayé de faire la même chose sur modernbb également sans grand succès ... Vu que modernbb est une des versions proposées par forumactif ne serait-il pas astucieux de l'inclure dans les options pour le script de mention dans les sujets ? J'ai trouvé d'autres tutoriels dans les anciens sujets ici mais lorsqu'installés sur un forum modernbb, sans templates personnalisés ni js personnalisés, ça ne met que le @"" dans le message, sans citer le pseudo. :/
Feu Ardent

Feu Ardent
***

Masculin
Messages : 151
Inscrit(e) le : 29/08/2010

Feu Ardent a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Beylin Jeu 15 Mar 2018 - 22:05

up Embarassed
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Beylin Dim 18 Mar 2018 - 22:53

up Embarassed
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin a été remercié(e) par l'auteur de ce sujet.
  • 0

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Walt Dim 18 Mar 2018 - 23:22

Bonsoir,

Le tutoriel est antérieur à la sortie de la version ModernBB, d'où sa non-compatibilité. J'ai actualisé le tutoriel (uniquement pour le bouton "mentionner" pour le moment), et voici le code incluant ModernBB :

Code:
/* FORUM VERSIONS
 * 0 = PHPBB2
 * 1 = PHPBB3
 * 2 = PUNBB
 * 3 = INVISION
 * 4 = MODERNBB
 */
$(function() {
  var version = 4,
      image = 'http://i19.servimg.com/u/f19/18/21/60/73/mentio10.png';
 
  if (/mode=reply/.test(window.location.search) && my_getcookie('fa_mention')) {
    document.post.message.value += '@"' + my_getcookie('fa_mention') + '" ';
    my_setcookie('fa_mention',''); 
  } if (!/\/t\d+/.test(window.location.pathname)) return;
 
  for (var a = $(['.post-options', '.profile-icons', '.post-options', '.posting-icons', '.profile-icons'][version]), b, c, d = ['.name strong a', '.author a', '.username a', '.author a', '.postprofile-name a'][version], e, i = 0, j = a.length, t = document.getElementById('text_editor_textarea'), l = version == 1 || version == 3; i<j; i++) {
    b = document.createElement('IMG');
    b.src = image;
    b.alt = 'Mentionner';
    b.title = 'Mentionner ' + $(a[i]).closest('.post').find(d + ':not(.fa-mention)').text();
    b.className = 'i_icon_mention';
    b.onclick = function() {
      var n = this.title.replace(/^.*?\s/,'');
     
      if ($.sceditor) t.insertText('@"' + n + '" ');
      else {
        my_setcookie('fa_mention', n);
        window.location.href = '/post?t=' + window.location.pathname.replace(/\/t(\d+)-.*/,'$1') + '&mode=reply';
      }
    };
 
    if (l) {
      c = document.createElement('LI');
      c.appendChild(b);
    }
   
    a[i].insertBefore(l ? c : b, a[i].firstChild);
  }
 
  $(function(){
    if (!$.sceditor) return;
    t=$(t).sceditor('instance');
  });
});

Cordialement,
Walt
Walt

Walt
Modéractif
Modéractif

Masculin
Messages : 6082
Inscrit(e) le : 08/09/2015

Walt a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Beylin Mar 20 Mar 2018 - 18:43

Merci beaucoup pour ton aide et ta réponse Walt !

J'ai testé le script et il marche parfaitement sur un forum vierge... Le problème c'est que nous avons ajouté plusieurs scripts et modifié nos templates, donc il ne marche pas sur mon forum :s

Pour info, voici les trucs qui feraient beuguer le script a priori :

JAVASCRIPT
Code:
// Generated by CoffeeScript 1.10.0

/**
@license Sticky-kit v1.1.3 | MIT | Leaf Corcoran 2015 | http://leafo.net
 */

(function() {
  var $, win;

  $ = window.jQuery;

  win = $(window);

  $.fn.stick_in_parent = function(opts) {
    var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, outer_width, parent_selector, recalc_every, sticky_class;
    if (opts == null) {
      opts = {};
    }
    sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming;
    if (offset_top == null) {
      offset_top = 0;
    }
    if (parent_selector == null) {
      parent_selector = void 0;
    }
    if (inner_scrolling == null) {
      inner_scrolling = true;
    }
    if (sticky_class == null) {
      sticky_class = "is_stuck";
    }
    doc = $(document);
    if (enable_bottoming == null) {
      enable_bottoming = true;
    }
    outer_width = function(el) {
      var _el, computed, w;
      if (window.getComputedStyle) {
        _el = el[0];
        computed = window.getComputedStyle(el[0]);
        w = parseFloat(computed.getPropertyValue("width")) + parseFloat(computed.getPropertyValue("margin-left")) + parseFloat(computed.getPropertyValue("margin-right"));
        if (computed.getPropertyValue("box-sizing") !== "border-box") {
          w += parseFloat(computed.getPropertyValue("border-left-width")) + parseFloat(computed.getPropertyValue("border-right-width")) + parseFloat(computed.getPropertyValue("padding-left")) + parseFloat(computed.getPropertyValue("padding-right"));
        }
        return w;
      } else {
        return el.outerWidth(true);
      }
    };
    fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) {
      var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;
      if (elm.data("sticky_kit")) {
        return;
      }
      elm.data("sticky_kit", true);
      last_scroll_height = doc.height();
      parent = elm.parent();
      if (parent_selector != null) {
        parent = parent.closest(parent_selector);
      }
      if (!parent.length) {
        throw "failed to find stick parent";
      }
      fixed = false;
      bottomed = false;
      spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $("<div />");
      if (spacer) {
        spacer.css('position', elm.css('position'));
      }
      recalc = function() {
        var border_top, padding_top, restore;
        if (detached) {
          return;
        }
        last_scroll_height = doc.height();
        border_top = parseInt(parent.css("border-top-width"), 10);
        padding_top = parseInt(parent.css("padding-top"), 10);
        padding_bottom = parseInt(parent.css("padding-bottom"), 10);
        parent_top = parent.offset().top + border_top + padding_top;
        parent_height = parent.height();
        if (fixed) {
          fixed = false;
          bottomed = false;
          if (manual_spacer == null) {
            elm.insertAfter(spacer);
            spacer.detach();
          }
          elm.css({
            position: "",
            top: "",
            width: "",
            bottom: ""
          }).removeClass(sticky_class);
          restore = true;
        }
        top = elm.offset().top - (parseInt(elm.css("margin-top"), 10) || 0) - offset_top;
        height = elm.outerHeight(true);
        el_float = elm.css("float");
        if (spacer) {
          spacer.css({
            width: outer_width(elm),
            height: height,
            display: elm.css("display"),
            "vertical-align": elm.css("vertical-align"),
            "float": el_float
          });
        }
        if (restore) {
          return tick();
        }
      };
      recalc();
      if (height === parent_height) {
        return;
      }
      last_pos = void 0;
      offset = offset_top;
      recalc_counter = recalc_every;
      tick = function() {
        var css, delta, recalced, scroll, will_bottom, win_height;
        if (detached) {
          return;
        }
        recalced = false;
        if (recalc_counter != null) {
          recalc_counter -= 1;
          if (recalc_counter <= 0) {
            recalc_counter = recalc_every;
            recalc();
            recalced = true;
          }
        }
        if (!recalced && doc.height() !== last_scroll_height) {
          recalc();
          recalced = true;
        }
        scroll = win.scrollTop();
        if (last_pos != null) {
          delta = scroll - last_pos;
        }
        last_pos = scroll;
        if (fixed) {
          if (enable_bottoming) {
            will_bottom = scroll + height + offset > parent_height + parent_top;
            if (bottomed && !will_bottom) {
              bottomed = false;
              elm.css({
                position: "fixed",
                bottom: "",
                top: offset
              }).trigger("sticky_kit:unbottom");
            }
          }
          if (scroll < top) {
            fixed = false;
            offset = offset_top;
            if (manual_spacer == null) {
              if (el_float === "left" || el_float === "right") {
                elm.insertAfter(spacer);
              }
              spacer.detach();
            }
            css = {
              position: "",
              width: "",
              top: ""
            };
            elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick");
          }
          if (inner_scrolling) {
            win_height = win.height();
            if (height + offset_top > win_height) {
              if (!bottomed) {
                offset -= delta;
                offset = Math.max(win_height - height, offset);
                offset = Math.min(offset_top, offset);
                if (fixed) {
                  elm.css({
                    top: offset + "px"
                  });
                }
              }
            }
          }
        } else {
          if (scroll > top) {
            fixed = true;
            css = {
              position: "fixed",
              top: offset
            };
            css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px";
            elm.css(css).addClass(sticky_class);
            if (manual_spacer == null) {
              elm.after(spacer);
              if (el_float === "left" || el_float === "right") {
                spacer.append(elm);
              }
            }
            elm.trigger("sticky_kit:stick");
          }
        }
        if (fixed && enable_bottoming) {
          if (will_bottom == null) {
            will_bottom = scroll + height + offset > parent_height + parent_top;
          }
          if (!bottomed && will_bottom) {
            bottomed = true;
            if (parent.css("position") === "static") {
              parent.css({
                position: "relative"
              });
            }
            return elm.css({
              position: "absolute",
              bottom: padding_bottom,
              top: "auto"
            }).trigger("sticky_kit:bottom");
          }
        }
      };
      recalc_and_tick = function() {
        recalc();
        return tick();
      };
      detach = function() {
        detached = true;
        win.off("touchmove", tick);
        win.off("scroll", tick);
        win.off("resize", recalc_and_tick);
        $(document.body).off("sticky_kit:recalc", recalc_and_tick);
        elm.off("sticky_kit:detach", detach);
        elm.removeData("sticky_kit");
        elm.css({
          position: "",
          bottom: "",
          top: "",
          width: ""
        });
        parent.position("position", "");
        if (fixed) {
          if (manual_spacer == null) {
            if (el_float === "left" || el_float === "right") {
              elm.insertAfter(spacer);
            }
            spacer.remove();
          }
          return elm.removeClass(sticky_class);
        }
      };
      win.on("touchmove", tick);
      win.on("scroll", tick);
      win.on("resize", recalc_and_tick);
      $(document.body).on("sticky_kit:recalc", recalc_and_tick);
      elm.on("sticky_kit:detach", detach);
      return setTimeout(tick, 0);
    };
    for (i = 0, len = this.length; i < len; i++) {
      elm = this[i];
      fn($(elm));
    }
    return this;
  };

}).call(this);

TEMPLATE VIEWTOPIC_BODY
Code:
<style>
/*FORUMS*/
  form[name="go_page"]{position: relative: z-index: 999; background: #ffffff; box-shadow: box-shadow: 0 0 2px rgba(0,0,0,0.2)!important;}

.forumbg{margin-top: 69px;}
.sub-header {position: relative; top: 24px;}
.sub-header-path img {position: absolute; left: 0px; top: 0px; width: 100px;}
.titrecaler{width: 100%!important;}
  .table-title h2, h1.page-title{width: auto!important; left: 0px!important; position: relative;}
.table-title h2, h1.page-title{font-family: 'Old Standard TT', serif; color: #593f20!important; width: 570px; display: inline-block; position: absolute; top: 0px; right: 0px;}
.table-title h2, h1.page-title{font-style: italic; letter-spacing: -3px; font-size: 40px!important; line-height: 45px;}
.sub-header-path a + a:before{display: none!important;}
.table-title h2, ul.topiclist dd.dterm h2{line-height: 116px!important;}
h1.page-title{margin-left: 115px; padding-top: 13px; border-bottom: 9px solid #593f20; line-height: 38px!important; max-height: 59px!important; overflow-y: hidden!important;} h1.page-title a{color: #593f20!important;}
.topic-actions {font-size: 1.3rem; margin: 18px 0 9px; width: 40%; margin-left: 102px; margin-top: -8px;}
  .topic-actions-buttons{float: left!important; margin-top: 2px;}
  .search-box input{font-family: 'Old Standard TT'; font-size: 13px;}
  .margincatbas{margin-top: 0px!important;} .table-title{padding-bottom: 15px!important; display: block!important;} .marginhautcat{top: 0px!important;} .casecat{margin: 0px!important; width: 0px!important; height: 0px!important;}
.lienwatch a{margin-left: -18px!important;}

.quick-nav-topics a {background-color: rgba(0,0,0,0.1); border-radius: 3px; float: left; height: 24px; margin-left: 6px; padding: 0px;}
  .quick-nav-topics a img{margin: 7px; margin-left: 13px; margin-right: 13px;}
.quick-nav-topics{width:123px; margin-top: 5px; float: right;}
  .sub-header-buttons .button1{margin-left: 9px!important;}
.topic-actions.bottom .topic-actions-buttons > a{color: #593f20!important; margin-left: 0px!important;}
  .topic-actions.bottom{position: relative; height: 62px;}
  .pagination{position: relative; z-index: 999;}
.topic-actions-buttons #plus_menu{left: 84px!important;}</style>


<script type="text/javascript">
//<![CDATA[
var multiquote_img_off = '{JS_MULTIQUOTE_IMG_OFF}', multiquote_img_on = '{JS_MULTIQUOTE_IMG_ON}', _atr = '{JS_DIR}addthis/', _ati = '{PATH_IMG_FA}addthis/'{ADDTHIS_LANG}, addthis_localize = { share_caption: "{L_SHARE_CAPTION}", email: "{L_EMAIL}", email_caption: "{L_EMAIL_CAPTION}", favorites: "{L_SHARE_BOOKMARKS}", print: "{L_PRINT}", more: "{L_MORE}" };

$(function(){
    if(typeof(_atc) == "undefined") {
        _atc = {  };
    }
});

var hiddenMsgLabel = { visible:'{JS_HIDE_HIDDEN_MESSAGE}', hidden:'{JS_SHOW_HIDDEN_MESSAGE}' };
showHiddenMessage = function(id) {
    try {
        var regId = parseInt(id, 10);
        if( isNaN(regId) ) { regId = 0; }

        if( regId > 0) {
            $('.post--' + id).toggle(0, function() {
            if( $(this).is(":visible") ) {
              $('#hidden-title--' + id).html(hiddenMsgLabel.visible);
            } else {
              $('#hidden-title--' + id).html(hiddenMsgLabel.hidden);
            }
        });
        }
    } catch(e) { }

  return false;
};

//]]>
</script>

<div class="sub-header">
   <div class="sub-header-info">
      <h1 class="page-title">
           <a href="{TOPIC_URL}">{TOPIC_TITLE}</a>
      </h1>
      <div class="sub-header-path">
        <a class="nav" href="{U_INDEX}"><span>{L_INDEX}</span></a>
        {NAV_CAT_DESC}
      </div>
   </div>

   <div style="height: 31px!important; width: 56%; float: right;">  <div class="sub-header-buttons" style="margin-top: 3px;">
      <!-- BEGIN switch_user_authpost -->
        <a href="{U_POST_NEW_TOPIC}" rel="nofollow" class="ion-edit button1">{L_POST_NEW_TOPIC}</a>
      <!-- END switch_user_authpost -->
      <!-- BEGIN switch_user_authreply -->
        <a href="{U_POST_REPLY_TOPIC}" class="ion-reply button1">{L_POST_REPLY_TOPIC}</a>
          <!-- END switch_user_authreply --></div>
  </div>
</div>


<div class="topic-actions">

  <div class="topic-actions-buttons">
      <!-- BEGIN switch_twitter_btn -->
      <span>
        <a href="https://twitter.com/share" class="twitter-share-button" data-via="{TWITTER}">Tweet</a>
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
      </span>
      <!-- END switch_twitter_btn -->

      <!-- BEGIN switch_fb_likebtn -->
      <script>(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "https://connect.facebook.net/{LANGUAGE}/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));</script>
      <span class="fb-like" data-href="{FORUM_URL}{TOPIC_URL}" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></span>
      <!-- END switch_fb_likebtn -->

      <a class="addthis_button">{L_SHARE}</a>
      <!-- BEGIN switch_plus_menu -->
    <script type="text/javascript">//<![CDATA[
        var url_favourite = '{U_FAVOURITE_JS_PLUS_MENU}';
        var url_newposts = '{U_NEWPOSTS_JS_PLUS_MENU}';
        var url_egosearch = '{U_EGOSEARCH_JS_PLUS_MENU}';
        var url_unanswered = '{U_UNANSWERED_JS_PLUS_MENU}';
        var url_watchsearch = '{U_WATCHSEARCH_JS_PLUS_MENU}';
        insert_plus_menu_new('f{FORUM_ID}&t={TOPIC_ID}','{JS_SESSION_ID}', {JS_AUTH_FAVOURITES});
      //]]>
      </script>
      <!-- END switch_plus_menu -->
  </div>
</div>
     <!-- BEGIN topicpagination -->
<div class="pagination" style="margin-left: 115px; margin-top: 5px; display: block;">
      {PAGINATION}
   </div>
  <!-- END topicpagination -->


<div class="quick-nav-topics">
  <a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a>
    <a href="#bottom">{L_GOTO_DOWN}</a>
  <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a>
</div>
<div style="height: 61px;"></div>
  <center><div class="liligne" style="margin-bottom: 1px;"><div class="lignegau"><gaub>IT’S ALL MY FAULT,</gaub></div><div class="lignedroi">YESTERDAY'S NEWS | <droico>48</droico></div></div></center>

<div style="height: 13px;"></div>

{POLL_DISPLAY}

 <script type="text/javascript">
  $(function() {
    $(".postprofile").stick_in_parent({
     spacer: false,
        offset_top: 42,
  });
});
</script>


<!-- BEGIN postrow -->
  <!-- BEGIN hidden -->
      <div class="post {postrow.hidden.ROW_COUNT}">
        <p style="text-align:center">{postrow.hidden.MESSAGE}</p>
      </div>
  <!-- END hidden -->
  <!-- BEGIN displayed -->


        <div class="post-head">
                      <h2 class="topic-title"><a href="{postrow.displayed.POST_URL}">{postrow.displayed.POST_SUBJECT}</a></h2>
            <div class="topic-date">
                <div class="author">
        <img src="{postrow.displayed.MINI_POST_IMG}" alt="{postrow.displayed.L_MINI_POST_ALT}" title="{postrow.displayed.L_MINI_POST_ALT}" /> {L_TOPIC_BY}&nbsp;{postrow.displayed.POSTER_NAME} {postrow.displayed.POST_DATE_NEW}</div>

              <!-- BEGIN switch_vote_active -->
              <div class="vote">
                  <!-- BEGIN switch_vote -->
                    <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}" class="ion-thumbsup"></a>
                  <!-- END switch_vote -->

                  <!-- BEGIN switch_vote -->
                    <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_MINUS}" class="ion-thumbsdown"></a>
                  <!-- END switch_vote -->

                  <!-- BEGIN switch_bar -->
                  <div class="vote-bar" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}">
                    <div class="vote-bar-desc">
                        {postrow.displayed.switch_vote_active.L_VOTE_TITLE}
                    </div>

                    <div class="vote-bars">
                        <!-- BEGIN switch_vote_plus -->
                          <div class="vote-bar-plus" style="width:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_plus.HEIGHT_PLUS}px;"></div>
                        <!-- END switch_vote_plus -->

                        <!-- BEGIN switch_vote_minus -->
                          <div class="vote-bar-minus" style="width:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_minus.HEIGHT_MINUS}px;"></div>
                        <!-- END switch_vote_minus -->
                    </div>
                  </div> .
                  <!-- END switch_bar -->

                  <!-- BEGIN switch_no_bar -->
                    <div title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}" class="vote-bar-empty"></div>
                  <!-- END switch_no_bar -->
              </div>
              <!-- END switch_vote_active -->
            </div>  <ul class="profile-icons">
              <li class="btn-thank">
                  <a href="{postrow.displayed.THANK_URL}">
                    <i class="ion-heart"></i>
                  </a>
              </li>
              <li class="btn-quote-multi">
                  <span onclick="{postrow.displayed.MULTIQUOTE_URL}" id="post_mq{TOPIC_ID}_{postrow.displayed.U_POST_ID}">
                    <i class="ion-quote"> QUOTE</i>
                    <i class="ion-ios-plus-empty"></i>
                  </span>
              </li>
              <li class="btn-quote">
                  <a href="{postrow.displayed.QUOTE_URL}">
                    <i class="ion-quote"> QUOTE</i>
                  </a>
              </li>
              <li class="btn-edit">
                  <a href="{postrow.displayed.EDIT_URL}">
                    <i class="ion-edit"> EDIT</i>
                  </a>
              </li>
              <li class="btn-delete">
                  <a href="{postrow.displayed.DELETE_URL}">
                    <i class="ion-trash-a"> DELETE</i>
                  </a>
              </li>
              <li class="btn-ip">
                  <a href="{postrow.displayed.IP_URL}">
                    <i class="ion-ios-information"> INFO</i>
                  </a>
              </li>
              <li class="btn-report">
                  {postrow.displayed.REPORT_IMG}
              </li>
            </ul>


        </div>
                            <div id="p{postrow.displayed.U_POST_ID}" class="post {postrow.displayed.ROW_COUNT} post--{postrow.displayed.U_POST_ID}"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
            <div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>
        <div class="postprofile" id="profile{postrow.displayed.U_POST_ID}">
<!-- <div class="online2"></div>-->
 
            <dl>
              <dt>
                                  <div class="postprofile-name">
                                  {postrow.displayed.POSTER_NAME}
                  </div>
              
                  <div class="postprofile-avatar">
                    {postrow.displayed.POSTER_AVATAR}
                  </div>
              
        
              
              
                  <div class="postprofile-rank">
                    {postrow.displayed.POSTER_RANK_NEW}{postrow.displayed.RANK_IMAGE}
                  </div>
              </dt>
              <dd class="postprofile-info">
                  <!-- BEGIN profile_field -->
                    {postrow.displayed.profile_field.LABEL}
                    {postrow.displayed.profile_field.CONTENT}
                    {postrow.displayed.profile_field.SEPARATOR}
                  <!-- END profile_field -->
                  {postrow.displayed.POSTER_RPG}
              </dd>
          
            
                    <div class="contactprof">  <div class="postprofile-contact">
              
                  {postrow.displayed.PM_IMG}
              
                  <!-- BEGIN contact_field -->
                      {postrow.displayed.contact_field.CONTENT}
                  <!-- END contact_field -->
                
              
                  </div></div>
            
                <div class="onlineimg">{postrow.displayed.ONLINE_IMG}</div>

            
            </dl>
        </div>
        <div class="postbody">                
            <div class="content">
              <div>{postrow.displayed.MESSAGE}</div>
              <!-- BEGIN switch_attachments -->
                  <dl class="attachbox">
                    <dt>{postrow.displayed.switch_attachments.L_ATTACHMENTS}</dt>
                    <dd class="attachments">
                        <!-- BEGIN switch_post_attachments -->
                        <dl class="file">
                          <dt>
                              <img src="{postrow.displayed.switch_attachments.switch_post_attachments.U_IMG}" alt=""/>
                          </dt>
                          <dd>
                              <!-- BEGIN switch_dl_att -->
                              <span><a class="postlink" href="{postrow.displayed.switch_attachments.switch_post_attachments.switch_dl_att.U_ATTACHMENT}">{postrow.displayed.switch_attachments.switch_post_attachments.switch_dl_att.ATTACHMENT}</a> {postrow.displayed.switch_attachments.switch_post_attachments.switch_dl_att.ATTACHMENT_DEL}</span>
                              <!-- END switch_dl_att -->

                              <!-- BEGIN switch_no_dl_att -->
                              <span>{postrow.displayed.switch_attachments.switch_post_attachments.switch_no_dl_att.ATTACHMENT} {postrow.displayed.switch_attachments.switch_post_attachments.switch_no_dl_att.ATTACHMENT_DEL}</span>
                              <!-- END switch_no_dl_att -->

                              <!-- BEGIN switch_no_comment -->
                              <span>{postrow.displayed.switch_attachments.switch_post_attachments.switch_no_comment.ATTACHMENT_COMMENT}</span>
                              <!-- END switch_no_comment -->

                              <!-- BEGIN switch_no_dl_att -->
                              <span><strong>{postrow.displayed.switch_attachments.switch_post_attachments.switch_no_dl_att.TEXT_NO_DL}</strong></span>
                              <!-- END switch_no_dl_att -->

                              <span>({postrow.displayed.switch_attachments.switch_post_attachments.FILE_SIZE}) {postrow.displayed.switch_attachments.switch_post_attachments.NB_DL}</span>
                          </dd>
                        </dl>
                        <!-- END switch_post_attachments -->
                    </dd>
                  </dl>
              <!-- END switch_attachments -->
            </div>
            <!-- BEGIN switch_signature -->
          <div class="signature_div" id="sig{postrow.displayed.U_POST_ID}"><div style="margin-top: -20px;"></div>{postrow.displayed.SIGNATURE_NEW}</div>
            <!-- END switch_signature -->
        </div>
      </div>
      <!-- BEGIN first_post_br -->
      <hr id="first-post-br" />
      <!-- END first_post_br -->
  <!-- END displayed -->
<!-- END postrow -->

<a name="bottomtitle"></a>

<!-- BEGIN topicpagination -->
  <div class="pagination" style="margin-top: 6px;">
        {PAGINATION}
      </div>

  <!-- END topicpagination -->


<div class="quick-nav-topics bottom" style="margin-top: 6px;">
  <a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a>
    <a href="#top">{L_BACK_TO_TOP}</a>
  <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a>
</div>


<div class="topic-actions bottom">

  <div class="topic-actions-buttons down" style="width: 750px; position: absolute; top: 50px;">
      <!-- BEGIN switch_user_logged_in -->
        <!-- BEGIN watchtopic -->
            {S_WATCH_TOPIC}
        <!-- END watchtopic -->
      <!-- END switch_user_logged_in -->
<div style="float: right;">
      <!-- BEGIN switch_user_authpost -->
        <a href="{U_POST_NEW_TOPIC}" rel="nofollow" class="ion-edit button1">{L_POST_NEW_TOPIC}</a>
      <!-- END switch_user_authpost -->
      <!-- BEGIN switch_user_authreply -->
        <a href="{U_POST_REPLY_TOPIC}" class="ion-reply button1">{L_POST_REPLY_TOPIC}</a>
        <!-- END switch_user_authreply --></div>
  </div>
</div>


<!-- BEGIN promot_trafic -->
  <div class="block" id="ptrafic_close" style="display: none;">
      <div class="h3"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><i class="ion-ios-plus-outline"></i></a>{PROMOT_TRAFIC_TITLE}</div>
  </div>
  <div class="block" id="ptrafic_open" style="display:'';">
      <div class="h3"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><i class="ion-ios-minus-outline"></i></a>{PROMOT_TRAFIC_TITLE}</div>
      <ul class="ptrafic">
        <!-- BEGIN link -->
            <li>
              <a href="{promot_trafic.link.U_HREF}" target="_blank" title="{promot_trafic.link.TITLE}" rel="nofollow">
                  <i class="ion-ios-chatbubble-outline"></i>{promot_trafic.link.TITLE}
              </a>
            </li>
        <!-- END link -->
      </ul>
  </div>
<!-- END promot_trafic -->

<!-- BEGIN switch_forum_rules -->
<div class="post row1" id="forum_rules">
  <div class="h3">{L_FORUM_RULES}</div>
  <div class="clear"></div>
  <table class="postbody">
      <tr>
        <!-- BEGIN switch_forum_rule_image -->
        <td class="logo">
            <img src="{RULE_IMG_URL}" alt="" />
        </td>
        <!-- END switch_forum_rule_image -->
        <td class="rules content">
            {RULE_MSG}
        </td>
      </tr>
  </table>
</div>
<!-- END switch_forum_rules -->

<!-- BEGIN switch_user_logged_in -->
  <a name="quickreply"></a>
  {QUICK_REPLY_FORM}
<!-- END switch_user_logged_in -->

<!-- BEGIN show_permissions -->
  <div class="block" style="padding: 0px; padding-top: 18px; padding-bottom: 10px; border-bottom: 1px solid #593f20; margin-bottom: 4px;">
      <div class="h3">{L_TABS_PERMISSIONS}</div>
      {S_AUTH_LIST}
  </div>
<!-- END show_permissions -->



<table width="750px"><tr><td valign="top">
<!-- BEGIN viewtopic_bottom -->
<form method="get" action="{S_FORM_MOD_ACTION}">
  <fieldset class="quickmod">
      <input type="hidden" name="t" value="{TOPIC_ID}" />

      <!-- <input type="hidden" name="sid" value="{S_SID}" /> -->
      <input type="hidden" name="{SECURE_ID_NAME}" value="{SECURE_ID_VALUE}" />
      <label>{L_MOD_TOOLS}:</label>
      {S_SELECT_MOD}
      <input class="button2" type="submit" value="{L_GO}" />
  </fieldset>
</form>

<p class="left">{S_TOPIC_ADMIN}</p>
<!-- END viewtopic_bottom -->
  </td><td width="20px"></td><td valign="top"><form action="{S_JUMPBOX_ACTION}" method="get" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
  <fieldset class="jumpbox">
      <label>{L_JUMP_TO}:</label>
      {S_JUMPBOX_SELECT}
      <input class="button2" type="submit" value="{L_GO}" />
  </fieldset>
  </form></td></tr></table>


<!-- BEGIN switch_image_resize -->
<script type="text/javascript">
//<![CDATA[
$(resize_images({ 'selector' : '.postbody .content', 'max_width' : {switch_image_resize.IMG_RESIZE_WIDTH}, 'max_height' : {switch_image_resize.IMG_RESIZE_HEIGHT} }));
//]]>
</script>
<!-- END switch_image_resize -->

<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=forumotion" type="text/javascript"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github-gist.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/go.min.js"></script>
<script>
$(document).ready(function() {
  $('pre, code').each(function(i, block) {
      hljs.highlightBlock(block);
  });

  $('.post').each(function() {
      if (!$(this).find('.postprofile-avatar').html().length) {
        $(this).find('.postprofile-rank').css('border-bottom', 'none');
        $(this).find('.postprofile > dl > dt').css('min-height', $(this).find('.post-head').innerHeight());
      }
  });
});
</script>
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Walt Mar 20 Mar 2018 - 19:11

Bonsoir,

Je pense que c'est dû à une modification du template, mais pour en être sûr pouvez-vous tester après avoir désactivé le script personnalisé ?
Les sujets ressemblent assez peu à la version ModernBB (s'il s'agit bien de ce forum), vous avez repris les templates d'une autre version pour les adapter ?

Cordialement,
Walt
Walt

Walt
Modéractif
Modéractif

Masculin
Messages : 6082
Inscrit(e) le : 08/09/2015

Walt a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Beylin Mar 20 Mar 2018 - 19:34

Merci beaucoup pour ta réactivité I love you

Oui, il s'agit bien de ce forum et non, on a tout codé sur modern BB Embarassed

Quand on désactive le script, le script ne marche pas et ça fait buguer la partie réponse rapide ( https://images2.imgbox.com/cb/2f/k3pii16R_o.png )

Quand on désactive le script ET le template, ça fonctionne. Tu nous conseilles quoi ?
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Walt Mar 20 Mar 2018 - 20:00

J'ai modifié le script pour l'adapter à votre template, essayez cela :

Code:
$(function() {
  var version = 4,
      image = 'http://i19.servimg.com/u/f19/18/21/60/73/mentio10.png';
 
  if (/mode=reply/.test(window.location.search) && my_getcookie('fa_mention')) {
    document.post.message.value += '@"' + my_getcookie('fa_mention') + '" ';
    my_setcookie('fa_mention',''); 
  } if (!/\/t\d+/.test(window.location.pathname)) return;
 
  for (var a = $(['.post-options', '.profile-icons', '.post-options', '.posting-icons', '.profile-icons'][version]), b, c, d = ['.name strong a', '.author a', '.username a', '.author a', '.postprofile-name a'][version], e, i = 0, j = a.length, t = document.getElementById('text_editor_textarea'), l = version == 1 || version == 3 || version == 4; i<j; i++) {
    b = document.createElement('IMG');
    b.src = image;
    b.alt = 'Mentionner';
    b.title = 'Mentionner ' + $(a[i]).closest('.post-head').next('.post').find(d + ':not(.fa-mention)').text();
    b.className = 'i_icon_mention';
    b.onclick = function() {
      var n = this.title.replace(/^.*?\s/,'');
     
      if ($.sceditor) t.insertText('@"' + n + '" ');
      else {
        my_setcookie('fa_mention', n);
        window.location.href = '/post?t=' + window.location.pathname.replace(/\/t(\d+)-.*/,'$1') + '&mode=reply';
      }
    };
 
    if (l) {
      c = document.createElement('LI');
      c.appendChild(b);
    }
   
    a[i].insertBefore(l ? c : b, a[i].firstChild);
  }
 
  $(function(){
    if (!$.sceditor) return;
    t=$(t).sceditor('instance');
  });
});

Cordialement,
Walt
Walt

Walt
Modéractif
Modéractif

Masculin
Messages : 6082
Inscrit(e) le : 08/09/2015

Walt a été remercié(e) par l'auteur de ce sujet.

Résolu Re: mentionner : soucis avec var n = this.title.replace

Message par Beylin Jeu 22 Mar 2018 - 9:05

Hello Walt,

On a essayé et ça ne fonctionnait pas. En fait on a fini par comprendre d'où venait le problème.
Le bouton tag existe et fonctionne sur Modern BB, mais on avait déplacé quelque chose dans les template qui a fait bug le script !

Merci beaucoup pour ton aide I love you
Beylin

Beylin
Nouveau membre

Messages : 23
Inscrit(e) le : 31/01/2010

http://gameofshadows.org
Beylin 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