Community Ticker Plugin
Plugin displays the last activities within the community, these activities can be new comments, new community member registration, new blog entry and user topic follow entry in frontend.
Features:
Community feed displays the last activities within:
- users registration,
- new blog entries,
- recommended comments,
- user topic follow entry.
Note: If you want to show posted comments in community ticker on fronted you need to first mark a given comment as "Recommended" in Admin Panel (Content -> Comments). It's some sort of reviewing a comment which user posted before making it public for others on fronted.
List of available events for templators:
-
comment-recommended -
recommended comment entryid
string - comment idsubject
string - comment subjectarticle
string - article namecommenter
string - commenter name
-
user-register - new user registration
user
Newscoop\Entity\User - registered user object
-
topic-follow - user follow topic new entry
- topic_name - topic name
- topic_id - topic id
user
Newscoop\Entity\User - registered user object
-
blog-published - new blog entry
number - article number
language - language id
Available list constraints:
- id - entry id
- event - event name (e.g. user.register)
- created - default order set to date created - ascending (e.g. order="created desc")
Extra parameter:
- length - determines max entries to display
Smarty block
1
2
3
|
{{ list_community_feeds }} {{ /list_community_feeds }} |
Example block to display 6 latest community entries (new user registration and new comments entries):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{{* This will generate list of latest activity of community members *}} {{ list_community_feeds length= "5" }} {{ if $gimme->current_list->at_beginning }} <div class = "community_ticker" class = "clearfix" > <h3>{{ #communityFeed# }}</h3> <ul> {{ / if }} {{ $created=$gimme->community_feed->created }} {{ $user=$gimme->community_feed->user }} {{ if $gimme->community_feed->type == 'user-register' && $user->uname }} <li class = "registered" >{{ include file= "_tpl/relative_date.tpl" date=$created }} <a{{ if $user->is_active }} href= "{{ $view->url(['username' => $user->uname], 'user') }}" {{ / if }}>{{ $user->first_name }} {{ $user->last_name }}</a> {{ #registered# }}</li> {{ elseif $gimme->community_feed->type == 'comment-recommended' && $gimme->community_feed->comment->article }} <li class = "commented" >{{ include file= "_tpl/relative_date.tpl" date=$created }} {{ #newCommentOn# }} <a href= "{{ $gimme->community_feed->comment->article->url }}" >{{ $gimme->community_feed->comment->article->title }}</a></li> {{ elseif $gimme->community_feed->type == 'topic-follow' && $gimme->community_feed->topic }} <li class = "commented" >{{ include file= "_tpl/relative_date.tpl" date=$created }} <a{{ if $user->is_active }} href= "{{ $view->url(['username' => $user->uname], 'user') }}" {{ / if }}>{{ $user->first_name }} {{ $user->last_name }}</a> followed <a href= "{{ $gimme->community_feed->topic->articlesLink }}" >{{ $gimme->community_feed->topic->name }}</a> topic</li> {{ / if }} {{ if $gimme->current_list->at_end }} </ul> </div> {{ / if }} {{ /list_community_feeds }} |
Migrating community events from core table to plugin table
In Newscoop there is already table called "community_ticker_event" which keeps all community events informations (new user register, comment recommend etc.). After installing plugin those events won't be visible for plugin. To make them visibe in plugin, migrate all existing data to plugin table using console command:
sudo php application/console ticker:migrate |
It will migrate all events to plugin table and will remove old table.
Screen: