Jump to content

4.X DB Schema Question: Total posts by a member


Go to solution Solved by Ryan Ashbrook,

Recommended Posts

Posted

In the Profile view of a member, it lists number of posts.

I'm trying to decipher the logic in the code and suspecting that the case is that the calculation of posts made may be actually summed with an aggregate rather than an actual field that maintains the count.

Can someone do me a solid -- is the number of posts calculated by an aggregate query or is an actual field?  I have the schema, and it's somewhat normalized (BCNF 3 -- maybe). Still I don't see it readily.

table and field that caches the post-count?  or aggregate query ?  if latter, just point me where.

We're trying to automate some "touch-up" on metrics and I'd rather shove the data in via SQL than by-hand edit 50K users via ACP.

 

Posted

As you recently upgraded from version 3, the counts are of actual content (not just forum posts, if you use the full suite of software) in the database at time of upgrade. This would be an accurate count of all the content for a user.

Posted

I understand it's current as of DB content at time of upgrade.  It's an admin request that I was asked to explore.

(Fickle users who want credit for something that happened in the past and no longer in the active DB.  Users. they want things that may not be feasible..etc..)

Anyway I think I found it.   From the HTML template I stumbled over 

            <li>
                <h4 class='ipsType_minorHeading'>{lang="members_member_posts"}</h4>
                {number="$member->member_posts"}
            </li>

 

Which lead me back the `core_members.member_posts` field.   Which seems to be field queried by relevant code.

This next question will help answer the feasibility concern:

Is `core_members.member_posts` refreshed with new data based on aggregate queries from background tasks?  If so I'll tell them there is no joy here because if I do artificailly pump the numbers (see above), it'll get overwritten the next time the Tasks sweep through.

 

Posted

You can adjust the content count manually in the ACP on the member profile. I cannot tell you how to do this manually in the database or via code as that is outside our scope of support. The system will continue to count from the artificial count you supply in the ACP. Just ensure an administrator does not rebuild the count as that will reset it back to only content that is available in the database.

Keep in mind though, there may be scenarios in the future that we need to rebuild the content count like we have needed to going from version 3 to version 4 so it may get set back sometime in the future.

Posted

I'll tell them there's no efficient way to do this.  We're not going to manually update 50K users via ACP.

If I knew the table and field I could do it in seconds since I have the legacy data.

Fair enough.

Looks like core_members.member_posts does change it but it throws a monkey in the wrench with respect to other metrics.   Nevermind.

(I sorta figured this would be the outcome but I had to check anyway).

What sort of special Merit Badge to third party developers for IPS plugins/extensions earn in order to lift the veil on the schema?   

Posted
11 minutes ago, Jim M said:

Just ensure an administrator does not rebuild the count as that will reset it back to only content that is available in the database.

 

Where in the ACP is this feature to "rebuild the count" ?

I cannot seem to find it.

Posted
Just now, sibomots said:

Where in the ACP is this feature to "rebuild the count" ?

I cannot seem to find it.

ACP -> Members -> Members -> view a member -> on "Posts", click the down arrow -> Recount.

Posted (edited)
4 minutes ago, Jim M said:

ACP -> Members -> Members -> view a member -> on "Posts", click the down arrow -> Recount.

For all members? Nevermind I see it "For all member"  Disregard.

 

 

Edited by sibomots
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...