Show group colour with usergroup in viewtopic

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
wen33
Registered User
Posts: 4
Joined: Wed Aug 19, 2015 1:29 am

Show group colour with usergroup in viewtopic

Post by wen33 »

I have a phpBB forum in version 3.0.12.

I have two MODs. The first allows users to add color to your username, regardless of their default group. The second displays the default group in viewtopic

The mod "Show groups in viewtopics" does not display the color of the default group, but the author's color.

Example:
User is the Registered Users group. This group does not have a color.
With the MOD he applies a color to your user name and the default group topic display is shown in the author's name color.

What I want:
adapt this MOD to display the COLOR user group and not the author's color (POST_AUTHOR_COLOUR). Can someone help me?

Full MOD's here, what should I add to display the group's color?

Open: viewtopic.php
Find

Tip: This may be a partial find and not the whole line.

Code: Select all

'from'			=> '',
Add after

Code: Select all

'group_id'         => '',
Find

Code: Select all

'from'			=> (!empty($row['user_from'])) ? $row['user_from'] : '',
Add After

Code: Select all

'group_id'         => $row['group_id'],
Find

Code: Select all

// Output the posts
Add Before

Code: Select all

// Groups in viewtopic
$sql = 'SELECT group_id, group_name, group_type
   FROM ' . GROUPS_TABLE . '
   WHERE group_type <> ' . GROUP_HIDDEN;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
   $groups_name[$row['group_id']] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
}
$db->sql_freeresult($result);
Find

Code: Select all

		'POSTER_AGE'		=> $user_cache[$poster_id]['age'],
Add After

Code: Select all

        	'POSTER_GROUP'      => $groups_name[$user_cache[$poster_id]['group_id']],
Open: styles/prosilver/template/viewtopic_body.html
Find

Tip: This may be a partial find and not the whole line.

Code: Select all

          <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}:</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->
Add Before

<!-- IF postrow.POSTER_GROUP --><dd><strong>{L_GROUP}:</strong> <span style="color: {postrow.POST_AUTHOR_COLOUR}; font-weight: bold;">{postrow.POSTER_GROUP}</span></dd><!-- ENDIF -->
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51681
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Show group colour with usergroup in viewtopic

Post by stevemaury »

To receive MOD support please visit our Modifications Database and post in the specific MOD’s designated support area. The link to the support area for each released MOD is also available in the first post of each released MOD listed in the MOD Database Releases forum.

No support is available here for MODs not obtained from this site or for MODs marked as abandoned.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
Locked

Return to “[3.0.x] Support Forum”