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

XF 1.5 What I'm doing wrong editing /recent-activity/ ?

rafass

Well-known member
#1
This is the page: Recent Activity | XenForo Community
I need to put something here: (after the username)
Screen shot 2015-09-04 at 7.41.29 PM.png
I've already checked everything, and I'm 99% sure the only template I have to edit is
news_feed_item [right?]
Code:
<li id="{xen:if $itemId, $itemId, 'item_{$item.news_feed_id}'}" class="event primaryContent NewsFeedItem" data-author="{$item.username}">

    <xen:avatar user="$item" size="s" class="icon" />

    <div class="content">  
        {xen:raw $itemTemplate}
  
        <xen:datetime time="{$itemDate}" />
    </div>
</li>
Has been impossible show my element there. I mean, it show but in other locations. like:
Screen shot 2015-09-04 at 7.40.06 PM.png
But there are not any way to put my element next to the username.

I did the same in more than 20 templates already and everything has been perfect.
What I'm doing wrong with that page? some help is really appreciated.
 
Last edited:

Brogan

XenForo moderator
Staff member
#2
Look at the individual news_feed_item_* templates to see how the content is constructed.

In the case above, it would be news_feed_item_resource_update_like.
 

rafass

Well-known member
#3
Hello Brogan.
Look at the individual news_feed_item_* templates to see how the content is constructed.
Before open this thread, A friend told me the same, and I've been checking the content of all my news_feed_item_*
and the final conclusion is that the only template appropriated to to this is news_feed_item
This my list of news_feed_item_* :
Screen shot 2015-09-04 at 7.36.16 PM.png
In the case above, it would be news_feed_item_resource_update_like.
I've changed the screenshots to show my own case. (I have not installed the resource manager yet. so I have only 14 templates. (all of them checked carefully) nothing to do there. (apparently)
The only template to have sense to edit is (according what I need) is news_feed_item
The result is always the same:
Screen shot 2015-09-04 at 7.54.13 PM.png Screen shot 2015-09-04 at 7.53.52 PM.png
 

Brogan

XenForo moderator
Staff member
#4
It's not possible to add an icon after the user name by editing the news_feed_item template.

The user name is added via one of the specific templates.
 

rafass

Well-known member
#5
Excellent! That worked! you're absolutely right. (y) I was very wrong, finally I found it: news_feed_item_post_insert
Code:
<h3 class="description">

    <xen:if is="{$content.attach_count}">
   
        <xen:comment><!-- $user attached a file to a post --></xen:comment>
        {xen:phrase news_feed_post_insert_attachment,
            'username={xen:helper username, $user, 'primaryText'}
           
                    <here>
           
            ',
            'threadTitle=<a href="{xen:link posts, $content}"{xen:if '{$content.hasPreview}', ' class="PreviewTooltip" data-previewUrl="{xen:link threads/preview, $content}"'}>{xen:helper threadPrefix, $content}{$content.title}</a>'}
   
    <xen:else />
   
        <xen:comment><!-- $user posted a post --></xen:comment>
        {xen:phrase news_feed_post_insert,
            'username={xen:helper username, $user, 'primaryText'}
           
                    <here>
           
            ',
            'threadTitle=<a href="{xen:link posts, $content}"{xen:if '{$content.hasPreview}', ' class="PreviewTooltip" data-previewUrl="{xen:link threads/preview, $content}"'}>{xen:helper threadPrefix, $content}{$content.title}</a>'}

    </xen:if>
   
</h3>

<p class="snippet post">{xen:helper snippet, $content.message, $xenOptions.newsFeedMessageSnippetLength, {xen:array 'stripQuote=1'}}</p>

<xen:include template="news_feed_attached_images" />
Thanks so much for the great support as always! ;)
 

rafass

Well-known member
#7
Got it (y) Thank you katsulynx!
--
Now I'm facing problems with my conditional in the code:
Screen shot 2015-09-04 at 8.55.44 PM.png
Is showing the badge in the wrong users. o_O
 
Last edited:

Snog

Well-known member
#10
You'll never get a proper response in the alert or recent activity templates using the conditional you showed in another thread without some PHP coding.

$user does not contain the user groups for the user in the alerts.

Code:
array(5) {
   ["user_id"] => int(11)
   ["username"] => string(5) "MTest"
   ["gender"] => string(4) "male"
   ["gravatar"] => string(0) ""
   ["avatar_date"] => int(1405082762)
}
 
Last edited:

rafass

Well-known member
#11
Thank you Snog! that's true. (unfortunately)
Is not possible make this the modification in certain templates in the normal way. (alerts & feed)(doesn't recognize my conditional)(on my particular case)
That would require a custom development with PHP files.
--
Question:
This is "As designed"? (all the info for a user isn't available to all templates)
Or is something that could be improved in the future if is suggested?
 
Last edited: