1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XenPorta 2 Recent Thread Widget Rich Usernames and READ/UNREAD color. 2015-08-21

Changes the Xenporta 2 Recent Thread Widget to handle Rich Usernames and UNREAD/READ Color

  1. tr1age
    Compatible XF Versions:
    • 1.2
    • 1.3
    • 1.4
    • 1.5
    Visible Branding:
    No
    So if you would like to have The Xenporta 2 Recent Thread Sidebar Block to have Read and Unread titles a different color, as well as rich usernames, here is the code you need.

    Find
    EWRwidget_Threads
    And find the following:
    Code:
    <xen:foreach loop="$wUncached" value="$thread">
                        <li class="profilePostListItem">
                      
                            <xen:avatar user="$thread" size="s" img="true" />
                          
                            <div class="messageInfo">
                                <div class="messageContent">
                                    <a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}"
                                        title="{xen:if '{$thread.isNew} AND {$thread.haveReadData}', {xen:phrase go_to_first_unread_message}}"
                                        class="{xen:if $thread.hasPreview, PreviewTooltip}"
                                        data-previewUrl="{xen:if $thread.hasPreview, {xen:link threads/preview, $thread}}">{xen:helper snippet, $thread.title, 50}</a>
                                </div>
                              
                                <div class="messageMeta muted">
                                    <a href="{xen:link members, $thread.lastPostInfo}">{$thread.lastPostInfo.username}</a> :
                                    <a href="{xen:link 'posts', $thread.lastPostInfo}" title="{xen:phrase go_to_last_message}" class="dateTime"><xen:datetime time="$thread.lastPostInfo.post_date" /></a>
                                </div>
                            </div>
                        </li>
                    </xen:foreach>
    Change to:
    Code:
    <xen:foreach loop="$wUncached" value="$thread">
                        <li class="profilePostListItem">
                      
                            <xen:avatar user="$thread" size="s" img="true" />
                          
                            <div class="messageInfo">
                                <div class="messageContent">
                                    <a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}"
                                        title="{xen:if '{$thread.isNew} AND {$thread.haveReadData}', {xen:phrase go_to_first_unread_message}}"
                                        class="{xen:if '{$thread.isNew} AND {$thread.haveReadData}', 'un'}readThreadTitle {xen:if $thread.hasPreview, PreviewTooltip}"
                                        data-previewUrl="{xen:if $thread.hasPreview, {xen:link threads/preview, $thread}}">{xen:helper snippet, $thread.title, 50}</a>
                                </div>
                              
                                <div class="messageMeta muted">
                                    <a href="{xen:link members, $thread.lastPostInfo}"><xen:username user="$thread.lastPostInfo" rich="true" /></a> :
                                    <a href="{xen:link 'posts', $thread.lastPostInfo}" title="{xen:phrase go_to_last_message}" class="dateTime"><xen:datetime time="$thread.lastPostInfo.post_date" /></a>
                                </div>
                            </div>
                        </li>
                    </xen:foreach>
    
    Then go into Extra.css:
    Code:
    .readThreadTitle {
          color:(whatever color you want);
    }
    
    .unreadThreadTitle {
           color:(whatever color you want);
    }
    exampleedit.PNG

    Enjoy!

    See working example at AltTabMe
    PyroM and otto like this.