Informações:
Autor: Daemon
Funcionalidade: PhpBB3 e PunBB
Acesse:
E Crie um novo Javascript com investimento em todas as paginas com esse código:Painel de Controle ☛ Modulos ☛ Html e Javascript ☛ Gestão dos codigos Javascript
- Código:
jQuery(document).ready(function() {
if(_userdata.user_level > 0) {
if(window.location.href.search('/t') >= 0) {
jQuery('a[href*="mode=editpost"]').click(function() {
var jUser = jQuery(this).parents('.post').find('.username, .author a').text();
var jLink = jQuery(this).parents('.post').find('.posthead a, .topic-title a').attr('href');
if(jUser != _userdata.username) {
sessionStorage.setItem("member_post_edited", jUser);
sessionStorage.setItem("link_to_post", jLink);
}
});
}
if(window.location.href.search('mode=editpost') >= 0) {
var x = sessionStorage.getItem('member_post_edited');
var y = sessionStorage.getItem('link_to_post');
if(x && y) {
jQuery('input[name="post"]').click(function(d) {
d.preventDefault();
jQuery.post('/post?p=' + jQuery('input[name="p"]').val() + '&mode=editpost', {
'message': jQuery('textarea').sceditor('instance').val(),
'post': '1',
'attach_sig': '1'
}).done(function(e) {
var href = jQuery(e).find('a[href^="/viewtopic"]').attr('href');
jQuery.post('/privmsg', {
'mode': 'post',
'post': '1',
'folder': 'inbox',
'username': x,
'subject': 'Your post has been edited by a staff member',
'message': '[b]Link to the edited post:[/b] ' + window.location.protocol + '//' + window.location.host + y + ''
}).done(function() {
alert("The member was successfully notified");
sessionStorage.removeItem('member_post_edited');
sessionStorage.removeItem('link_to_post');
location.href = href;
}).fail(function() {
alert("Ocorreu um erro ao mostrar a notificação.");
location.href = href;
});
}).fail(function() {
alert("Um erro ocorreu ao editar a mensagem. Tente novamente!");
});
});
}
}
}
});