Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9112

Most active forum post count does not respect m_approve permission

    Details

      Description

      As known, if a new users makes several posts, all will withheld in the moderator queue. Well, a users made two posts, I approved one and was going to disapprove the other when I noticed in his profile it showed for posts as having 1 and 1 being in queue but for most active forum, it shows two posts despite only one being approved and the other still in queue.

      I made a regular user account and looked at his profile and it still showed two posts in the most active forum. So for active forum a post shouldn't count until it's actually approved/disapproved. I'm not sure about most active topic.

      1. untitled.JPG
        117 kB
      2. untitled2.JPG
        116 kB

        Issue Links

          Activity

          Hide
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment -

          Yes, I see that display_user_activity() does not check post approval. The question is whether we want to fix it (this is pretty minor, after all )

          Show
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment - Yes, I see that display_user_activity() does not check post approval. The question is whether we want to fix it (this is pretty minor, after all )
          Hide
          nickvergessen Joas Schilling added a comment -

          We don't count the post to the post-counter of the forum and user, so it shouldn't count to his stats aswell?

          Show
          nickvergessen Joas Schilling added a comment - We don't count the post to the post-counter of the forum and user, so it shouldn't count to his stats aswell?
          Hide
          bantu Andreas Fischer added a comment -

          I'd say fix, if it doesn't increase the query complexity.

          Show
          bantu Andreas Fischer added a comment - I'd say fix, if it doesn't increase the query complexity.
          Hide
          nickvergessen Joas Schilling added a comment -

          Tested this a bit on my site (10k Posts, 3.5k from my user)
          Query-time went up from 0.03 to 0.038.

          before adding "AND post_approved = 1":

          id 	select_type 	table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
          1 	SIMPLE 	phpbb_posts 	ref 	poster_id 	poster_id 	3 	const 	2486 	Using where; Using temporary; Using filesort

          after adding:

          id 	select_type 	table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
          1 	SIMPLE 	phpbb_posts 	index_merge 	poster_id,post_approved 	poster_id,post_approved 	3,1 	NULL 	1243 	Using intersect(poster_id,post_approved); Using wh...

          I don't know how much the difference is on a bigger board f.e. phpbb.com

          Show
          nickvergessen Joas Schilling added a comment - Tested this a bit on my site (10k Posts, 3.5k from my user) Query-time went up from 0.03 to 0.038. before adding "AND post_approved = 1": id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE phpbb_posts ref poster_id poster_id 3 const 2486 Using where; Using temporary; Using filesort after adding: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE phpbb_posts index_merge poster_id,post_approved poster_id,post_approved 3,1 NULL 1243 Using intersect(poster_id,post_approved); Using wh... I don't know how much the difference is on a bigger board f.e. phpbb.com
          Hide
          bantu Andreas Fischer added a comment -

          What's the full query? What's the extra column exactly?

          Show
          bantu Andreas Fischer added a comment - What's the full query? What's the extra column exactly?
          Hide
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment -

          One other thing about this is that not all moderators can see all posts awaiting approval in all forums. For example, the Support Team can't see what posts are awaiting approval in the MOD forums at phpbb.com.

          I think I'll do this so that if you have m_approve in any forum, you'll see unapproved posts listed in the statistics for all forums. If you do not have m_approve anywhere, you'll only see approved posts.

          Show
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment - One other thing about this is that not all moderators can see all posts awaiting approval in all forums. For example, the Support Team can't see what posts are awaiting approval in the MOD forums at phpbb.com. I think I'll do this so that if you have m_approve in any forum, you'll see unapproved posts listed in the statistics for all forums. If you do not have m_approve anywhere, you'll only see approved posts.
          Hide
          bantu Andreas Fischer added a comment -

          Missing "AND".

          SQL ERROR [ mysqli ]
           
          You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'post_approved = 1 GROUP BY forum_id ORDER BY num_posts DESC LIMIT 1' at line 6 [1064]

          Both queries are "Using where; Using temporary; Using filesort", the query complexity does not change.

          Show
          bantu Andreas Fischer added a comment - Missing "AND". SQL ERROR [ mysqli ]   You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'post_approved = 1 GROUP BY forum_id ORDER BY num_posts DESC LIMIT 1' at line 6 [1064] Both queries are "Using where; Using temporary; Using filesort", the query complexity does not change.
          Hide
          bantu Andreas Fischer added a comment -
          Show
          bantu Andreas Fischer added a comment - Alternative patch suggestion: http://github.com/bantu/phpbb3/compare/ticket/9112
          Hide
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment -

          Looks better, to actually correctly show the unapproved posts to the right moderators.

          Show
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment - Looks better, to actually correctly show the unapproved posts to the right moderators.

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              Tripp Tripp
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development