FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 8 users online :: 0 Registered, 0 Hidden and 8 Guests

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

[SOLVED] auto solved button

View previous topic View next topic Go down

Anonymous
Guest
Guest

PostGuest Mon 08 Aug 2016, 17:33

@Royal Bengal: We've got a beautiful forum for these kind of questions... Why not try and start using it?

[SOLVED] auto solved button 943a5acdf0d941d8ae91feedf71d5059

*** Topic moved to the C&G Questions section ***
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12054
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 08 Aug 2016, 17:48

Hi @Royal Bengal,

It's a script I made for the support awhile back when I was still staff. It's for phpbb3 only, and I have no intention of converting it for other versions currently, if anything I'd probably make a new script.

Anyway to install the script go to Admin Panel > Modules > JavaScript codes management and create a new script with the following settings.

Placement : In all the topics
Code:
$(function() {
  window.$fa_solved = {
    forums : /42|43|44|45|46|63/,
   
    icon : {
      id : 3,
      image : 'http://i62.servimg.com/u/f62/11/22/70/40/solved10.png'
    },
   
    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 : $('.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 = $('.post', main)[0], fid = $('.topic-actions:first .pathname-box a:last', main).attr('href'), author = $('.postprofile dt', post).text(),  icon = $('.topic-title img', main),  mod = $('.i_icon_ip', post)[0], button = document.createElement('A');
 
  if (icon[0].src != $fa_solved.icon.image && $fa_solved.forums.test(fid)) {
    if (!mod && author != _userdata.username) return;
  } else 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, icon = $('.topic-title img', document.getElementById('main-content'));
    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';
        icon.attr('src', $fa_solved.icon.image);
      });
    });
   
    return false;
  };
 
  main.insertBefore(button, post);
});

document.write('<style type="text/css">a.markSolved, a.markSolved:active, a.markSolved:focus {background-color:#8C5;border-color:#8C5;padding:5px 12px !important;}a.markSolved:hover {background-color:#7B4;border-color:#6A3;}a.markSolved.marked {opacity:0.5}a.markSolved i {font-size:13px}</style>');

Modifications :

forums : replace the numbers in 42|43|44|45|46|63 with the id of the forum you want the button to show up in. You can see the forum id by looking at the URL when you're inside a forum. For example :
https://fmdesign.forumotion.com/f3-announcements-and-important-topics = 3 ( see the "f3" ? )

id : This is the id of your solved icon. To find it, you need to go to Admin Panel > Display > Pics management > Advanced > Topics icons > edit your solved icon

Look at the URL in your address bar, and look for "icon=N" where N would be the id of your topic icon. Once you've found it, replace the "3" that's currently set as the id.

Save the script when you're finished. Wink
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12054
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 08 Aug 2016, 19:05

What are you trying to make a green bar ?
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12054
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 08 Aug 2016, 19:21

It is the same script as Forumotion. What's different about it ? Could you take a screenshot to show me ?
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12054
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 08 Aug 2016, 19:33

Ah thanks, that explains it ! It's a problem with the CSS. Try adding the following rules to your stylesheet :
Code:
/* solved button */
a.markSolved, a.markSolved:active, a.markSolved:focus {
  background:#8C5 !important;
  border:1px solid #8C5 !important;
  padding:5px 12px !important;
}
a.markSolved:hover {
  background:#7B4 !important;
  border:1px solid #6A3 !important;
}
a.markSolved.marked { opacity:0.5 }
a.markSolved i { font-size:13px }
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12054
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 08 Aug 2016, 19:45

You're welcome ! ^^

Topic archived

Have a good day. Smile
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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