1. Changing the appearance of comments by group

Changing the appearance of comments by group

  |   3
Changing the appearance of comments by group


Modification: Changing the appearance of comments by the group color.
DataLife Engine version: 10.0, 10.1


1) First open engine/modules/show.full.php and find:

$tpl->set( '{group}', $user_group[$member_id['user_group']]['group_name'] );


At the bottom add:

$tpl->set( '{group-id}', $user_group[$row['user_group']]['id']);



2) Open now engine/classes/comment.class.php and find:


$tpl->set( '{group-name}', $user_group[$row['user_group']]['group_prefix'].$user_group[$row['user_group']]['group_name'].$user_group[$row['user_group']]['group_suffix'] );


At the bottom add:

 $tpl->set( '{group-id}', $user_group[$row['user_group']]['id']);


3) Open the CSS file of your template, for example, "style.css"

Add to the end:

.commentContent_1 {background: #fdf5e6;}
.commentContent_2 {background: #fff;}
.commentContent_3 {background: #fff;}
.commentContent_4 {background: #fff;}
.commentContent_5 {background: #fff;}
.commentContent_6 {background: #fff;}


Change the "#fff" by the color you want for your group.

By default:

.commentContent_1 = Administrators
.commentContent_2 = Moderators

etc ...


4) Now open comments.tpl of your template and find the class of your comment box by this :

class="commentContent_{group-id}"


For exemple, in my screen is use the default template, so i open the comments.tpl and found the class of the box who is :

<div class="dcont">


and i so replace it by:

<div class="commentContent_{group-id}">



You're done. Enjoy it.
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+5

Comments 3

yorismith
yorismith
Moderators
Commented By yorismith on February 10, 2014 (7:29 pm)
Thank you, this is easier than the hack by dlestarter team applause because dlestarter team using group name instead of ID and more difficult on CSS than this group ID...
Thank you for sharing the new trick! 10x
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
grillo200
grillo200
Members
Commented By grillo200 on February 15, 2014 (5:40 am)
Hello, you don't need to modify the script to do this in the latest version of DLE.
Use tags inside comments.tpl:
[commentsgroup=1]class="test1"[/commentsgroup] and [not-commentsgroup=1]class="test1"[/not-commentsgroup]
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0

DLE user since v5.5, now using custom made v10.1
yorismith
yorismith
Moderators
Commented By yorismith on February 15, 2014 (11:09 pm)
grillo200
The tags only available in 10.1 but not available in 10.0
[commentsgroup=x]xxx[/commentsgroup] 
[not-commentsgroup=x]xxx[/not-commentsgroup]

The hack will also work with 9.x and 8.x, tags commentsgroup and not-commentsgroup are new features in 10.1 only.
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.