Different background color for different usergroup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Goldoff
    New Member
    • Oct 2005
    • 18
    • 3.5.x

    Different background color for different usergroup

    I'm trying to figure out how to give a special background color for a specific usergroup.

    I mean, when a forum leader (e.g. a moderator) starts a new thread, I'd like that thread somehow highligted in the threadlist.

    Is it possible?

    TIA
  • Lats
    Senior Member
    • Mar 2002
    • 3671

    #2
    That's a great idea!!

    Sadly, the usergroupid isn't available in the threadbit template (as far as I'm aware), but the username is. I added the blue bits to threadbit...
    Code:
    <tr>
     <td class="alt1" id="td_threadstatusicon_$thread[realthreadid]">
      $thread[openclose_editable]
      <img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" id="thread_statusicon_$thread[realthreadid]" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" />
     </td>
     <if condition="$show['threadicons']">
      <td class="alt2"><if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else />&nbsp;</if></td>
     </if>
    [COLOR=blue]<!-- Lats -->[/COLOR]
    [COLOR=blue]<if condition="in_array($thread[postusername],array('betty_jo','bobbie-jo','billie_jo'[/COLOR][COLOR=blue]))"><td style="background:#faf8cc;"[/COLOR]
    [COLOR=blue]<else />[/COLOR]
     <td class="alt1" [COLOR=blue]</if>[/COLOR]
    Change/add names to suit.
    Lats...

    Comment

    • Goldoff
      New Member
      • Oct 2005
      • 18
      • 3.5.x

      #3
      Wow, it worked at once!

      Thank you so much Lats!


      BTW, do you think this effect could be restricted to specific fora?

      Comment

      • Lats
        Senior Member
        • Mar 2002
        • 3671

        #4
        Yes, added the red bits...
        Code:
        <tr>
         <td class="alt1" id="td_threadstatusicon_$thread[realthreadid]">
          $thread[openclose_editable]
          <img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" id="thread_statusicon_$thread[realthreadid]" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" />
         </td>
         <if condition="$show['threadicons']">
          <td class="alt2"><if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else />&nbsp;</if></td>
         </if>
        [COLOR=blue]<!-- Lats -->[/COLOR]
        [COLOR=blue]<if condition="in_array($thread[postusername],array('betty_jo','bobbie-jo','billie_jo'[/COLOR][COLOR=blue])) [COLOR=red]AND in_array($GLOBALS[forumid],array(2,8,14))[/COLOR]"><td style="background:#faf8cc;"[/COLOR]
        [COLOR=blue]<else />[/COLOR]
         <td class="alt1" [COLOR=blue]</if>[/COLOR]
        Lats...

        Comment

        • Goldoff
          New Member
          • Oct 2005
          • 18
          • 3.5.x

          #5
          Originally posted by Lats
          Yes, added the red bits...
          Per-fect!!

          Really appreciate your help
          Thanks again

          Comment

          • Tweaky
            Member
            • Jan 2004
            • 90
            • 3.6.x

            #6
            Originally posted by Lats
            Sadly, the usergroupid isn't available in the threadbit template (as far as I'm aware)
            is_member_of($post, X) where X is the groupID is the template command. Hopefully it's available in that template.

            Comment

            • Lats
              Senior Member
              • Mar 2002
              • 3671

              #7
              No, it isn't
              Lats...

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...