How do I add a solved Button like on here?
4 posters
Page 1 of 1
How do I add a solved Button like on here?
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.
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
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
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: How do I add a solved Button like on here?
It's not working
I'm using this code, and nothings appearing in posts.
- 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
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
Did you activated JavaScript Management?
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: How do I add a solved Button like on here?
I did yes
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
- 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
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
I mean in the administration panel did you activated it by checked the yes box at the top of the JavaScript list.
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: How do I add a solved Button like on here?
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
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
What option did you pick for the placement?
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: How do I add a solved Button like on here?
SLGray wrote:What option did you pick for the placement?
In the topics
Rthera- Forumember
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
Ok. I will tag @Ange Tuteur for you.
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: How do I add a solved Button like on here?
SLGray wrote:Ok. I will tag @Ange Tuteur for you.
Thank you kindly for your assistance - Sorry I'm being a pain xD
Rthera- Forumember
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
It is ok. We are here to offer support.
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.
Rthera- Forumember
- Posts : 174
Reputation : 8
Language : English
Re: How do I add a solved Button like on here?
Hi,
That script is for phpbb2, use this script for phpbb3 :
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';
});
Re: How do I add a solved Button like on here?
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
- Posts : 174
Reputation : 8
Language : English
Similar topics
» Solved Button but with different text?
» Solved Button
» Thanks button? (Solved)
» Mark solved button, how to add it
» Solved button
» Solved Button
» Thanks button? (Solved)
» Mark solved button, how to add it
» Solved button
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum