Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/11/2009, 15:06
Avatar de luzzifer
luzzifer
 
Fecha de Ingreso: julio-2009
Ubicación: Paraná - Argentina
Mensajes: 169
Antigüedad: 14 años, 9 meses
Puntos: 3
De acuerdo Crear un plugin

Hola bueno necesito crear un plugin y necesito ayuda el plugin que deseo crear es para un sistemas de puntos en mi web que tengo con el foro. Lo que quiero que crear es un plugin en el cual determine que cuando le den las gracias a un usuario le determine sierto puntaje. En realidad no Es tan complicado me parece. Necesito alguien que sepa algo de php para que mas o menos me de los pasos a seguir.

Aca les dejo la guia de como crear el plugin que necesito.

Cita:
The creation of a plugin (creation of a new rule for a third component) is divided into 2 phases.

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).
Esta en ingles pero no es dificil de entender. Bueno yo he leido pero no me cierra bien el tema me gustaria contar con alguien que me diga los pasos a seguir.

Espero Respuestas

Última edición por luzzifer; 29/11/2009 a las 21:23