Hello Modus,
I didn't understand the term "certain article". Anyway, if you want to give points to user upon reading an item in any app you want just add the following lines of code in
/media/zoo/applications/blog/templates/default/item.php
At the bottom of the file after last </div>
<?php
$userid =& JFactory::getUser();
if($userid != 0){
$auplink = JRoute::_('index.php?option=com_zoo&task=item&item_id='.$this->item->id.'&Itemid='.JRequest::getInt('Itemid', 0));
$auphref = '<a href="'.$auplink.'">'.$this->item->name.'</a>';
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'plgaup_zoo', '', $this->item->id, "Reading Item: ".$auphref);
}
}
?>
To give points in a similar way in other apps also just change the app name in the path provided above and paste the same code at the end of the file. I think this should work(I haven't checked though). Do remember to change the name of the plugin. You can duplicate the one I attached in the first post or alternative add an extra parameter in the last line with suitable points as in my previous posts.
Now for the comments:
Open up /components/com_zoo/controllers/comment.php
After line $table->save($comment);
paste
$userid =& JFactory::getUser();
if($userid != 0){
$auplink = JRoute::_('index.php?option=com_zoo&task=item&item_id='.$item_id.'&Itemid='.JRequest::getInt('Itemid', 0));
$itemname = $this->app->table->item->get($item_id)->name;
$auphref = '<a href="'.$auplink.'">'.$itemname.'</a>';
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'plgaup_zoo', '', '', "Commenting on item: ".$auphref);
}}
Here also be careful about the plugin name. Change it to whatever you want(be careful to install it first in AUP rules page) If you want to use the same plugin throughout zoo then just add an extra parameter in the last line on the number of points you want to award under the same plugin name.
I hope this helps.
Thanks and Cheers,
Adithya.S