The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Change colour of topic(thread) titles of a specific user using javascript

View previous topic View next topic Go down

Solved Change colour of topic(thread) titles of a specific user using javascript

Post by TamDonCo on July 19th 2016, 8:52 pm

Please help me to change topic(thread) titles of a specific user using javascript

Thanks Ace 1


Last edited by TamDonCo on July 20th 2016, 1:04 am; edited 2 times in total

TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by Ace 1 on July 19th 2016, 9:16 pm

@TamDonco

Placement: In the subforums
Code:
$(function() {
    var $user = $('.span-tab').find('a[href="/u1"] span strong'),
        $user_topic_title = $user.parents(".span-tab").prev().prev().find("a.topictitle");
    $user_topic_title.css("color", "red");
});

In Line 2,
Code:
u1
is the user's id.
In Line 5,
Code:
red
is the color of the topic title.

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by TamDonCo on July 19th 2016, 10:11 pm

hi Ace 1

it does not work

TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by Ace 1 on July 19th 2016, 10:26 pm

Link me to your forum.

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by TamDonCo on July 19th 2016, 10:36 pm

@Ace 1 wrote:Link me to your forum.


http://nhomcho.forummotion.com/


under Recipes, "Testing" topic by chuot

TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by Ace 1 on July 19th 2016, 10:52 pm

Okay. I figured out something @TamDonco. I don't think you're running on phpbb3 like your profile here says mwii

Replace the code above with this one:

Code:
$(function() {
    var $user = $('.span-tab').find('strong a[href="/u1"]'),
  $user_topic_title = $user.parents(".span-tab").prev().prev().find("a.topictitle");
    $user_topic_title.css("color","red");
});

And this should work thumright

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by TamDonCo on July 20th 2016, 12:50 am

Thanks Ace 1

It works

what version do I use ? I saw in setting it says phpbb3

TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by Ace 1 on July 20th 2016, 1:02 am

I don't know but I thought if we both had phpbb3 then the codes would be the same,

It must be the themes that have different HTML element placements.

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by TamDonCo on July 20th 2016, 1:04 am

Thanks again

TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by Ace 1 on July 20th 2016, 1:09 am

No problem

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Change colour of topic(thread) titles of a specific user using javascript

Post by SLGray on July 20th 2016, 3:54 am

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


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36636
Reputation : 2440
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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