function getTotal($user_id) { if (empty($this->_total)) { require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php'; $this->_total = generalHelpers::getTotal('#__wedding_thanks', 'id', 'user_id=' . $user_id); } }
function details() { $juser =& JFactory::getUser(); $username = JRequest::getString('user', $juser->username); require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php'; $profile_id = generalHelpers::getUserId($username); if (is_null($profile_id)) { $profile_id = $juser->id; } $id = JRequest::getInt('id'); $rows = new stdClass(); require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'user.php'; require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'wedding.php'; $tmpl = userHelpers::getCurrentTemplate($profile_id); $css = weddingHelper::getTemplateFolder('css', $tmpl->code); $images = weddingHelper::getTemplateFolder('images', $tmpl->code); $rows->images = $images; $rows->css = $css; $rows->menu = userHelpers::getUserMenu($profile_id); $this->_view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . $tmpl->code . DS); $rows->userdata = userHelpers::getUserData($profile_id); $rows->photos = $this->_model->getPhotos($id); $this->_view->setLayout('index'); $this->_view->details($rows); }
function checkpassword($view, $type) { $url = JURI::current(); $session =& JFactory::getSession(); $login = $session->get('com_wedding.' . $view . 'login', 0); if (!$login) { $juser =& JFactory::getUser(); $username = JRequest::getString('user', $juser->username); require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php'; $profile_id = generalHelpers::getUserId($username); if (is_null($profile_id)) { $profile_id = $juser->id; } if ($profile_id != $juser->id) { $url = 'index.php?option=com_wedding&view=' . $view; $dbo =& JFactory::getDbo(); $query = "SELECT id FROM #__wedding_apps WHERE `url` = '{$url}'"; $dbo->setQuery($query); $app_id = $dbo->loadResult(); $query = "SELECT `password` FROM #__wedding_userapps WHERE user_id = {$profile_id} AND app_id = {$app_id}"; $dbo->setQuery($query); $password = $dbo->loadResult(); if (!empty($password)) { $uri = JFactory::getURI(); $url = $uri->toString(array('path', 'query', 'fragment')); $this->_view =& $this->getView('auth', $type); $this->_view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . 'default' . DS); $this->_view->setLayout('auth.default'); $this->_view->display($view, $uri, $profile_id, $app_id); exit; } } } return false; }
function getTotal($user_id, $p = 0) { if (empty($this->_total)) { require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php'; $this->_total = generalHelpers::getTotal('#__wedding_videos', 'id', 'user_id=' . $user_id . ' AND published >= ' . $p); } }
function store() { $data = JRequest::get('post'); if (!isset($data['id'])) { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'general.php'; $data['ordering'] = generalHelpers::getMaxOrder('#__wedding_apps') + 1; } $row = $this->getTable('apps'); if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); return false; } JRequest::setVar('apply_id', $row->id); return true; }
function getTotal($user_id) { require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php'; return generalHelpers::getTotal('#__wedding_surveys', 'id', 'user_id=' . $user_id); }