Welcome, Guest
Username Password: Remember me

K2 article read gets duplicate points.
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: K2 article read gets duplicate points.

K2 article read gets duplicate points. 1 year, 4 months ago #14324

  • yakangler
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Points: 398
  • Karma: 2
I'm trying to setup AUP with k2 the first rule I have is when a user reads an article they should get points, but only get points the first time they have read it. Currently they are getting points every time they read the article which is no good. This is what I have done and maybe someone can point me in the right direction on why this is happening.

I've added the blow code to components\com_k2\model\item.php

around line 496 just after

if ($view=='item'){
			@list($item->introtext, $item->fulltext) = explode('{K2Splitter}', $item->text);


I've added

// AUP start
					
					$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'plgaup_k2read', '', $k2read, 'Article Read');
}

// AUP end


no I thought the by adding $k2read that it would see it as my reference key and not give out duplicate points
but it is.... any ideas?

Thanks!

Re: K2 article read gets duplicate points. 1 year, 4 months ago #14337

  • yakangler
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Points: 398
  • Karma: 2
Bump, someone mind taking a look at this?

Re: K2 article read gets duplicate points. 1 year, 4 months ago #14367

  • raizen
  • OFFLINE
  • Expert Boarder
  • Posts: 135
  • Points: 670
  • Karma: 3
Hi, try this www.tdservers.net
The Best Alphauserpoints Rules On www.tdservers.net

Re: K2 article read gets duplicate points. 1 year, 4 months ago #14368

  • yakangler
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Points: 398
  • Karma: 2
yes I'm sorry but I have 95% of the work already done, and will share with who ever once I figure out why it's duplicating.
  • Page:
  • 1
Moderators: adroussel, dalekurt, migus, some1new
Time to create page: 0.51 seconds
Goto Top