Keyword

AlphaUserPoints with k2 v2.3

  • Andrey Kovalyov
  • Andrey Kovalyov's Avatar Topic Author
  • Offline
  • New Member
More
14 years 2 months ago #85705 by Andrey Kovalyov
AlphaUserPoints with k2 v2.3 was created by Andrey Kovalyov
Sorry for my English. Some body help me connect AlphaUserPoints with k2 v2.3. I want, that user get point after posting new item. I use Joomla 1.5.18 and AlphaUserPoints last version.



I change this code:

function save() {                       $mainframe = &JFactory::getApplication();                       JRequest::checkToken() or jexit('Invalid Token');                       JRequest::setVar('tmpl', 'component');                        require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'item.php');                        $model= new K2ModelItem;                        $model->save(true);                        $mainframe->close();                        }



for this:



function save() {                       $mainframe = &JFactory::getApplication();                       JRequest::checkToken() or jexit('Invalid Token');                       JRequest::setVar('tmpl', 'component');                       require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'item.php');                       $model= new K2ModelItem;                       $model->save(true);                       $mainframe->close();           $api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';           if ( file_exists($api_AUP))              {                require_once ($api_AUP);                AlphaUserPointsHelper::newpoints( 'plgaup_k2' );              }                        }



When registered user added new item and press "Save", one point add to his account(as i input in plugin), window with editor don't closing and user can press "Save" many times and adding points.

  What do you advise me?

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

More
14 years 2 months ago #85706 by bluebirdzx
Replied by bluebirdzx on topic AlphaUserPoints with k2 v2.3
user can press "Save" then close this window

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

  • Andrey Kovalyov
  • Andrey Kovalyov's Avatar Topic Author
  • Offline
  • New Member
More
14 years 2 months ago #85707 by Andrey Kovalyov
Replied by Andrey Kovalyov on topic AlphaUserPoints with k2 v2.3
:) User can press "Save" many times and get many points to his account.

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

More
14 years 2 months ago #85708 by bluebirdzx
Replied by bluebirdzx on topic AlphaUserPoints with k2 v2.3
my pool english, the K2 windows not cloased when press 'save',so you may add code in 'save' then close it

Andrey Kovalyov said::) User can press "Save" many times and get many points to his account.

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

More
14 years 2 months ago #85709 by CFBPredictions.com
Replied by CFBPredictions.com on topic AlphaUserPoints with k2 v2.3
I'd like to make a request for a couple additional AUP rules for K2.

I'd like to have a rule that
-gives points for rating an article
-gives points for making a comment in K2 commenting system and removes points if comment deleted
-gives points for emailing an article (and social sharing, if possible)
-gives points when a user emails a friend to read an article and the user earn points if the article is read

The last three of these rules come with AUP for com_content but I'd like to use K2 instead.

If someone knows where these rules are available or would like to write them for $, please message me or reply.

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

More
14 years 3 days ago #85710 by Banditozzz
Replied by Banditozzz on topic AlphaUserPoints with k2 v2.3
i need this toooooo!!!

John Leake said:I'd like to make a request for a couple additional AUP rules for K2.
I'd like to have a rule that
-gives points for rating an article
-gives points for making a comment in K2 commenting system and removes points if comment deleted
-gives points for emailing an article (and social sharing, if possible)
-gives points when a user emails a friend to read an article and the user earn points if the article is read

The last three of these rules come with AUP for com_content but I'd like to use K2 instead.

If someone knows where these rules are available or would like to write them for $, please message me or reply.

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

  • La Maquina Creativa
  • La Maquina Creativa's Avatar
  • Offline
  • New Member
More
13 years 2 months ago #85711 by La Maquina Creativa
Replied by La Maquina Creativa on topic AlphaUserPoints with k2 v2.3
 TRY THIS:

$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';

if ( file_exists($api_AUP))

{

require_once ($api_AUP);

$keyreference= 'ready'; //or anything other word you like

$datareference=$item->title;

AlphaUserPointsHelper::newpoints( '
plgaup_k2', '', $keyreference, $datareference);

}

 

NOTE: When the user presses SAVE the 1st time, the word 'ready' will be saved into the $keyreference field on the Database. Next time the user presses save  AUP will check if  $keyreference = 'ready'. If so, no more points will be awarded.

$datareference=$item->title will show the name of the article for which the user was awarded points.

 

I hope this works for you :)

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


Powered by Kunena Forum