After the announcement of the new Like and Dislike system nearly a week ago, I've seen some users wishing they could unallow users to like or dislike their own posts. This quite short JS code should do the job.
06/03 edit: Now removes only the like/dislike buttons and still shows the likes list.
Adding the JS:
Admin Panel » Modules » HTML & JAVASCRIPT: Javascript codes management; then, click on the CREATE A NEW JAVASCRIPT button.Title * : As you wish.
Placement : In the topics
Javascript Code:
- PHPBB2:
- Code:
$(function() {
$('tr.post').each(function() {
var postauthor = $(this).find('td').first().find('.name').children().last().text();
var myname = _userdata.username;
if (postauthor === myname) { $(this).find('.fa_like_div button').remove(); }
}); });
- PHPBB3:
- Code:
$(function() {
$('div.post').each(function() {
var postauthor = $(this).find('.postprofile dl dt').children().last().text();
var myname = _userdata.username;
if (postauthor === myname) { $(this).find('.fa_like_div button').remove(); }
}); });
- PUNBB:
- Code:
$(function() {
$('div.post').each(function() {
var postauthor = $(this).find('.user-ident h4.username').children().last().text();
var myname = _userdata.username;
if (postauthor === myname) { $(this).find('.fa_like_div button').remove(); }
}); });
- INVISION:
- Code:
$(function() {
$('div.post').each(function() {
var postauthor = $(this).find('.postprofile .popmenubutton').children().last().text();
var myname = _userdata.username;
if (postauthor === myname) { $(this).find('.fa_like_div button').remove(); }
}); });
- MODERNBB:
- Code:
$(function() {
$('div.post').each(function() {
var postauthor = $(this).find('.postprofile .postprofile-name').children().last().text();
var myname = _userdata.username;
if (postauthor === myname) { $(this).find('.fa_like_div button').remove(); }
}); });
- AWESOMEBB:
- Code:
$(function() {
$('div.post-wrap').each(function() {
var postauthor = $(this).find('.post-aside .post-author-name').children().last().text();
var myname = _userdata.username;
if (postauthor === myname) { $(this).find('.fa_like_div button').remove(); }
}); });
Last edited by mSyx on March 6th 2021, 1:18 pm; edited 3 times in total