Members statistic?

Discussion in 'Customization & add-ons' started by graphixx, May 24, 2008.

  1. graphixx

    graphixx Member

    Joined:
    Apr 19, 2008
    Messages:
    48
    Is it possible to show statistic of members on other pages than amember pages? And is it a way to show any statistic of different memberships? Any information on how this can be done would be great:)
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    What do you mean by statistics?

    You can use the SESSION to display a number of things such as products, etc.

    What kind of information are you looking to display?
  3. graphixx

    graphixx Member

    Joined:
    Apr 19, 2008
    Messages:
    48
    Something like:
    So far 20 members signed up for product 1

    And a compare chart for each membership and how many bought that something like:

    Compare memberships:

    20% of our users bought product1 and 80% bought product2.
    Best value for you is to go for product2 with a discount on 10%
  4. calisolllc

    calisolllc Member

    Joined:
    Feb 19, 2007
    Messages:
    194
    Here's how it all works ....
    Which users are attached to what products is contained in the payments table of the amember database. One or more payments for each user/product combo.
    There are only 2 ways to give the sort of stats that you require:
    Bad way: each time you wish these to be displayed do a complete traverse of the payment table, writing the subtotals and totals into an array to manipulate and display. Should you have a lot of members this would be slow to do, and resource intensive if you not only have a lot of members, but have a lot of members online at any one time.
    Best way: To set up a new table in the database that updates on payment entry (a hack of the payment code) and also upon expirations (a new cron controlled job would need to be coded). The table would have to contain total members field, total members for product 1 field, product 2 field, product 3 field etc etc etc. This would then be displayed whenever you wished to show the stats to the users, with no real drain on resources. You would also need to hack the code for product creation and deletion to add a field to this summary table each time a new product was created and delete a field from the table each time a product was deleted, as well a hack of the code to update numbers in the summary table when a member is deleted manually and also same if a customer is banned
    So its a substantial amount of modding of the various code modules to get an elegant solution to your requirements.

Share This Page