public function slugAction() { if ($this->_request->getParam('slug')) { $org = FM_Components_Organization::findBySlug($this->_request->getParam('slug')); if ($org) { switch ($org['type']) { case 2: $this->_redirect('/merchant/' . $org['id']); break; case 3: $this->_redirect('/org/' . $org['id']); break; case 4: $this->_redirect('/sports/' . $org['id']); break; default: $this->_redirect('/'); break; } } else { $this->_redirect('/notfound/' . $this->_request->getParam('slug')); } } else { $this->_redirect('/notfound/' . $this->_request->getParam('slug')); } }
public function ajaxcheckslugAction() { print FM_Components_Organization::findBySlug($_POST['slug']) ? '1' : '0'; exit; }
public function ajaxcheckslugAction() { print ($s = FM_Components_Organization::findBySlug($_POST['slug'])) && $s['id'] != $_POST['orgId'] ? '0' : '1'; //print_r($s); exit; }