Notifications
Clear all

[Closed] Add snippet of first post into forum list

17 Posts
3 Users
5 Likes
2,318 Views
Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

I'm looking at adding a snippet of the last post in the threaded layout view (main page), rather like the recent.php file. Is there a simple way to add this ?

Thanks

16 Replies
Robert
Posts: 10499
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi anonymous3542,

As far as I understand you want to change the Recent Posts page layout with the threaded layout topic list. Am I correct?

4 Replies
(@anonymous3542)
Joined: 7 years ago

Honorable Member
Posts: 393

@robert no - what I'm looking for is the list of current topics per forum on the main page (Threaded layout), which currently has the topic title. I'd like to include some of the text from the post itself [body].

Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10499

I'm sorry but i don't follow you. It's already exist on home page under threaded layout forums. There are lists of recent topics under each category.

(@anonymous3542)
Joined: 7 years ago

Honorable Member
Posts: 393

@robert see my next posts.

(@anonymous3542)
Joined: 7 years ago

Honorable Member
Posts: 393

Recent topics, yes, but only the title ? I need the body

Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

Taking this from recent.php, so something similar that can be used on the main page in threaded view under the topic title

$last_post = wpforo_post($topic['last_post']);

Does this help ?

Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

Pretty close I think as there is an array here, but I need to know which branch contains the detail I need

<?php $last_post = wpforo_post($topic['last_post']); echo $last_post; ?>

Exploding the array

<?php $last_post = wpforo_post($topic['last_post']); print_r($last_post); ?>

Would indicate that

$topic['body'] 

contains that I want, but it doesn't seem to work ? The array itself returns

Array ( [postid] => 2079 [parentid] => 1990 [forumid] => 18 [topicid] => 135 [userid] => 1091 [title] => RE: Centralized authentication service suggestions [body] =>
Thanks! I haven't been able to get back on track with it. I appreciate the suggestions! I will have to find time and get back to it.

[created] => 2019-04-13 15:00:16 [modified] => 2019-04-13 15:00:16 [likes] => 0 [votes] => 0 [is_answer] => 0 [is_first_post] => 0 [status] => 0 [name] => [email] => [private] => 0 [root] => 1990 [url] =>  https://inocul8r.net/session/community/advice/centralized-authentication-service-suggestions/#post-2079  [is_answered] => 0 [votes_sum] => 0 [likes_count] => 0 [likers_usernames] => Array ( ) )
Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

Any thoughts, anyone ? @robert @sofy ?

Thanks

Page 1 / 2