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

number of first post likes on thread list

Discussion in 'Styling and Customization Questions' started by jgas, Oct 22, 2011.

  1. jgas

    jgas Active Member

    Hi everybody.
    Is it possible to show on a "threadlist" page the number of first post likes of every thread?

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> thread_list_item

    Add the red code (scroll right):

    			<h3 class="title">
    				<xen:if is="{$thread.canInlineMod}"><input type="checkbox" name="threads[]" value="{$thread.thread_id}" class="InlineModCheck" id="inlineModCheck-thread-{$thread.thread_id}" data-target="#thread-{$thread.thread_id}" title="{xen:phrase select_thread}: '{$thread.title}'" /></xen:if>
    				<xen:if is="{$showSubscribeOptions}"><input type="checkbox" name="thread_ids[]" value="{$thread.thread_id}" /></xen:if>
    				<xen:if is="{$thread.prefix_id}">
    					<xen:if is="{$linkPrefix}">
    						<a href="{xen:link forums, $forum, 'prefix_id={$thread.prefix_id}'}" class="prefixLink"
    							title="{xen:phrase show_only_threads_prefixed_by_x, 'prefix={xen:helper threadPrefix, $thread, plain, ""}'}">{xen:helper threadPrefix, $thread, html, ''}</a>
    					<xen:else />
    						{xen:helper threadPrefix, $thread}
    				<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 wrap, $thread.title, 50}</a> ({$thread.first_post_likes} likes)
    				<xen:if is="{$thread.isNew}"><a href="{xen:link threads/unread, $thread}" class="unreadLink" title="{xen:phrase go_to_first_unread_message}"></a></xen:if>
    The result:

    Screen shot 2011-10-22 at 3.51.22 PM.png
    Xanin, StRonK, EQnoble and 4 others like this.
  3. jgas

    jgas Active Member

    That's great! Thanks Jake

Share This Page