Add-on XenForo News Feed (adding recent activity to a different place)

Cryptaline

Active member
o/ Everyone :coffee:

A brief description:

On each page refresh for a page_container Recent activity is hidden. It doesnt matter how you play with your templates inside of the container, e.g:

<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<div class="newsFeed">

<xen:include template=" news_feed " />

<xen:include template="news_feed_end">
<xen:set var="$itemLoaderUrl">{xen:link recent-activity}</xen:set>
</xen:include>

<xen:include template="preview_tooltip" />
</div>
it will be hiden until

You need to create a listener for the container_public_params event to add the news items as one of the params. That will allow you to display the news_feed in the container.

So thats what i need, a simple listener for the container_public_params to show a recent activity always. (auto load on each page refresh)

e.g:

social-top.webp

If you think it worth some money, i will pay without any doubt. :giggle:
 
So thats what i need, a simple listener for the container_public_params to show a recent activity always. (auto load on each page refresh)
This wouldn't be enough;) You'll also need to prepare the data in the view

Mom, i'll see if i can find my old addon for this
 
Hm, hadn't found it, but i love challenges:D

Would it also work, if i add it to the footer template (for using in the footer hook) or do you have another template hook where you want to insert it?
edit: ok i was able to make what you requested^^
 
try this


BUT
be aware that it adds at least 1 global query to the front pages! (this addon is just passing the data, so you'll also need probably to take care of precaching the needed templates

also as mentioned, this doesn't show anything!
you'll need to include the output yourself (they're stored in the newsFeed template parameter, which means that it works will work with the standard xf newsfeed template)
 

Attachments

I will describe how it works:

1. Dowload addon.
2. Install it.

Now you want to show some recent activity in your specific place?
Not a problem, open page_container template and add your own news feed: Admin CP -> Styles -> Templates -> PAGE_CONTAINER.

E.G:

I want to show news feed @ the right side of my forum. Define the correct place and insert news_feed template there by adding:

<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<div class="newsFeed">

<xen:include template="news_feed" />

<xen:include template="preview_tooltip" />
</div>

You may check all available templates for a news feed by finding and opening news_feed template.

P.S:

If you want to minify the code in a PAGE_CONTAINER, you can always create you own template, e.g:


own_template

and copypast all templates you want to use from a news_feed template, e.g:

<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<div class="newsFeed">

<xen:include template="news_feed" />

<xen:include template="preview_tooltip" />
</div>

then come back to your PAGE_CONTAINER template, define the correct place and insert own_template template there by adding:

<xen:include template=" own_template " />

Thats it, and the result is:


social-top.webp
 
:cautious:

Have found a massive bug. While addon is enabled you keep geting this error
Fatal error: Cannot redeclare class XFCP_Ragtek_GNF_Extend_ViewPublic_Base in /mycustomaddress/mycustomaddress/mycustomaddress / mycustomaddress / mycustomaddress /domains/mycustomaddress.com/html/community/library/XenForo/Application.php(396) : eval()'d code on line 1
when trying to access your account details such as:

Personal Details
Signatures
Contact Details
Privacy

and all other tabs.

Any ideas how to fix?
 
Once this is working properly I might see if I can use media queries to add this as an additional sidebar to the site, but have it only appear for those with larger resolution monitors who have the extra screen real estate.
 
Thanks guys for the add-on brillent idea with great implementation. Thats what I love about this community and xenforo is really enhanceable (y)
 
Thanks for responding, Adam. Was the fixed version released? Looks like a useful addition.

Very much a front-end guy and easily confused once I'm too many layers deep in Zend/PHP.
 
Nope, fix has not been released. Since n1 donated 2 Ragtek except me, he sent the fixed version 2 me only i guess.
 
Hmm, yes this one is standalone too.
I ve modified 1.0.1_b_3 myself to suit my needs, but you can try to use 1.0.1_b_3, have not seen any bugs in this version.
 
The original zip appears to be corrupted. Did you happen to have a working copy of it?

Thanks :)
 
Top Bottom