The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Request to modify the Java code

2 posters

Go down

Solved Request to modify the Java code

Post by DaRk Kn!GhT April 15th 2024, 8:33 pm

The code makes the background of the topic title header like the color of the groups
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
DaRk Kn!GhT
DaRk Kn!GhT
New Member

Male Posts : 7
Reputation : 1
Language : arabic

https://mercadivo.0wn0.com/

Back to top Go down

Solved Re: Request to modify the Java code

Post by DaRk Kn!GhT April 16th 2024, 11:23 pm

Up
DaRk Kn!GhT
DaRk Kn!GhT
New Member

Male Posts : 7
Reputation : 1
Language : arabic

https://mercadivo.0wn0.com/

Back to top Go down

Solved Re: Request to modify the Java code

Post by SarkZKalie April 17th 2024, 2:28 am

Halo

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;');
    }
  }
});
Apply this change to the default AwesomeBB version


Request to modify the Java code Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1435
Reputation : 220
Language : English

https://rotavn.forumotion.com/

كونان2000 likes this post

Back to top Go down

Solved Re: Request to modify the Java code

Post by DaRk Kn!GhT April 17th 2024, 3:21 am

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?
DaRk Kn!GhT
DaRk Kn!GhT
New Member

Male Posts : 7
Reputation : 1
Language : arabic

https://mercadivo.0wn0.com/

Back to top Go down

Solved Re: Request to modify the Java code

Post by SarkZKalie April 17th 2024, 4:10 am

Try search and replace in the code
Code:
.post-wrap
by
Code:
.post
Put it "in the topics" instead of "in the all page"

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


Request to modify the Java code Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1435
Reputation : 220
Language : English

https://rotavn.forumotion.com/

DaRk Kn!GhT likes this post

Back to top Go down

Solved Re: Request to modify the Java code

Post by DaRk Kn!GhT April 17th 2024, 4:27 am

SarkZKalie 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
sorry for that

It works now thank you Yes
DaRk Kn!GhT
DaRk Kn!GhT
New Member

Male Posts : 7
Reputation : 1
Language : arabic

https://mercadivo.0wn0.com/

Back to top Go down

Solved Re: Request to modify the Java code

Post by SarkZKalie April 17th 2024, 4:54 am

Glad i could help

Problem solved & topic archived.
Please read our forum rules:  ESF General Rules


Request to modify the Java code Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1435
Reputation : 220
Language : English

https://rotavn.forumotion.com/

Ape likes this post

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum