I know this is an old question, but I recently had the same exact need. After looking around for a few days, I decided to figure it out for myself. Most of it came from the AUP docs, so here is what you do:
Jomsocial 4.2 - latest release
Open components/com_community/controllers/photos.php
Around line 2924 after
$preMessage = '';
if (CLimitsLibrary::exceedDaily('photos', $my->id)) {
$preMessage = JText::_('COM_COMMUNITY_PHOTOS_LIMIT_PERDAY_REACHED');
$disableUpload = true;
} else {
$preMessage = JText::_('COM_COMMUNITY_PHOTOS_DEFAULT_UPLOAD_NOTICE');
$disableUpload = false;
}
Add:
//AlphaUserPoints start
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
}
//Alphauserpoints Get user points
$user = & JFactory::getUser();
$userid = $user->id ;
$totalPoints = AlphaUserPointsHelper::getCurrentTotalPoints( '', $userid );
// Function to check if enough points
if ($totalPoints < 5) { // enter your Points Cost per Upload
$preMessage = JText::_('COM_COMMUNITY_PHOTOS_LIMIT_POINTS_REACHED');
$disableUpload = true;
} else {
$preMessage = JText::_('COM_COMMUNITY_PHOTOS_POINTS_UPLOAD_NOTICE');
$disableUpload = false;
}
Now go to line 61601 - look for:
if ($my->id == 0) {
$tokenId = $jinput->request->get('token', '', 'NONE');
$userId = $jinput->request->get('uploaderid', '', 'NONE');
$my = CFactory::getUserFromTokenId($tokenId, $userId);
$session = JFactory::getSession();
$session->set('user', $my);
}
Add after:
//AlphaUserPoints start
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
}
//Alphauserpoints Get user points
$user = & JFactory::getUser();
$userid = $user->id ;
$totalPoints = AlphaUserPointsHelper::getCurrentTotalPoints( '', $userid );
if (CLimitsLibrary::exceedDaily('photos', $my->id)) {
$this->_showUploadError(true, JText::_('COM_COMMUNITY_PHOTOS_LIMIT_PERDAY_REACHED'));
return;
}
// Function to check if enough points
if ($totalPoints < 5) {
$this->_showUploadError(true, JText::_('COM_COMMUNITY_PHOTOS_LIMIT_POINTS_REACHED'));
return;
}
Now go to your langauge/en-GB/en-GB.com_community.ini file
Add anywhere:
COM_COMMUNITY_PHOTOS_LIMIT_POINTS_REACHED="You do not have enough points to upload images. Images are 5 points each."
Change your message to whatever you are charging for Points. Also make sure you adjust the number of points in the code as well. You can also adapt and use this code for Video Uploads or File uploads.
If someone can make this into a installable PLUGIN for AUP or JomSocial, that would rock.
I hope this helps others!