The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    How do I add a solved Button like on here?

    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress How do I add a solved Button like on here?

    Post by Rthera December 24th 2015, 7:19 pm

    Hello again,

    I want to know how I can make a "Marked solved" button like on here? I'm using a phpbb3. Thank you kindly for your assistance.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: How do I add a solved Button like on here?

    Post by SLGray December 24th 2015, 7:21 pm




    How do I add a solved Button like on here? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 24th 2015, 7:41 pm

    It's not working

    Code:
    $(function() {
      window.$fa_solved = {
     
        icon : {
          id : 2
        },
     
        lang : {
          mark : '<i class="fa"></i> <img src=http://i64.tinypic.com/27ystac.png>',
          mark_title : 'Marking your topic with the Solved icon will let staff know your problem has been resolved.',
          mark_title_mod : 'Mark this topic Solved',
          marking : '<i class="fa fa-spin"></i> <img src=imageurl>,
          marked : '<i class="fa"></i><img src= http://i67.tinypic.com/25uu1ee.png>'
        },
     
        post_id : $('tr.post')[0].id.slice(1),
     
        encode : function(string) {
          return encodeURIComponent(escape(string).replace(/%u[A-F0-9]{4}/g, function(match) {
            return '&#' + parseInt(match.substr(2), 16) + ';';
          })).replace(/%25/g, '%');
        }
     
      };
     
      var main = document.getElementById('page-body'), post = $('tr.post', main)[0], author = $('.poster-profile a[href^="/u"]', post).text(), mod = $('.i_icon_ip', post)[0], button = document.createElement('A');
     
      if (!mod && author != _userdata.username) return;
     
      button.innerHTML = $fa_solved.lang.mark;
      button.title = mod ? $fa_solved.mark_title_mod : $fa_solved.mark_title;
      button.className = 'button1 markSolved';
      button.href = '#';
     
      button.onclick = function() {
        var t = this;
        t.innerHTML = $fa_solved.lang.marking;
        t.removeAttribute('title');
        t.onclick = function() { return false };
     
        $.get('/post?p=' + $fa_solved.post_id + '&mode=editpost', function(d) {
          var auth = $('input[name="auth[]"]', d);
          $.post('/post', 'subject=' + $fa_solved.encode($('input[name="subject"]', d)[0].value) + '&message=' + $fa_solved.encode($('#text_editor_textarea', d)[0].value) + '&p=' + $fa_solved.post_id + '&post_icon=' + $fa_solved.icon.id + '&mode=editpost&auth[]=' + auth[0].value + '&auth[]=' + auth[1].value + '&post=1', function() {
            t.innerHTML = $fa_solved.lang.marked;
            t.className += ' marked';
          });
        });
     
        return false;
      };
     
      main.insertBefore(button, main.firstChild);
      'par ange tuteur';
    });

    I'm using this code, and nothings appearing in posts. :/


    Last edited by Rthera on December 24th 2015, 7:46 pm; edited 1 time in total
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: How do I add a solved Button like on here?

    Post by SLGray December 24th 2015, 7:46 pm

    Did you activated JavaScript Management?



    How do I add a solved Button like on here? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 24th 2015, 7:47 pm

    I did yes
    Code:
    $(function() {
      window.$fa_solved = {
     
        icon : {
          id : 2
        },
     
        lang : {
          mark : '<i class="fa"></i> <img src=http://i64.tinypic.com/27ystac.png>',
          mark_title : 'Marking your topic with the Solved icon will let staff know your problem has been resolved.',
          mark_title_mod : 'Mark this topic Solved',
          marking : '<i class="fa fa-spin"></i> <img src=imageurl>,
          marked : '<i class="fa"></i><img src= http://i67.tinypic.com/25uu1ee.png>'
        },
     
        post_id : $('tr.post')[0].id.slice(1),
     
        encode : function(string) {
          return encodeURIComponent(escape(string).replace(/%u[A-F0-9]{4}/g, function(match) {
            return '&#' + parseInt(match.substr(2), 16) + ';';
          })).replace(/%25/g, '%');
        }
     
      };
     
      var main = document.getElementById('page-body'), post = $('tr.post', main)[0], author = $('.poster-profile a[href^="/u"]', post).text(), mod = $('.i_icon_ip', post)[0], button = document.createElement('A');
     
      if (!mod && author != _userdata.username) return;
     
      button.innerHTML = $fa_solved.lang.mark;
      button.title = mod ? $fa_solved.mark_title_mod : $fa_solved.mark_title;
      button.className = 'button1 markSolved';
      button.href = '#';
     
      button.onclick = function() {
        var t = this;
        t.innerHTML = $fa_solved.lang.marking;
        t.removeAttribute('title');
        t.onclick = function() { return false };
     
        $.get('/post?p=' + $fa_solved.post_id + '&mode=editpost', function(d) {
          var auth = $('input[name="auth[]"]', d);
          $.post('/post', 'subject=' + $fa_solved.encode($('input[name="subject"]', d)[0].value) + '&message=' + $fa_solved.encode($('#text_editor_textarea', d)[0].value) + '&p=' + $fa_solved.post_id + '&post_icon=' + $fa_solved.icon.id + '&mode=editpost&auth[]=' + auth[0].value + '&auth[]=' + auth[1].value + '&post=1', function() {
            t.innerHTML = $fa_solved.lang.marked;
            t.className += ' marked';
          });
        });
     
        return false;
      };
     
      main.insertBefore(button, main.firstChild);
      'par ange tuteur';
    });

    I followed every single step on the post but it doesn't seem to work. Perhaps Ange Tuteur could assist me, I am using phpbb3

    Thanks
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: How do I add a solved Button like on here?

    Post by SLGray December 24th 2015, 8:35 pm

    I mean in the administration panel did you activated it by checked the yes box at the top of the JavaScript list.



    How do I add a solved Button like on here? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 24th 2015, 8:36 pm

    SLGray wrote:I mean in the administration panel did you activated it by checked the yes box at the top of the JavaScript list.

    Yes I have, It was already activated, I've put all the code in and it just doesn't appear :/
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: How do I add a solved Button like on here?

    Post by SLGray December 24th 2015, 8:39 pm

    What option did you pick for the placement?



    How do I add a solved Button like on here? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 24th 2015, 8:41 pm

    SLGray wrote:What option did you pick for the placement?

    In the topics
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: How do I add a solved Button like on here?

    Post by SLGray December 24th 2015, 8:49 pm

    Ok.  I will tag @Ange Tuteur for you.



    How do I add a solved Button like on here? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 24th 2015, 8:50 pm

    SLGray wrote:Ok.  I will tag @Ange Tuteur for you.

    Thank you kindly for your assistance Smile - Sorry I'm being a pain xD
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: How do I add a solved Button like on here?

    Post by SLGray December 24th 2015, 8:56 pm

    It is ok.  We are here to offer support.



    How do I add a solved Button like on here? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 28th 2015, 7:21 pm

    Bump
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: How do I add a solved Button like on here?

    Post by Ange Tuteur December 29th 2015, 3:15 pm

    Hi,

    That script is for phpbb2, use this script for phpbb3 :
    Code:
    $(function() {
      window.$fa_solved = {
     
        icon : {
          id : 3
        },
     
        lang : {
          mark : '<i class="fa"></i> Mark Solved',
          mark_title : 'Marking your topic with the Solved icon will let staff know your problem has been resolved.',
          mark_title_mod : 'Mark this topic Solved',
          marking : '<i class="fa fa-spin"></i> Marking...',
          marked : '<i class="fa"></i> Solved !'
        },
     
        post_id : $('div.post')[0].id.slice(1),
     
        encode : function(string) {
          return encodeURIComponent(escape(string).replace(/%u[A-F0-9]{4}/g, function(match) {
            return '&#' + parseInt(match.substr(2), 16) + ';';
          })).replace(/%25/g, '%');
        }
     
      };
     
      var main = document.getElementById('main-content'), post = $('div.post', main)[0], author = $('.postprofile a[href^="/u"]', post).text(), mod = $('.i_icon_ip', post)[0], button = document.createElement('A');
     
      if (!mod && author != _userdata.username) return;
     
      button.innerHTML = $fa_solved.lang.mark;
      button.title = mod ? $fa_solved.mark_title_mod : $fa_solved.mark_title;
      button.className = 'button1 markSolved';
      button.href = '#';
     
      button.onclick = function() {
        var t = this;
        t.innerHTML = $fa_solved.lang.marking;
        t.removeAttribute('title');
        t.onclick = function() { return false };
     
        $.get('/post?p=' + $fa_solved.post_id + '&mode=editpost', function(d) {
          var auth = $('input[name="auth[]"]', d);
          $.post('/post', 'subject=' + $fa_solved.encode($('input[name="subject"]', d)[0].value) + '&message=' + $fa_solved.encode($('#text_editor_textarea', d)[0].value) + '&p=' + $fa_solved.post_id + '&post_icon=' + $fa_solved.icon.id + '&mode=editpost&auth[]=' + auth[0].value + '&auth[]=' + auth[1].value + '&post=1', function() {
            t.innerHTML = $fa_solved.lang.marked;
            t.className += ' marked';
          });
        });
     
        return false;
      };
     
      main.insertBefore(button, main.firstChild);
      'par ange tuteur';
    });
    Hamtaro
    Hamtaro
    Forumember


    Posts : 47
    Reputation : 2
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Hamtaro December 30th 2015, 1:30 pm

    How about for invision?
    avatar
    Rthera
    Forumember


    Male Posts : 174
    Reputation : 8
    Language : English

    In progress Re: How do I add a solved Button like on here?

    Post by Rthera December 30th 2015, 10:43 pm

    Ange Tuteur wrote:Hi,

    That script is for phpbb2, use this script for phpbb3 :
    Code:
    $(function() {
      window.$fa_solved = {
     
        icon : {
          id : 3
        },
     
        lang : {
          mark : '<i class="fa"></i> Mark Solved',
          mark_title : 'Marking your topic with the Solved icon will let staff know your problem has been resolved.',
          mark_title_mod : 'Mark this topic Solved',
          marking : '<i class="fa fa-spin"></i> Marking...',
          marked : '<i class="fa"></i> Solved !'
        },
     
        post_id : $('div.post')[0].id.slice(1),
     
        encode : function(string) {
          return encodeURIComponent(escape(string).replace(/%u[A-F0-9]{4}/g, function(match) {
            return '&#' + parseInt(match.substr(2), 16) + ';';
          })).replace(/%25/g, '%');
        }
     
      };
     
      var main = document.getElementById('main-content'), post = $('div.post', main)[0], author = $('.postprofile a[href^="/u"]', post).text(), mod = $('.i_icon_ip', post)[0], button = document.createElement('A');
     
      if (!mod && author != _userdata.username) return;
     
      button.innerHTML = $fa_solved.lang.mark;
      button.title = mod ? $fa_solved.mark_title_mod : $fa_solved.mark_title;
      button.className = 'button1 markSolved';
      button.href = '#';
     
      button.onclick = function() {
        var t = this;
        t.innerHTML = $fa_solved.lang.marking;
        t.removeAttribute('title');
        t.onclick = function() { return false };
     
        $.get('/post?p=' + $fa_solved.post_id + '&mode=editpost', function(d) {
          var auth = $('input[name="auth[]"]', d);
          $.post('/post', 'subject=' + $fa_solved.encode($('input[name="subject"]', d)[0].value) + '&message=' + $fa_solved.encode($('#text_editor_textarea', d)[0].value) + '&p=' + $fa_solved.post_id + '&post_icon=' + $fa_solved.icon.id + '&mode=editpost&auth[]=' + auth[0].value + '&auth[]=' + auth[1].value + '&post=1', function() {
            t.innerHTML = $fa_solved.lang.marked;
            t.className += ' marked';
          });
        });
     
        return false;
      };
     
      main.insertBefore(button, main.firstChild);
      'par ange tuteur';
    });

    Hello Ange,

    Unfortunately, the code didn't work.

    How do I add a solved Button like on here? 2015-111

      Current date/time is September 22nd 2024, 5:30 pm