Closed (fixed)
Project:
User Points
Version:
5.x-3.x-dev
Component:
Code: userpoints
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Dec 2007 at 03:34 UTC
Updated:
26 Dec 2007 at 10:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
jredding commentedCan other post if this is a useful addition OR would it be more useful to change this to a display setting.
Example
display => NULL (adhere to administrative settings)
display => false (override administrative settings and suppress output)
display => true (override administrative settings and display out)
If the change was made to do it like this then it would fall more in line with the other settings as if they are null they adhere to administrative settings otherwise its overrides.
Comment #2
ezyang commentedjredding: I considered that, and I can easily extend the patch to do that. However, because the default setting is to display the message, I don't know when any application would explicitly set display => true. Advise?
Comment #3
ezyang commentedUpdated patch that implements display, allowing true false or null.
Comment #4
jredding commentedkbahey: can you chime in? Code looks good and it is a very simple update to the API.
Comment #5
jredding commentedThere are some very, very minor things that I would change but its pretty much RBTC.
kbahey: you've got the final answer, yay or nay?
Comment #6
kbahey commentedI think this is a good thing to have.
However, I don't want the name to be "mute". It should be something like "message" (defaults to true) or "silent" (defaults to false).
How do we make this a site wide setting? e.g. someone wants every points operation on their site to be silent? We don't want every caller to specify that, we want a global setting. We can have a module called "userpoints_silent" that does just that. In it, we use the 'points before' operation to "inject" a silent = true when this is set.
Go ahead with this.
Comment #7
kbahey commentedChanging to CNW so the name can be changed.
Comment #8
jredding commentedA few things.
I guess I snuck it in but a while back I coded in a feature request which was to have a global userpoints setting to show/hide the userpoints messages. In the administrative settings an admin can display/hide all point messages.
The call for this, as coded, is "display" not mute like the, now former, title said (title changed).
Thus the code would be..
$params = array(
'points' => 5,
'display' => true
);
userpoints_userpointsapi($params);
If display is NULL the site settings (show/hide) are used. If display is explicitly set then the site settings are overridden. Thus you do not have specify the display property in the call.
Comment #9
jredding commentedcommited