Request to modify the Java code
2 posters
Page 1 of 1
Request to modify the Java code
The code makes the background of the topic title header like the color of the groups
this code work fit with the ModernBB
I want to modify it to be fit with the AwesomeBB version
this code work fit with the ModernBB
- Code:
/* -- 00. group_color -- */
$(function() {
for (var a = $('.post'), i = 0, j = a.length, color, rgb, title; i < j; i++) {
color = $('.postprofile dt .user-name span[style*="color"]', a[i])[0];
if (color) {
title = $('.post-head', a[i]);
color = color.style.color;
rgb = color.replace(/rgb\(|\)|\s/g, '').split(',');
rgb = Math.round(((parseInt(rgb[0]) * 299) + (parseInt(rgb[1]) * 587) + (parseInt(rgb[2]) * 114)) /1000) > 125 ? '#000' : '#FFF';
title.css({
color : rgb,
background : color
});
$('a', title[0]).attr('style', 'color:' + rgb + ' !important;');
}
}
});
I want to modify it to be fit with the AwesomeBB version
Last edited by DaRk Kn!GhT on April 17th 2024, 4:27 am; edited 1 time in total
Re: Request to modify the Java code
Halo
But first, you should ask for the permission to modify this code from its owner
Second, just simply replace that code by this
But first, you should ask for the permission to modify this code from its owner
Second, just simply replace that code by this
- Code:
/* -- 00. group_color -- */
$(function() {
for (var a = $('.post-wrap'), i = 0, j = a.length, color, rgb, title; i < j; i++) {
color = $('.post-author-name span[style*="color"]', a[i])[0];
if (color) {
title = $('.post-header', a[i]);
color = color.style.color;
rgb = color.replace(/rgb\(|\)|\s/g, '').split(',');
rgb = Math.round(((parseInt(rgb[0]) * 299) + (parseInt(rgb[1]) * 587) + (parseInt(rgb[2]) * 114)) /1000) > 125 ? '#000' : '#FFF';
title.css({
color : rgb,
background : color
});
$('a', title[0]).attr('style', 'color:' + rgb + ' !important;');
}
}
});
كونان2000 likes this post
Re: Request to modify the Java code
The code was included with a style that I purchased a long time ago
And i already tried your code before, I will try again
EDIT: @SarkZKalie It didn't work either
Is there another code for awesomebb version?
And i already tried your code before, I will try again
EDIT: @SarkZKalie It didn't work either
Is there another code for awesomebb version?
Re: Request to modify the Java code
Try search and replace in the code
- Code:
.post-wrap
- Code:
.post
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!
|
DaRk Kn!GhT likes this post
Re: Request to modify the Java code
sorry for thatSarkZKalie wrote:
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!
Please read our forum rules: ESF General Rules
It works now thank you
Similar topics
» How can I modify this chatbox CSS code for PunBB?
» How do I add java code inside the template?
» CSS request code
» Java script Select all code stopped working
» Can i modify the code of my forum?
» How do I add java code inside the template?
» CSS request code
» Java script Select all code stopped working
» Can i modify the code of my forum?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum