public function indexAction() { $request = $this->getRequest(); /*//get pins data if($request->isXmlHttpRequest()) { $this->forward('gifts', 'getPins'); }*/ ///// get pins $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { //get pins data if ($request->isXmlHttpRequest()) { $this->forward('gifts', 'getPins'); } } else { if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward('gifts', 'getPins'); } $pins = (array) $this->getPinsAction(true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } //call header and footer childrens $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); }
public function callRewriteAction($methodName) { $this->setViewChange('index'); $request = $this->getRequest(); $this->view->menuSearch = $this->searchMenu(); $this->view->query = $request->getRequest('q'); /*//get pins data if($request->isXmlHttpRequest()) { $this->forward('search_' . $methodName, 'getSearchResult'); }*/ //get pins data $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { if ($request->isXmlHttpRequest()) { $this->forward('search_' . $methodName, 'getSearchResult'); } } else { $class_name = 'search_' . $methodName; if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward($class_name, 'getSearchResult'); } $controller_name = $this->getFrontController()->formatControllerName($class_name); $instance = new $controller_name(); $pins = (array) $instance->getSearchResultAction(true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); }
public function indexAction() { $request = $this->getRequest(); //first login after registration //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if ($request->getParam('direct_path') == 'true') { $this->sendWelcomeAction(); $this->redirect($request->getBaseUrl()); } if (!Helper_Config::get('config_disable_js')) { //if pin is in detail page $this->view->open_from_pin_detail_page = false; if ($request->getParam('open_from_pin_detail_page')) { $pin_array = new Model_Pins_Pin($request->getParam('open_from_pin_detail_page')); if ($pin_array->count()) { $pin_array = $pin_array->data; $this->getLayout()->placeholder('title', $pin_array['board_title'] . ' - ' . htmlspecialchars(strip_tags(html_entity_decode($pin_array['pin_description'])))); JO_Layout::getInstance()->placeholder('header_metas', $this->view->callChildren('pin/header_metas', $pin_array)); } $this->view->open_from_pin_detail_page = WM_Router::pinAction($request->getParam('open_from_pin_detail_page')); } } ///// get pins $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { //get pins data if ($request->isXmlHttpRequest()) { $this->forward('index', 'getPins'); } } else { if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward('index', 'getPins'); } $pins = (array) $this->getPinsAction(true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } //call header and footer childrens $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); }
public function indexAction() { $request = $this->getRequest(); $category_id = $request->getRequest('category_id'); $category_info = Model_Categories::getCategory($category_id); if (!$category_info) { $this->forward('error', 'error404'); } /*//get pins data if($request->isXmlHttpRequest()) { $this->forward('category', 'getPins'); }*/ ///// get pins $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { //get pins data if ($request->isXmlHttpRequest()) { $this->forward('category', 'getPins'); } } else { if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward('category', 'getPins'); } $pins = (array) $this->getPinsAction(true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } $this->view->category = $category_info; $category_logo = ''; if ($category_info['image'] && file_exists(BASE_PATH . '/uploads' . $category_info['image'])) { $category_logo = $request->getBaseUrl() . 'uploads' . $category_info['image']; } $this->getLayout()->placeholder('title', $category_info['meta_title'] ? $category_info['meta_title'] : $category_info['title']); JO_Layout::getInstance()->placeholder('header_metas', $this->view->callChildren('layout/header_metas', array('meta_title' => $category_info['meta_title'] ? $category_info['meta_title'] : $category_info['title'], 'meta_description' => $category_info['meta_description'] ? $category_info['meta_description'] : Helper_Config::get('meta_description'), 'meta_keywords' => $category_info['meta_keywords'] ? $category_info['meta_keywords'] : Helper_Config::get('meta_keywords'), 'site_logo' => $category_logo))); //call header and footer childrens $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); }
public function indexAction() { $request = $this->getRequest(); if ($request->getPost('send_comment') == 1) { if (JO_Session::get('user[user_id]')) { $this->forward('pin', 'v2addComment'); } else { exit; } } $pin_id = $request->getRequest('pin_id'); if (JO_Registry::get('isMobile')) { if ($request->isXmlHttpRequest()) { $this->noViewRenderer(true); $this->indexHelper(); } $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); } else { if (Helper_Config::get('config_disable_js')) { $return = $this->indexHelper(true); if ($return['template'] == 'error') { $this->forward('error', 'error404'); } foreach ($return as $key => $val) { $this->view->{$key} = $val; } $template = new Helper_Tmpl($return['template'], $return); $this->view->result_data = $template->render($return['template']); $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); } else { //if get url or F5 load index pin's and open box if (!$request->isXmlHttpRequest()) { $request->setParams('open_from_pin_detail_page', $pin_id); $this->forward('index', 'index'); } elseif ($request->getParam('callback') == 'Pins.getPins') { $this->forward('index', 'index'); } $this->indexHelper(); } } }
public function indexAction() { $request = $this->getRequest(); $source_id = $request->getRequest('source_id'); $source_info = Model_Source::getSource($source_id); if (!$source_info) { $this->forward('error', 'error404'); } $this->getLayout()->meta_title = $source_info['source']; $this->view->source = $source_info; /*//get pins data if($request->isXmlHttpRequest()) { $this->forward('source', 'getPins'); }*/ ///// get pins $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { //get pins data if ($request->isXmlHttpRequest()) { $this->forward('source', 'getPins'); } } else { if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward('source', 'getPins'); } $pins = (array) $this->getPinsAction(true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } //call header and footer childrens $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); }
public function followingAction() { $request = $this->getRequest(); $user_data = $this->profileHelp(); $this->setViewChange('profile'); $this->view->active = 'following'; $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } /*//get pins data if($request->isXmlHttpRequest()) { $this->forward('users', 'getFollowing', $user_data); }*/ ///// get pins $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { //get pins data if ($request->isXmlHttpRequest()) { $this->forward('users', 'getFollowing', $user_data); } } else { if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward('users', 'getFollowing', $user_data); } $pins = (array) $this->getFollowingAction($user_data, true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); }
public function indexAction() { $request = $this->getRequest(); $board_id = $request->getRequest('board_id'); $user_id = $request->getRequest('user_id'); $board_info = new Model_Boards_Board($board_id); if (!$board_info->count()) { $this->forward('error', 'error404'); } if (!Helper_Config::get('config_board_description_enable')) { $board_info['board_description'] = false; } $board_users_allow = array_filter(explode(',', $board_info['board_users_allow'])); $board_users = array_merge(array($board_info['user_user_id']), array_filter($board_users_allow)); if (!$board_info['board_public'] && !in_array(JO_Session::get('user[user_id]'), $board_users)) { $this->forward('error', 'error404'); } if (!$board_info['board_category_id'] && JO_Session::get('user[user_id]') == $board_info['user_user_id']) { JO_Registry::set('board_category_change', $board_info); } $this->view->board_users = array(); foreach ($board_users as $user_id) { $user_info = new Model_Users_User($user_id); if ($user_info->count()) { $user_avatars = Helper_Uploadimages::userAvatars($user_info); $this->view->board_users[] = array('fullname' => $user_info['fullname'], 'avatars' => $user_avatars, 'href' => WM_Router::create($request->getBaseUrl() . '?controller=users&action=profile&user_id=' . $user_info['user_id'])); } } ///disable follow board for board users $this->view->is_enable_follow = JO_Session::get('user[user_id]'); //if(in_array(JO_Session::get('user[user_id]'), $board_users)) { if (JO_Session::get('user[user_id]') == $board_info['board_user_id']) { $this->view->is_enable_follow = false; } /* v2.2 */ if (Helper_Config::get('config_enable_follow_private_profile') && !$board_info['user_enable_follow']) { $this->view->is_enable_follow = false; } /* v2.2 */ if ($this->view->is_enable_follow) { $this->view->follow = WM_Router::create($request->getBaseUrl() . '?controller=boards&action=follow&user_id=' . $board_info['user_user_id'] . '&board_id=' . $board_info['board_board_id']); } else { $this->view->follow = false; } //enable edit for board user $board_info['edit'] = false; if (JO_Session::get('user[user_id]') == $board_info['user_user_id']) { $board_info['edit'] = WM_Router::create($request->getBaseUrl() . '?controller=boards&action=edit&user_id=' . $board_info['user_user_id'] . '&board_id=' . $board_info['board_board_id']); } // board url $this->view->board_url = WM_Router::create($request->getBaseUrl() . '?controller=boards&action=view&user_id=' . $board_info['board_user_id'] . '&board_id=' . $board_info['board_board_id']); $this->view->board = $board_info; $this->getLayout()->placeholder('title', $board_info['board_title']); JO_Layout::getInstance()->placeholder('header_metas', $this->view->callChildren('boards/header_metas', $board_info)); /*//get pins data if($request->isXmlHttpRequest()) { $this->forward('boards', 'getPins', $board_info); }*/ ///// get pins $page = (int) $request->getRequest('page'); if ($page < 1) { $page = 1; } if ($request->getQuery('ignoreDisabled') == 'true') { Helper_Config::set('config_disable_js', 0); } $this->view->result_data = ''; if (!Helper_Config::get('config_disable_js')) { //get pins data if ($request->isXmlHttpRequest()) { $this->forward('boards', 'getPins', $board_info); } } else { if ($page > 1 && $request->isXmlHttpRequest()) { $this->forward('boards', 'getPins', $board_info); } $pins = (array) $this->getPinsAction($board_info, true); foreach ($pins as $pin) { $template = new Helper_Tmpl($pin['template'], $pin); $this->view->result_data .= $template->render($pin['template']); } } //==== FEED ====// $_route_ = $request->getParam('_route_'); $_route_parts = explode('/', $_route_); if (isset($_route_parts[2]) && $_route_parts[2] == 'feed') { $this->forward('boards', 'feed', array('view' => $this->view)); } //call header and footer childrens $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part'); //update count view Model_Boards::updateViewed($board_id); }