This is a task issue for the purpose of compiling bug reports and other issues with the yet-to-be-released Version 3 of Userpoints. A lot of changes have been made to UP in v3 so there is a lot to test before it is made available. A development snapshot hasn't been made available for download yet because (a) I think that decision lies with kbahey and (b) too many people use the dev version as a stable version w/o considering the repercussions since the DEV is very unstable at this point creating an easily-downloadable version might unnecessarily a lot of chatter over little issues. I would, however, like to get a dev release packaged up as soon as possible and I have the time to do this now.

The module appears to be stable on my install but that doesn't mean much in the world ;)

Please grab the CVS and start submitting patches and/or issues. I highly welcome patches as the code is in feature freeze (well on my end it is ;) ).

A high level overview of what has changed....

  • Structure changes
    • New API
      • API now accepts a structured array or an (int)
        • Documented in the README.txt file with the module as well as doxygen comments within the module
      • Same API call for Updates and Inserts, similar to node_save()
      • If called with a single numeric value, site defaults are used and points are awarded to the currently logged in user
      • Every database column can be passed into the array and the API will handle it accordingly (i.e. API calls can override site defaults and manipulate all areas of the DB w/ the API acting as a sanity checker)
    • API handles transactions AND caching table
      • Previously the API added in transaction but other calls had to be made to ensure that the caching table was properly updated. Now there is a new function userpoints_update_cache() which properly ensures that the caching table is up to date. This also lays the foundation for anyone that would like to rewrite the caching table functions so that it is a SQL sum() function vs. a points + points method.
    • No INSERT/UPDATES need to be done by other modules
      • No contributed modules should have any need to do an INSERT/UPDATE directly to the userpoints_txn or userpoints table. The API will do both!
  • New Features!
    • Points Expiration
      • Points can expire on a set date or after a set amount of time
      • runs on a cron job
      • is point specific! So certain points can last longer/shorter than others
    • Points Categorization
      • Utilize term IDs to categorize points
      • Categories are carried through into the caching table for faster access
      • Modules can add terms to the vocab and separate their points.
  • Interface changes
    • Transaction tools in core (no longer a contrib module)
    • /myuserpoints shows detailed transaction history
    • Single interface to view, moderate and add links
    • Userpoints listing is the default view
    • listing and moderation views can show All categories or selected category
  • Bug fixes
    • many.. too many to list.

Examples of how to use the new API

//give the currently logged in user 5 points using all site defaults
//This is the minimum call needed (pretty quick isn't it?) 
userpoints_userpointsapi(5); 

$params = array(
   'uid' => 1,
   'points' => 5,
   'tid' => 10,
   'moderate' => false,
   'event' => 'test',
   'description' => 'test points', 
); 
userpoints_userpointsapi($params); 
/*This gives user #1 5 points with an event of "test", description of "test points", 
* and  categorizes them with taxonomy id 10. It also bypasses the site moderation 
* as explicitly set parameters bypass site settings (i.e. "moderate => false" bypasses moderation) . 
*/

Comments

jredding’s picture

Version: master » 5.x-3.x-dev

Change version to 5.3.x-dev as the release is now available for download.
http://drupal.org/node/184086

berdir’s picture

Component: Code: userpoints » Code: userpoints API
Status: Active » Fixed

Sorry for spamming the participants in this issue. Due to the release of Drupal 7 and the lack of time from the maintainers, I'm closing all remaining 5.x issues for Userpoints.

Feel free to re-open this issue or create a new one for 6.x or even better 7.x if this bug is still open or feature is missing for these versions.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.