• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Duplicate Prevent Spamming in the Profile Posts Widget?

Jaxel

Well-known member
#1
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
 

clove28

Active member
#3
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?