First you’ll need go Components > AlphaUserPoints then click on Plugins. Then you’ll unzip the files below which contain a .xml file. Then you upload 2 different .xml files. One is for creating points upon a new review listing. The other is for reviewing a existing item.

-

Next you’ll need to edit 3 files. Which sadly you’ll have to do every time you upgrade JReviews. So this is reference for me as well. This also prevents people from getting points just for editing a listing or review as well. First up is this file:

/components/com_jreviews/jreviews/controllers/listings_controller.php

Search for this text:

The listing was successfully saved

Here is the original

                if($listing['Listing']['state']) 
                {
                    App::import('Helper','routes','jreviews');
                    $Routes = new RoutesHelper();
                    $Routes->params = $this->params;
                    $url = cmsFramework::route($Routes->content('',$listing,array(),'',false));
 
                    $update_text = $isNew ? __t("Thank you for your submission.",true,true) : __t("The listing was successfully saved.",true,true);
                    $update_html = "<a href=\"{$url}\">".__t("Click here to view the listing",true)."</a>";
                    $jsonObject = json_encode(compact('target_id','update_text','update_html'));
                    $response[] = '
                        var $parentForm = '.$parentFrame.'.jQuery(\'#jr_listingForm\');
                        $parentForm.scrollTo({duration:400,offset:-100});
                        $parentForm.s2ShowUpdate('.$jsonObject.');                                                       
                    ';
                    return $this->makeJS($response);
                }
            }

Modified with AlphaUserPoints Integration:

                if($listing['Listing']['state']) 
                {
                    App::import('Helper','routes','jreviews');
                    $Routes = new RoutesHelper();
                    $Routes->params = $this->params;
                    $url = cmsFramework::route($Routes->content('',$listing,array(),'',false));
 
                    $update_text = $isNew ? __t("Thank you for your submission.",true,true) : __t("The listing was successfully saved.",true,true);
                    $update_html = "<a href=\"{$url}\">".__t("Click here to view the listing",true)."</a>";
                    $jsonObject = json_encode(compact('target_id','update_text','update_html'));
                    $response[] = '
                        var $parentForm = '.$parentFrame.'.jQuery(\'#jr_listingForm\');
                        $parentForm.scrollTo({duration:400,offset:-100});
                        $parentForm.s2ShowUpdate('.$jsonObject.');                                                       
                    ';
 
                    // ALPHA USER POINTS
                    	$filmtitle=$this->data['Listing']['title'];
			$id_filmu=$this->data['Listing']['id'];                                  
                    // ONLY ALLOW POINTS ONCE ^ 
                    	$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
			if ( file_exists($api_AUP))
			{
			    require_once ($api_AUP);
			    AlphaUserPointsHelper::newpoints( 'plgaup_jreviews_listing', '', $id_filmu, $filmtitle );
			}
                    // ALPHA USER POINTS
 
                    return $this->makeJS($response);
                }
            }

Next is the file that handles reviewing an existing listing.

/components/com_jreviews/jreviews/controllers/reviews_controller.php

Search for this:

$savedReview = $this->Review->save($this->data, $this->Access, $review_valid_fields);

Here is the original

$savedReview = $this->Review->save($this->data, $this->Access, $review_valid_fields);  
$review_id = $this->data['Review']['id'];

Modified with AlphaUserPoints Integration.

		// ALPHA USER POINTS
                $filmtitle=$this->data['Listing']['title'];
		$id_filmu=$this->data['Review']['id'];                              
                // ONLY ALLOW POINTS ONCE ^		
		$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
		if ( file_exists($api_AUP))
		{
		require_once ($api_AUP);
		AlphaUserPointsHelper::newpoints( 'plgaup_jreviews_reviews', '', $id_filmu, $filmtitle );
		} 							
		// END ALPHA USER POINTS
 
		$savedReview = $this->Review->save($this->data, $this->Access, $review_valid_fields);  
		$review_id = $this->data['Review']['id'];

There is another step for this part. Go to this file:

/components/com_jreviews/jreviews/views/themes/default/reviews/create.thtml

Search for this:

<?php if($review['Review']['review_id'] == 0):?>

Add this right below it:

	<!-- _________ ALPHA USER POINTS ______________ -->
	<?php if(isset($listing['Listing']['title'])):?>
	<input type="hidden" name="data[Listing][title]" id="listing_title" value="<?php echo $listing['Listing']['title'];?>" />
	<?php endif;?>
	<!-- _________ ALPHA USER POINTS ______________ -->

And you should be set, I’ll update this post later on how to remove points if you delete a listing/review.


[Update]

Here is how to remove points for deleting a listing. Still haven’t figured out how to remove points for deleting a review yet. If you figure it out, please let me know.

Search for this in this file:

components/com_jreviews/jreviews/controllers/components/everywhere/everywhere_com_content.php

$this->plgBeforeDelete('Listing.id',$listing_id);

And put this right after it:

        /* ******* AlphaUserPoints Support ************ */
        $query = "SELECT created_by FROM #__content WHERE id = $listing_id"; 
	$this->_db->setQuery($query); 
	$listing_authorid = $this->_db->loadResult(); 
	$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php'; 
	if ( file_exists($api_AUP)) 
	{ 
	require_once ($api_AUP); 
	$aupid = AlphaUserPointsHelper::getAnyUserReferreID( $listing_authorid ); 
	if ( $aupid )  AlphaUserPointsHelper::newpoints( 'plgaup_jreviews_listing_delete', $aupid ); 
	}        
        /* ******* AlphaUserPoints Support ************ */

If you have a better way of doing this let me know and I’ll update this post.

Via reviewsforjoomla.com/forum