Add topic subject icon on forum list
+3
كونان2000
Obscure
Niko
7 posters
Page 1 of 1
Add topic subject icon on forum list
Coucou,
another quick resource to display the topic icon from last topic within a forum. Topic icons must be used and must be selected to be displayed!
Sadly the resource is available for all version - but PhpBB2.
another quick resource to display the topic icon from last topic within a forum. Topic icons must be used and must be selected to be displayed!
Sadly the resource is available for all version - but PhpBB2.
Javascript & jQuery
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: Add topic icon on forum list
Author: Niko
Version: 1.1
Release Date: 04.01.2023 (dd.mm.year)
Contact: https://www.fmcodes.net/u2
Original content: https://www.fmcodes.net/t2016-
*/
const FORUM_VERSION = _userdata["tpl_used"];
var versions = {
'prosilver': 'h2.topic-title', //phpbb3
'punbb': '.pun .posthead h2', //punBB
'invision':'.postbody-head h3', //invision
'modernbb': 'h2.topic-title', //modernBB
'awesomebb': '.post-header h2' //awesomeBB
};
var selector = versions[FORUM_VERSION];
$("dd.lastpost a.lastpost-link[href^='/t'], td.tcr span a[href^='/t']:first-child, table.ipbtable.index-box td.row1 a[href^='/t']:first-child, span.lastpost-infos a[href^='/t']:first-child, .forum-lastpost a.topic-title[href^='/t']").each(function() {
var element = $(this);
var href = $(this).attr('href');
$.ajax({
url:href,
type:'GET',
success: function(data){
var icon = $(data).find(selector).html();
$(element).html(icon);
}
});
});
});
Last edited by Niko on February 4th 2023, 11:22 am; edited 1 time in total
skouliki, SLGray, YoshiGM, TonnyKamper, tikky, Razor12345 and كونان2000 like this post
Re: Add topic subject icon on forum list
@كونان2000 I need more information, like the forum link, the forum version, etc...
A live demo would help for sure
edit. added a new version, give a try!
A live demo would help for sure
edit. added a new version, give a try!
كونان2000 likes this post
Re: Add topic subject icon on forum list
I may be dumb, but what does this script does? I can't conclude by description and image given in this tutorial.
Guest- Guest
Re: Add topic subject icon on forum list
display the topic icon from last topic within a forum
the image is very clear
the image is very clear
BlackScorpion and Niko like this post
Re: Add topic subject icon on forum list
This is similar to Prefixes but usin the topic icons.. Hmm, not bad ^^
Niko likes this post
Re: Add topic subject icon on forum list
Now it works perfectlyNiko wrote:
edit. added a new version, give a try!
Niko likes this post
Re: Add topic subject icon on forum list
Nice job, thanks for sharing. I'm gonna try it in my forum soon.
Graphic Design Section Rules || Becoming a Designer || Graphic Requests
Graphics Request Form
Make sure to check out our FREE Graphic's Gallery
No support provided via PM!
Niko likes this post
Re: Add topic subject icon on forum list
Hello,
Idk if something is wrong with the script, but if an icon is not setted its added a little space: https://prnt.sc/oNkuoI6SzrRp is it alright, or what?
Idk if something is wrong with the script, but if an icon is not setted its added a little space: https://prnt.sc/oNkuoI6SzrRp is it alright, or what?
Niko likes this post
Re: Add topic subject icon on forum list
Mihai wrote:Hello,
Idk if something is wrong with the script, but if an icon is not setted its added a little space: https://prnt.sc/oNkuoI6SzrRp is it alright, or what?
In that case you get tan empty image instead. You can simply remove it with this CSS for example (on PhpBB3)
- Code:
a.lastpost-link img[src="https://2img.net/i/empty.gif"] {
display: none;
}
Re: Add topic subject icon on forum list
Thanks for the code... but there is already icons added from administration panel, idk why you would this code to be added for all pages - showing in the mainpage itself... (maybe someone who is lazy enough, will need this script anyway xD)Niko wrote:In that case you get tan empty image instead. You can simply remove it with this CSS for example (on PhpBB3)
- Code:
a.lastpost-link img[src="https://2img.net/i/empty.gif"] {
display: none;
}
Re: Add topic subject icon on forum list
@Mihai if you prefer you can add it on home and sub-forums only, it should work anyway
Re: Add topic subject icon on forum list
Yes i know Niko, but instead of viewing the icons from the home, you can click on each subforum and view it... https://prnt.sc/AVIOSZ5vEaN4... and you did not mention in your tutorial if there is no icon setted, there will be a topic title with a blank space...
Re: Add topic subject icon on forum list
@Mihai you are not obliged to use this script.
If you don't want the icon on the home page, you can not use this script; if you want the icon even there, then this quick resource does it for you. I don't see the problem.
If you don't want the icon on the home page, you can not use this script; if you want the icon even there, then this quick resource does it for you. I don't see the problem.
Similar topics
» In a 'Topics' list, the name of the topic and the name of the Original poster is partly concealed by an icon of a page.
» Threads are visible only for registered users (not visible for guest)
» Remove Topic List Box in Sub Forum
» topic list of specific forum
» A topic icon for my forum saying 'Approved'?
» Threads are visible only for registered users (not visible for guest)
» Remove Topic List Box in Sub Forum
» topic list of specific forum
» A topic icon for my forum saying 'Approved'?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum