| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 12769|Reply: 5
Collapse the left

Username Color for X2.5

[Copy link]

 Palestine

Post time: 2013-08-23 20:36
| Show all posts |Read mode
Addon
Title: Username Color
Version: -
Author: -
Author URL: -
Description: How to color username
Discuz! X Version: X2.5 
Language(s): -
Create Date:
Last Update:
Screenshot: -
Demo




First of all you should decide what the color every group will use:

How to set a group color

Then we have to hack existing template!

First :-
1- Open viewthread_node.htm file
if you use default style it founded in template\default\forum
other  template\yourstyle\forum

find
  1. <strong><a href="home.php?mod=space&uid=$post[authorid]" target="_blank" class="xi2">$post[author]</a></strong>
Copy the Code
replace with
  1. <strong><a href="home.php?mod=space&uid=$post[authorid]" target="_blank" class="xi2"{if $post[groupcolor]} style="color: $post[groupcolor]"{/if}>$post[author]</a></strong>
Copy the Code
2- in same file

search
  1. <div class="authi"><a href="home.php?mod=space&uid=$post['authorid']" target="_blank" class="xw1">$post[author]</a>$authorverifys</div>
  2.                                 </div>
Copy the Code
replace with
  1. <div class="authi"><a href="home.php?mod=space&uid=$post['authorid']" target="_blank" class="xw1"{if $post[groupcolor]} style="color: $post[groupcolor]"{/if}>$post[author]</a>$authorverifys</div>
  2.                                         </div>
Copy the Code
3- open forumdisplay_list.htm file in same dic

find
  1. <!--{if $thread['authorid'] && $thread['author']}-->
  2.                                                                                         <a href="home.php?mod=space&uid=$thread[authorid]" c="1">$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
Copy the Code
replace with
  1.           <!--{if $thread['authorid'] && $thread['author']}-->
  2.                                                                                         <a href="home.php?mod=space&uid=$thread[authorid]" c="1"{if $groupcolor[$thread[authorid]]} style="color: $groupcolor[$thread[authorid]];"{/if}>$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
Copy the Code
Done


after this usergroup color will apply on username


P.S.
this functionality was got from x3 but was shorten.
if you want to have a full functionality, just update to x3 (it have this built-in already)


[Edited by vot]

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

Related collections:

  • · Tricks|Threads: 23, Subscribe: 3
Post time: 2013-08-24 02:28
| Show all posts
Wrong section. Is this template or... hack? I think, that's second.

 Palestine

 Author| Post time: 2013-08-24 12:59 From the mobile phone
| Show all posts
kaaleth 2013-8-24 01:28
Wrong section. Is this template or... hack?  I think, that's second.

As you like .

 Russia

Post time: 2013-08-28 11:21
| Show all posts
The hack applied into x2.5.
#160

Rate

Number of participants 1Rating +1 Collapse Reason
mj1919 + 1 :D

View Rating Log

Post time: 2014-08-20 21:53
| Show all posts
can it works on discuz 3.0
that can solve this problem



while replying color is not done
http://codersclub.org/discuzx/fo ... &extra=page%3D1
Post time: 2014-08-26 22:27
| Show all posts
vot 2013-8-28 13:21
The hack applied into x2.5.
#160

pls applied in 3.1 and 3.2 also and pls fix this issue vot sir
http://codersclub.org/discuzx/fo ... &extra=page%3D1
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-21 18:06 GMT+3 , Processed in 0.066351 sec., 17 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list