USERPUNKTE FOR JOMSOCIAL ON CONTROLLER.PHP

More
6 years 11 months ago #38435 by wokabe2008
elseif($pointsys =='js')
{
// points are a dynamic value. Points transaction has to be processed via SQL
// check if user had enough points to play
$q ="SELECT points FROM #__community_users WHERE userid=".$db->quote($user->id)." ";
$db->setQuery($q);
$mypoints = $db->loadResult();
if($mypoints < $initial_cost)
return;

// set new transaction
$q ="UPDATE #__community_users SET points = points + ".$points." WHERE userid='".$user->id."' ";
$db->setQuery($q);
$db->execute();


$q = " INSERT INTO #__community_profile_stats
(uid , type , count, date , params , created_at)
VALUES
('".$user->id."' , 'points' , '". $points ."' , '".date('Y-m-d')."' , '' , '".date('Y-m-d H:i:s')."' )";
$db->setQuery($q);
$db->execute();


// return new amount
echo $mypoints = $mypoints + $points;
}

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

Time to create page: 0.299 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.