The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How do I add a solved Button like on here?

View previous topic View next topic Go down

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

Post by Rthera on 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.

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

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



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


SLGray
Administrator
Administrator

Male Posts : 35629
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

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

Post by Rthera on 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

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

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

Did you activated JavaScript Management?


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


SLGray
Administrator
Administrator

Male Posts : 35629
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

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

Post by Rthera on 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

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

Post by SLGray on 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.


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


SLGray
Administrator
Administrator

Male Posts : 35629
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

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

Post by Rthera on 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 :/

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

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

What option did you pick for the placement?


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


SLGray
Administrator
Administrator

Male Posts : 35629
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

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

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

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

In the topics

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

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

Ok.  I will tag @Ange Tuteur for you.


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


SLGray
Administrator
Administrator

Male Posts : 35629
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

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

Post by Rthera on 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

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

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

It is ok.  We are here to offer support.


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


SLGray
Administrator
Administrator

Male Posts : 35629
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

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

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

Bump

Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

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

Post by Ange Tuteur on 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';
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

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

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

How about for invision?

Hamtaro
Forumember

Posts : 47
Reputation : 2
Language : English

http://Www.the30s.forumotion.net

Back to top Go down

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

Post by Rthera on 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.


Rthera
Forumember

Male Posts : 174
Reputation : 8
Language : English

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum