XF 2.0 XF2 Demo Featured Threads/Portal

Vanjoe

Member
I understand the XF2 Demo Featured Threads/Portal is a demo, but I use it and it's great as is, but I would like to make two changes and I'm not sure where to start.

1. When viewing the portal, your current activity under "current visitors/members online" shows as "Viewing unknown page". Where as it should show "Viewing homepage" or "Viewing portal page".

2. The featured threads in the portal page have no maximum character or height limit. Meaning a really long post would be fully displayed. I'm trying to set a limit to have it display "... Continue Read" if the post reaches a certain height (images ..etc) or character limit.

PS: If it's not against the terms of use, someone should make the above changes and release it as a full addon. It looks great, it works great.
 
Thanks to @DL6 's post in Login to view full content of thread I managed to figure out how to fix #2.

In demo_portal_view: Find:
PHP:
{{ bb_code($post.message, 'post', $post.User, {

Replace with:
PHP:
<xf:set var="$snippetPost" value="{{ snippet($post.message, 300) }}" />
{{ bb_code($snippetPost, 'post', $post.User, {

The "300" is the character limit.

I'm still trying to figure out how to fix #1 in my first post. I'm not even sure what to look up or what the right term for the "Viewing unknown page" is. Any help or hints would be appreciated. But I must say both features should be added to the demo portal.
 
Implement the following method in your controller and add a phrase of your choosing:
PHP:
public static function getActivityDetails(array $activities)
{
    return \XF::phrase('demo_viewing_portal');
}
 
The above post ("getActivityDetails") should be included in the demo portal and the demo document itself. @Chris D

I'm not just saying that because I don't want to rebuild the portal whenever it gets updated, but I truly feel the activity detail is important and developers should be aware of it.
 
I'm not seeing this option.
After making sure you gave your usergroup permissions, either choose "Edit Thread" from the drop-down menu in upper-right or click the "Edit" button when viewing the form list (see thumbnails attached).

After that you'll see the option on the pop-up window.

188884
 

Attachments

  • 1543039423780.webp
    1543039423780.webp
    13.6 KB · Views: 4
  • 1543039517131.webp
    1543039517131.webp
    1.5 KB · Views: 5
After making sure you gave your usergroup permissions, either choose "Edit Thread" from the drop-down menu in upper-right or click the "Edit" button when viewing the form list (see thumbnails attached).

After that you'll see the option on the pop-up window.

View attachment 188884
Thanks for your help. I just realized I forgot to set permissions. It all works perfectly now!
 
You can't use "Batch update threads" or even "Select all" to feature threads. If anyone needs to feature a lot of threads in the same node you can use:

Code:
UPDATE `xf_thread`
SET `demo_portal_featured` = 1
WHERE `node_id` = 2;

INSERT INTO `xf_demo_portal_featured_thread` (thread_id, featured_date)
SELECT thread_id, post_date
FROM xf_thread WHERE `node_id` = 2;

Replace "`node_id` = 2" in both queries with the node your threads are in.
 
Last edited:
Hi,

i want try this addon and installed it on my xenforo 2.010 website. But i do not see any change.
Are there no admin-cp settings?
 
Back
Top Bottom