User Tools

Site Tools


userpoints:developer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
userpoints:developer [2024/04/02 18:39] adminuserpoints:developer [2025/03/07 14:28] (current) admin
Line 133: Line 133:
 ==== Step 2 - XML file creation ==== ==== Step 2 - XML file creation ====
  
-Then developers have to create an xml file to make easier the installation process in the UserPoints component. This xml file has to be utf-8 encoded (required). All developers of third party extensions for Joomla! can add directly at the root of their frontend component a unique xml file containing all the rules for a single componentDeveoper has to respect the ordering and tags: structure example: [betauserpoints_rule.xml](images/stories/documentation/betauserpoints/betauserpoints_rule.xml) Tag “component” is the name of the third component like “com_kunena” or other. As it is the same component, it is worth repeating for each rule in the tag “rule”. +To complete the integration of an application with UserPoints, create an XML file to specify rule(s). The XML file should be added at the top level of the extension that is being integrated with UserPointsIn the case of component, it should be on the user sideThe XML file must be called userpoints_rule.xml. If the extension being integrated with UserPoints has been installed including a valid userpoints_rule.xml file, then the site administrator can invoke "Auto-detect new rules" from the UserPoints control panelUserPoints will then look for any XML rule files and incorporate them into the database of rules
-Administrator of the website which install a third component with this xml file can autodetect directly from the button “auto-detect plugins” in control panel of UserPoints. + 
-This xml file has to be utf-8 encoded (required) but not be zipped! Just put this file at the root of frontend component folder or plugin or module and include this file in your installer extension. This file must be named exactly as follows: betauserpoints_rule.xml+An example of userpoints_rule.xml is the file for Remository which reads: 
 + 
 +<code> 
 +<?xml version="1.0" encoding="UTF-8"?> 
 +<userpoints> 
 +    <component>com_remository</component> 
 +    <rules> 
 +        <rule> 
 +            <name>Upload</name> 
 +            <description>Give points when a new file is uploaded</description> 
 +            <plugin_function>up_remository_up</plugin_function> 
 +            <fixed_points>true</fixed_points> 
 +            <category>ot</category> 
 +            <display_message>1</display_message> 
 +            <email_notification>1</email_notification> 
 +        </rule> 
 +        <rule> 
 +            <name>Download</name> 
 +            <description>Take points when a file is downloaded</description> 
 +            <plugin_function>up_remository_down</plugin_function> 
 +            <fixed_points>false</fixed_points> 
 +            <category>ot</category> 
 +            <display_message>1</display_message> 
 +            <email_notification>1</email_notification> 
 +        </rule> 
 +    </rules> 
 +</userpoints> 
 +</code> 
  
 === Code list for categories : === === Code list for categories : ===
Line 158: Line 186:
 </code> </code>
  
-NOTE Optionally, you can avoid this step manually by filling all the fields in the creation of new rule directly in the rule manager (button 'New' in toolbar).+=== Code list for methods=== 
 + 
 +You can add a <method> tag into the XML for a rule, with the following options: 
 + 
 +<code> 
 +1 -> Only once 
 +2 -> Once a day per user 
 +3 -> Once a day for a single user on all users 
 +4 -> Whenever 
 +5 -> Once per week 
 +6 -> Once per month 
 +7 -> Once per year 
 +</code> 
  
-==== Plugin/Rule installation ====+NOTE : It is possible to create new rules manually by filling all the fields in the creation of a new rule directly in the rule manager (button 'New' in toolbar). But for the integration of other extensions with UserPoints the use of a userpoints_rule.xml file is much better.
  
-- auto-detect xml file at the root of frontend component: 
-Click on the button “Auto-detect plugins” in the control panel of UserPoints after installation of third component, plugin or module. Check regularly or periodically by clicking on this button. 
  
-==== Using UserPoints information in a third party component ====+===== Using UserPoints information in a third party component =====
  
 You can use easily the profil informations of a user directly in a third component. You can use easily the profil informations of a user directly in a third component.
Line 428: Line 467:
 * Created on 15 January 2016. * Created on 15 January 2016.
  
-* Last updated on 7 February 2024.+* Last updated on 25 November 2024.
  
  
  
  
userpoints/developer.1712083180.txt.gz · Last modified: 2024/04/02 18:39 by admin