I have the below code for my phpBB2 forum:
The issues are that firstly, when I hover over the Mark as Solved image it states 'undefined', despite the above coding demanding that it says "Marking your topic with the Solved icon will let staff know your problem has been resolved.". Can anyone tell me why that is not working as it should?
Secondly, once I marked a topic as solved, I may leave and then come back to the topic to find that it will show the original 'Mark as Solved' image again, rather than the 'Marked as Solved' image. In other words, it appears as if you can then remark it as solved, whereas in this forum I believe the image simply disappears altogether or remains another image. It does not revert back to the original option.
Finally, can anyone provide a code that could move this entire function to beside the Post Reply button. It looks rather odd hovering up there just under the navbar, as it does at the moment.
Specifically, in this topic I have been testing the javascript.
- Code:
$(function() {
window.$fa_solved = {
icon : {
id : 1
},
lang : {
mark : '<i class="fa"></i><img src=https://i11.servimg.com/u/f11/19/75/78/74/rsz_1111.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"></i><img src=https://i11.servimg.com/u/f11/19/75/78/74/rsz_1111.png>',
marked : '<i class="fa"></i><img src=https://i11.servimg.com/u/f11/19/75/78/74/rsz_1311.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';
});
The issues are that firstly, when I hover over the Mark as Solved image it states 'undefined', despite the above coding demanding that it says "Marking your topic with the Solved icon will let staff know your problem has been resolved.". Can anyone tell me why that is not working as it should?
Secondly, once I marked a topic as solved, I may leave and then come back to the topic to find that it will show the original 'Mark as Solved' image again, rather than the 'Marked as Solved' image. In other words, it appears as if you can then remark it as solved, whereas in this forum I believe the image simply disappears altogether or remains another image. It does not revert back to the original option.
Finally, can anyone provide a code that could move this entire function to beside the Post Reply button. It looks rather odd hovering up there just under the navbar, as it does at the moment.
Specifically, in this topic I have been testing the javascript.