Script RESOLVED problems
4 posters
Page 1 of 1
Script RESOLVED problems
Hi,
Thanks to this code @Ange Tuteur provided, we were just wondering if there's anyway to change the script so instead of it adding an icon next the topic icon it will change the topic title to [RESOLVED] Topic title text.
How do i restrict it so it's only available for one category, for example, it only appears in the "Ask questions" section of the forum and nowhere else. & As soon as the button has been pressed it disappears and they can't click it again?
Here's a picture of an example

Here's the code Ange provided:
Thanks to this code @Ange Tuteur provided, we were just wondering if there's anyway to change the script so instead of it adding an icon next the topic icon it will change the topic title to [RESOLVED] Topic title text.
How do i restrict it so it's only available for one category, for example, it only appears in the "Ask questions" section of the forum and nowhere else. & As soon as the button has been pressed it disappears and they can't click it again?
Here's a picture of an example

Here's the code Ange provided:
- Code:
$(function() {
window.$fa_solved = {
icon : {
id : 2
},
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';
});
Last edited by Avedo on Sat Apr 02, 2016 6:45 pm; edited 2 times in total
Re: Script RESOLVED problems
Bump
Last edited by Avedo on Wed Mar 30, 2016 8:27 pm; edited 1 time in total
Re: Script RESOLVED problems
Is this solved?


Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Script RESOLVED problems
AP > General > Messages & Emails > Configuration
Topics Section
Allow the modification of the topic title: Yes
Display button [solved]: Yes
Topics Section
Allow the modification of the topic title: Yes
Display button [solved]: Yes


Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Script RESOLVED problems
I already knew how to do that, I was wondering if it was possible to re code the script so when you press the "Mark solved" button it adds the [SOLVED] text to the topic title.
Like on the photo.
Like on the photo.
Re: Script RESOLVED problems
Hi,
Try replacing the script with this :
At the top you'll see this snippet :
Try replacing the script with this :
- Code:
$(function() {
if (!/43/.test($('.topic-actions:first .pathname-box a:last', main).attr('href'))) return;
window.$fa_solved = {
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('[RESOLVED]' + $('input[name="subject"]', d)[0].value) + '&message=' + $fa_solved.encode($('#text_editor_textarea', d)[0].value) + '&p=' + $fa_solved.post_id + '&mode=editpost&auth[]=' + auth[0].value + '&auth[]=' + auth[1].value + '&post=1', function() {
t.innerHTML = $fa_solved.lang.marked;
t.className += ' marked';
$('.topic-title a').each(function() {
this.innerHTML = '[RESOLVED]' + this.innerHTML;
})
});
});
return false;
};
main.insertBefore(button, main.firstChild);
'par ange tuteur';
});
At the top you'll see this snippet :
- Code:
if (!/43/.test($('.topic-actions:first .pathname-box a:last', main).attr('href'))) return;
Re: Script RESOLVED problems
Hello @Ange Tuteur How would we make the [RESOLVED] text green like the image we provided?
Re: Script RESOLVED problems
You would need a script which finds all links that contain the texts "[RESOLVED]" and replace the html content to wrap it with tags. See this topic :
https://help.forumotion.com/t133869-style-topic-title-keywords
https://help.forumotion.com/t133869-style-topic-title-keywords
Re: Script RESOLVED problems
This seems rather difficult, so we're going to leave that one out xD Thank you kindly for the help Ange! 


» script problems
» script Problems
» PHPbb2 Script Problems
» Chatbox Script Problems
» youtube script problems
» script Problems
» PHPbb2 Script Problems
» Chatbox Script Problems
» youtube script problems
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum