Duplicate Prevent Spamming in the Profile Posts Widget?

Jaxel

Well-known member
With the default XenForo profile posts widget, if someone posts 5 status updates a row, they will spam the entire widget. This widget should be restricted to only one profile post per user at a time. Currently the query is as follows:
Code:
return $this->fetchAllKeyed($this->limitQueryResults(
    '
        SELECT profile_post.*
            ' . $sqlClauses['selectFields'] . '
        FROM xf_profile_post AS profile_post
        ' . $sqlClauses['joinTables'] . '
        WHERE ' . $whereClause . '
        ORDER BY profile_post.post_date DESC
    ', $limitOptions['limit'], $limitOptions['offset']
), 'profile_post_id');
This issue could be easily fixed by simply adding to the query:
Code:
GROUP BY profile_post.profile_user_id
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
With the default XenForo profile posts widget, if someone posts 5 status updates a row, they will spam the entire widget. This widget should be restricted to only one profile post per user at a time. Currently the query is as follows:
Code:
return $this->fetchAllKeyed($this->limitQueryResults(
    '
        SELECT profile_post.*
            ' . $sqlClauses['selectFields'] . '
        FROM xf_profile_post AS profile_post
        ' . $sqlClauses['joinTables'] . '
        WHERE ' . $whereClause . '
        ORDER BY profile_post.post_date DESC
    ', $limitOptions['limit'], $limitOptions['offset']
), 'profile_post_id');
This issue could be easily fixed by simply adding to the query:
Code:
GROUP BY profile_post.profile_user_id

Do I just need to add the second code to the end of the first code?
 
Top Bottom