Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: gear777 on June 19, 2024, 07:08:30 PM

Title: List of post on profile.template.php
Post by: gear777 on June 19, 2024, 07:08:30 PM
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'], ' -->';
        }
Title: Re: List of post on profile.template.php
Post by: Kindred on June 19, 2024, 07:54:03 PM
What exactly are you trying to do?
Title: Re: List of post on profile.template.php
Post by: dodos26 on June 20, 2024, 03:34:37 AM
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.
Title: Re: List of post on profile.template.php
Post by: gear777 on June 20, 2024, 09:06:34 AM
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.
Title: Re: List of post on profile.template.php
Post by: zedd151 on June 20, 2024, 09:36:43 AM
"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?
Title: Re: List of post on profile.template.php
Post by: Kindred on June 20, 2024, 10:05:32 AM
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)
Title: Re: List of post on profile.template.php
Post by: dodos26 on June 20, 2024, 12:44:30 PM
I think I want to see a list of posts which is the so-called first topic.
asdasd.png
Title: Re: List of post on profile.template.php
Post by: Arantor on June 20, 2024, 01:18:37 PM
How many posts? Based on what criteria?