Hello, how can I extract the user's posts in profile.template.php?
foreach ($context['posts'] as $post)
{
echo '
<div class="', $post['css_class'], '">
<div class="page_number floatright"> #', $post['counter'], '</div>
<div class="topic_details">
<h5>
<strong><a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong>
</h5>
<span class="smalltext">', $post['time'], '</span>
</div>';
if (!$post['approved'])
echo '
<div class="noticebox">
', $txt['post_awaiting_approval'], '
</div>';
echo '
<div class="post">
<div class="inner">
', $post['body'], '
</div>
</div><!-- .post -->';
// Post options
template_quickbuttons($post['quickbuttons'], 'profile_showposts');
echo '
</div><!-- .', $post['css_class'], ' -->';
}
What exactly are you trying to do?
Do you want to extract from your website, do you want to create your own list, such as mine in the attachment? Want to extract from another page, use xpatch.
Quote from: Kindred on June 19, 2024, 07:54:03 PMWhat exactly are you trying to do?
a list of each user's entries in their profile.
This is my profile (https://www.simplemachines.org/community/index.php?action=profile;u=666667). I want to place a list of entries in the profile.
"a list of each users entries"
What entries? Do you mean a listing of their posts?
Post Messages, Topics Started by user, and the users Attachments already have listings. It is unclear what you are after.
This is a case where more information is needed. What entries?? And where exactly do you want the list placed? On the user profile main page?
And this is your list of posts...
https://www.simplemachines.org/community/index.php?action=profile;area=showposts;sa=messages;u=666667
That content already exists
You still have not explained what exactly you are trying to do (or why)
I think I want to see a list of posts which is the so-called first topic.
asdasd.png
How many posts? Based on what criteria?