public function applycustomrule() { // several users $cid = JFactory::getApplication()->input->get('cid', array(0), 'array'); $cid = implode(",", $cid); if (count($cid) < 1) { JViewContent::displayError(JText::_('Select an item to') . ' ' . JText::_($action)); return false; } $view = $this->getView('rules', 'html'); $view->assign('cid', $cid); $view->_displaycustomrulepoints(); }
function _aup_registration_raffle($cid = null, $regitration = 1, $option, $table, $redirect) { $app = JFactory::getApplication(); if (JFactory::getUser()->authorise('core.edit.state', 'com_alphauserpoints')) { // initialize variables $db = JFactory::getDBO(); if (count($cid) < 1) { $action = $regitration == 1 ? 'regitration' : 'unregitration'; JViewContent::displayError(JText::_('Select an item to') . ' ' . JText::_($action)); return false; } $cids = implode(',', $cid); $query = "UPDATE #__{$table}" . "\n SET inscription = {$regitration}" . "\n WHERE id IN ( {$cids} )"; $db->setQuery($query); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg()); return false; } } // end if authorize to change state $redirecturl = "index.php?option={$option}&task={$redirect}"; JControllerLegacy::setRedirect($redirecturl); JControllerLegacy::redirect(); }