joomla の adsmanager 広告の支払いに alphauserpoints クレジットを使用できるプラグインまたはハックはありますか?
1 に答える
0
Alphauserpoints 1.7.4、Adsmanager 2.7 RC3、および PaidSystem に対する私のソリューションは次のとおりです。
編集components\com_paidsystem\api.paidsystem.php
defined('_JEXEC') or die( 'Restricted access' );
以下のコードを追加した後
//AlphaUserPoints start
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
}
//AlphaUserPoints end
次に、関数 getBalance($userid) を編集する必要があります。これは api.paidsystem.php にあります
function getBalance($userid)
{
//Alphauserpoints substitute for value
//Get the RefferreID of a user
$referreid = AlphaUserPointsHelper::getAnyUserReferreID((int)$userid);
$profil=AlphaUserPointsHelper:: getUserInfo ($referreid);
$value=$profil->points;
//Alphauserpoints substitute for value end
//ORIGINAL CODE BELOW
/*$db =JFactory::getDbo();
//$db->setQuery( "SELECT credit FROM #__paidsystem_credits WHERE userid=".(int)$userid );
//To explicitly convert a value to integer, use either the (int) or (integer) casts.
$value = $db->loadResult();*/
if ($value == "")
$value = 0;
return $value;
}
次に、次の関数を編集します
//EDIT this to debit credits from alphauserpoints
//Use alphauserpoints rule to debit from alphauserpoints.
function removeCredits($userid,$num,$description)
{
$db =JFactory::getDbo();
//$db->setQuery( "SELECT credit FROM #__paidsystem_credits WHERE userid=".(int)$userid );
//$balance = (float) $db->loadResult();
$referreid = AlphaUserPointsHelper::getAnyUserReferreID((int)$userid);
$profil=AlphaUserPointsHelper:: getUserInfo ($referreid);
$balance=$profil->points;
//$db->setQuery( "UPDATE #__paidsystem_credits SET credit=credit-".(float)$num." WHERE userid=".(int)$userid );
//$db->query();
echo "removeCredits=$userid,$num";
$obj = new stdClass();
$obj->userid = $userid;
$obj->balance = $balance;
$obj->change = $num * -1;
$obj->description = $description;
$obj->date = date("Y-m-d H:i:s");
AlphaUserPointsHelper::newpoints( 'plgaup_purchaseadvertising', '','', 'purchase advertising', $num*-1);
$db->insertObject("#__paidsystem_history",$obj);
}
注意: これを機能させるには、Joomla のalphauserpointsコンポーネントの管理者セクションで新しいルールを作成する必要があります。私のコードでは、新しいルール名は plgaup_purchaseadvertising と呼ばれていました。
于 2012-07-19T13:50:43.477 に答える