Wie und wo schreibe ich dieses in PonyML
The karma package has a number of calls built in which should make it easier to award and remove points.
To manually add/remove points, you can use the CLASS_karma class and the functions addPoints() and remPoints().
Parameters are:
addPoints($userid, $points, $description) or remPoints($userid, $points, $description)
eg.
require_once( $mosConfig_absolute_path .
'/components/com_karma/karma.class.php' );
CLASS_karma::addPoints($my->id, 2, "Description goes here");
To get a point equivalent from a custom configuration point, you can use the getConfig() function.
Parementers are:
getConfig($name)
eg.
$points = CLASS_karma::getConfig("custom1")
*****Just be aware that if you are working this code into a mambot that they process user id differently so you will
need to use a code like this:
global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php' );
$points = CLASS_karma::getConfig("#FIELDNAMEHERE#");
CLASS_karma::addPoints($my->id, $points, "##DESCRIPTION HERE##");


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen