Coucou,
another quick resource that may be useful for someone
From regular non-clickable quoted author
to clickable author name
Hope you will enjoy
another quick resource that may be useful for someone
Introduction and Demo
The resource allows you to make the quoted author username clickable inside quotes. When you cite a previous post, the name of the author will become clickable!From regular non-clickable quoted author
to clickable author name
Disclaimer
In the past, Pinguino (French Administrator) pointed out that the option was not included in the Forumotion update because of technical reasons. Please note that if you have too many quotes in the page, the loading may be slow - but otherwise don't worry about using this script!Pinguino wrote:Hello,
From memory, this integration caused a technical problem which motivated its withdrawal. The tech team just told me that this makes the pages load considerably longer.
Installation: Javascript
You need to go towards Administration Control Panel (ACP) Modules HTML & Javascript Javascript codes management and create a new code - upon verifying that Javascript codes management is enabled.- Title: free choice - does not influence the code effect
- Where: All pages
- Code:
- Code:
$(function() {
/*
Title: Make quoted author name clickable in quotes
Author: Niko
Version: 1.0
Release Date: 03.06.2023 (dd.mm.year)
Contact: https://www.fmcodes.net/u2
Original content: https://www.fmcodes.net/t2037-
*/
const FORUM_VERSION = _userdata["tpl_used"];
var breadcrumb_quoteAuthor = {
'subsilver': 'dl.codebox dt span.genmed b', //phpbb2
'prosilver': 'blockquote div cite', //phpbb3
'punbb': 'blockquote div cite', //punBB
'invision': 'blockquote div cite', //invision
'modernbb': 'blockquote div cite', //modernBB
'awesomebb': 'blockquote cite' //awesomeBB
};
var wrote_keyword = $(breadcrumb_quoteAuthor[FORUM_VERSION]).text().split(' ').pop().split(':')[0];
$(breadcrumb_quoteAuthor[FORUM_VERSION]).each(function(){
var username = $(this).text().split(' '+wrote_keyword+':')[0];
var textNode = $(this);
$.ajax({
url: '/memberlist?username='+username,
type: 'GET',
success: function(data){
if(FORUM_VERSION == 'invision') {
var href = $(data).find(".membername span strong:contains('"+username+"')").parents('.member-header.clearfix').find('.popupmenu.clearfix ul li a[href*="/u"]').attr('href');
console.log(href);
} else {
var href = $(data).find("a span strong:contains('"+username+"'), a span:contains('"+username+"')").parents('a').attr('href');
}
var user_id = href.split('/u').pop()[0];
textNode.html(textNode.html().replace(username,'<a href="/u'+user_id+'" class="quote_mention_username">'+username+'</a>'));
}
});
});
})
CSS
There is no required CSS to be included, but the clickable quoted username can be customized with this class
|
Hope you will enjoy