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?
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?