Make auto solved
4 posters
Page 1 of 1
Make auto solved
Forum version : Phpbb2
Position : Administrator
Concerned browser(s) : Google Chrome
Who the problem concerns : all
Forum link : http://gamemunity.team-talk.net/
i have a button called "Mark solved" how i can do it to make auto solved when pressed like this forum ?
Position : Administrator
Concerned browser(s) : Google Chrome
Who the problem concerns : all
Forum link : http://gamemunity.team-talk.net/
i have a button called "Mark solved" how i can do it to make auto solved when pressed like this forum ?
- Code:
$(function() {
var icon_id = 2,
notice_msg = '<img src=http://oi65.tinypic.com/1051e8w.jpg height=20 style=vertical-align:middle> Help organize the forum if your question has been resolved click solved',
button_icon = '<img src=http://oi65.tinypic.com/1051e8w.jpg>',
postbody = $('.postbody')[0],
edit, icon;
if (postbody) {
edit = $(postbody).closest('.post').find('.i_icon_edit')[0];
if (edit) {
$('#page-body').prepend('<div style="background:#000000;border:1px color:#545252;padding:5px;color:#FFFFFF;text-align:center;font-family:Verdana;font-size:11px">' + notice_msg + '</div>');
$('.nav:has(> a[href*="mode=reply"])').append('   <a href="' + edit.parentNode.href + '&solved=true">' + button_icon + '</a>');
}
}
if (location.href.match(/&solved=true/)) {
icon = document.getElementById('post_icon_' + icon_id);
if (icon) {
icon.checked = true;
document.post && document.post.post.click();
}
}
});
Last edited by Luis Ferreira on November 23rd 2015, 16:09; edited 1 time in total
Re: Make auto solved
So that JavaScript is not working?
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: Make auto solved
it works but when i press the button goes to edit and i want to make it aproved by him self
Re: Make auto solved
Where did you get the JavaScript?
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: Make auto solved
Could you please post the link to the topic?
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: Make auto solved
Can you say something ? like oh i dont know or im trying to fix or it is impossible
Re: Make auto solved
Maybe @Ange Tuteur can help 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: Make auto solved
Hi,
Try adding the following script to your JavaScripts.
Modules > JavaScript codes management > New
Placement : In the topics
Make sure to replace the 3 in
with the ID of your solved icon. Also, this script was originally meant for phpbb3, so if there are any problems let me know.
Try adding the following script to your JavaScripts.
Modules > JavaScript codes management > New
Placement : In the topics
- 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 : $('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';
});
Make sure to replace the 3 in
|
Re: Make auto solved
You can see the id by opening your Devtools ( F12 ) and going to the DOM inspector. Then proceed to select an element from the page and hover over your solved icon's radio button. The number will be at the end, "6" in this example :
Re: Make auto solved
- Code:
$(function() {
window.$fa_solved = {
icon : {
id : "post_icon_1"
},
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 : $('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';
});
so i have this but doesnt seems to work properly sorry
as you can see it have a infinit "marking..." and sometimes it bugs all the post and then i refresh and its ok but it doestn work properly
Re: Make auto solved
In your script, change
to
.
The id must be an integer, not a DOM id.
|
|
The id must be an integer, not a DOM id.
Re: Make auto solved
thanks that worked btw i made some changes to add a image instead of a text.
- Code:
$(function() {
window.$fa_solved = {
icon : {
id : 1
},
lang : {
mark : '<i class="fa"></i> <img src=imageurl>',
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= imageurl>'
},
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';
});
Re: Make auto solved
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: Make auto solved
Topic solved and archived ~ brandon_g
Remember to mark your topic when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?
Team Leader
Review Section Rules | Request A Review | Sticker Points
Similar topics
» Can You Make A Topic Sticky and Locked (SOLVED)
» How to make the signatures auto show!
» How can I make users auto-login in new chatbox?
» How to make users auto-transit between groups?
» Auto-pruning into Auto-Locking
» How to make the signatures auto show!
» How can I make users auto-login in new chatbox?
» How to make users auto-transit between groups?
» Auto-pruning into Auto-Locking
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum