Keyword

K2 and Alpha UserPoints system

  • McGreg
  • McGreg's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 months ago #94874 by McGreg
K2 and Alpha UserPoints system was created by McGreg
Hi every one. I was looking i 2 weeks on forum and dint find a really good info about that. I think is very many people come to be very happy if we can get this work. I try make a rule for K2 in AlphaUserPoints system. I can read in their manuals. But i dont know where exactly into K2 I must put in their code?

My question is: Where in K2 I can find following code for following actions:

 

Action 1: Login into joomla with K2 log module.

Action 2: Add a item

Action 3: read a item

Action 4: add a comment

Action 5: Send a email with item recommended

Action 6: Click on category link in item and category link in cat.view

Action 7: Click on author link in item and cat.view

Action 8: download attachment file

I think if someone can help us with this so K2 can get new possibility for everyone.. 


Step 1 - Inserting API in the component This course is aimed primarily at developers or any person with a level of knowledge sufficiently advanced in PHP.

Simply insert the following API in the code component to where you want. The ideal is to follow an action that can bring items to the connected user. For example, in a component of any comments or forum, simply add the API after insertion source code of the commentary or new topic in the database.

API:

$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'function_name' );
}


function_name is the rule which will be used to award points to the current user (if registered and logged).
For all the rules included in AlphaUserPoints (systems), the function names are written as follows:

example: sysplgaup_newregistered for awarding points to a new registered user.

It should keep a nomage standard for plugin-third of components as follows:

plgaup_function_name

Example plgaup_newcomment or plgaup_newtopic to resume the example of the inclusion of this component API in a comment or forum.
The name of a function to award points when creating a new topic posted in the component Fireboard could be, for example, plgaup_newtopic_fb.

Step 2 - Creation XML file

It should then create a file xml to facilitate the installation of the rule in AlphaUserPoints. 5 elements need to be specified: The name of the rule, its description, the name of the component using the rule (com_example), the function name used by the rule and if points are fixed (true or false). <? xml version = "1.0" encoding = "utf-8"?> <alphauserpoints type="plugin">      <rule>short name of the rule</ rule>      <description>Description of the rule</ description>      <component>com_example_component (or Exemple component)</ component>      <plugin_function>plgaup_function_name</ plugin_function>     <fixed_points>true or false</fixed_points></ alphauserpoints>This XML file must be encoded in UTF-8 and then can be archived (. Zip).

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum