public function process() { $this->poplr->defaults = false; $this->poplr->metas[] = array('name' => 'viewport', 'content' => 'width=device-width'); $this->poplr->styles[] = $this->poplr->getThemedUrl('css/mobile.css'); $this->thankYou = $this->poplr->fromGet('thank') == 'you'; if ($this->thankYou || !$this->poplr->fromPost('send')) { return; } $response = trim($this->poplr->fromPost('response')); if ($response == '') { return; } if ($this->poplr->db->queryRow("SELECT `id` FROM `dislikes` WHERE `response`=:response", array(':response' => $response))) { $this->thankYou = true; return; } $this->poplr->db->insert("INSERT INTO `dislikes` (`createdAt`,`response`) VALUES (:createdAt,:response)", array(':createdAt' => Poplr_Core::now(), ':response' => $response)); $this->poplr->sendRedirectHeader($this->poplr->actionUrl(null, array('thank' => 'you'))); }
protected function loadModulesAndAction() { $this->actionName = $this->fromGet('action'); foreach (Poplr_Core::listPaths(POPLR_SOURCES . '/modules', Poplr_Core::LIST_DIRS) as $modulePath) { if (is_readable($modulePath . '/module.php')) { $poplr = $this; require $modulePath . '/module.php'; } } if (!array_key_exists($this->actionName, $this->availActions)) { $this->actionName = 'index'; } if (is_readable(POPLR_SOURCES . '/action.' . $this->actionName . '.php')) { $poplr = $this; require POPLR_SOURCES . '/action.' . $this->actionName . '.php'; } }