Пример #1
0
 public function indexAction()
 {
     $this->view->title = "Pages";
     //echo "sdfdfsdfsdf";exit;
     $this->view->headTitle(" - " . $this->view->title);
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $model = new Application_Model_Page();
     $page = $this->_getParam('page', 1);
     $fixedPages = implode(",", $this->fixedOtherCMSPages);
     $where = "id IS NOT NULL AND identifire NOT IN ('advice', 'work-study-volunteer')";
     $order = "addedon ASC";
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->fixedPages = $this->fixedPages;
 }
Пример #2
0
 public function indexAction()
 {
     $where = "id IS NOT NULL";
     $model = new Application_Model_Content();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $type = "module";
     if ($this->_getParam('type') != "") {
         $type = $this->_getParam('type');
     }
     $this->view->type = $type;
     if ($type == "logout") {
         $where .= " AND id IN ({$this->logoutTopContents})";
     } else {
         if ($type == "login") {
             $where .= " AND id IN ({$this->loginTopContents})";
         } else {
             $where .= " AND id IN ({$this->loginModules})";
         }
     }
     //echo "ssss=".$where;exit;
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, "weight ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->fixedTextMod = $this->fixedTextMod;
     $this->view->fixedModules = $this->fixedModules;
 }
Пример #3
0
 public function indexAction()
 {
     $this->view->type = $type = $this->_getParam('type', "other");
     $this->view->title = ucfirst($type) . " Category ";
     //change title for Journals
     if ($type == "blog") {
         $this->view->title = "Journal Category ";
     }
     $this->view->headTitle(" -  " . $this->view->title);
     $model = new Application_Model_Category();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $where = "status!='deleted' AND type='{$type}'";
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, "weight ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     if (isset($_SESSION['errorMsg'])) {
         $this->view->msg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
 }
 public function indexAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($settings, $page, $page_size);
     $this->view->total_settings = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
Пример #5
0
 public function indexAction()
 {
     $params['q'] = $this->_getParam('q');
     if (isset($params['q']) && $params['q'] != "" && $params['q'] != "Search Gap Daemon") {
         $this->view->searchtext = $searchtext = $params['q'];
         $settings = new Admin_Model_GlobalSettings();
         $page_size = $settings->settingValue('pagination_size');
         //$page_size				= 	1;
         $modelList = new Application_Model_SearchView();
         $searchData = $modelList->searchResult($searchtext);
         $page = $this->_getParam('page', 1);
         $pageObj = new Base_Paginator();
         $paginator = $pageObj->fetchPageDataResult($searchData, $page, $page_size);
         if ($pageObj->getTotalCount() > 0) {
             $this->view->total = $pageObj->getTotalCount();
             $this->view->paginator = $paginator;
         } else {
             $this->view->message = "No result found for this keyword.";
         }
     } else {
         $this->view->message = "Missing search parameters.";
     }
 }
Пример #6
0
 public function indexAction()
 {
     $this->view->title = "Url Rewrite Management";
     $this->view->headTitle(" - " . $this->view->title);
     $model = new Application_Model_SeoUrl();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
Пример #7
0
 /**
  * The default action - show the home page
  */
 public function viewAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $userModel = new Application_Model_UserLevel();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($userModel, $page, $page_size);
     $this->view->total_users = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $request = $this->getRequest();
     //$request->getControllerName();
 }
Пример #8
0
 public function indexAction()
 {
     $this->view->title = "Region";
     $this->view->headTitle($this->view->title);
     $model = new Application_Model_Region();
     //$settings=new Admin_Model_GlobalSettings();
     //$page_size=$settings->settingValue('pagination_size');
     $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, NULL, "name ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
Пример #9
0
 public function myPhotosAction()
 {
     $userNs = new Zend_Session_Namespace('members');
     $userId = $userNs->userId;
     $albumM = new Album_Model_UserAlbum();
     $where = "user_id = {$userId}";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($albumM, $page, $page_size, $where);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->paginator = $paginator;
 }
Пример #10
0
 public function indexAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $model = new Application_Model_Widgets();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, NULL, "weight DESC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->errorMsg = "";
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     }
 }
Пример #11
0
 public function abuseReportAction()
 {
     $sSQL = "SELECT ra.id, ra.item_id, ra.item_type, ra.addedon";
     $sSQL .= " ,u.email, u.username, u.first_name, u.last_name, u.sex";
     $sSQL .= " FROM report_abuse AS ra";
     $sSQL .= " JOIN user AS u ON u.id = ra.user_id";
     $sSQL .= " WHERE u.status!='deleted' AND ra.status=1";
     $sSQL .= " ORDER BY ra.addedon DESC";
     //$settings	=	new Admin_Model_GlobalSettings();
     //$page_size	=	$settings->settingValue('pagination_size');
     $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageDataRaw($sSQL, $page, $page_size);
     //set view variables
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
 }
Пример #12
0
 public function albumPhotosAction()
 {
     $albumId = $this->_getParam('id');
     $usersNs = new Zend_Session_Namespace("members");
     $userId = $usersNs->userId;
     $this->view->userId = $userId;
     $this->view->albumId = $albumId;
     $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
     $objModelAlbum = new Album_Model_Album();
     $objModelSetting = new Admin_Model_GlobalSettings();
     $objModelVote = new Application_Model_Vote();
     $objPage = new Base_Paginator();
     /*---------------- Check Album Owner ----------------*/
     $valAlbum = $objModelAlbum->find($albumId);
     $albumOwnerId = $valAlbum->getUserId();
     if ($albumOwnerId != $userId) {
         $objModelUser = new Application_Model_User();
         $valUser = $objModelUser->find($albumOwnerId);
         $albumOwnerUserName = $valUser->getUsername();
         $redirectUrl = "/profile/album-photos/username/" . $albumOwnerUserName . "/id/" . $albumId;
         $this->_redirect($redirectUrl);
     }
     /*-------------- END Check Album Owner --------*/
     /*----------- GET ALBUM WITH PAGINATION VALUE --------------------*/
     $pageSize = $objModelSetting->settingValue('album_photo_page_size');
     $page = $this->_getParam('page', 1);
     $whereAlbumPhoto = "album_id='{$albumId}' AND user_id='{$userId}' AND status=1";
     $orderAlbumPhoto = "addedon DESC";
     $arrAlbumPhoto = $objPage->fetchPageData($objModelAlbumPhoto, $page, $pageSize, $whereAlbumPhoto, $orderAlbumPhoto);
     $this->view->totalAlbumPhoto = $objPage->getTotalCount();
     $this->view->arrAlbumPhoto = $arrAlbumPhoto;
     /*------------------- GET ALBUM DETAIL --------------------------*/
     $whereAlbum = "id='{$albumId}'";
     $arrAlbum = $objModelAlbum->fetchAll($whereAlbum);
     $this->view->arrAlbum = $arrAlbum;
     $this->view->myLatitude = $latitude = $arrAlbum[0]->latitude;
     $this->view->myLongitude = $longitude = $arrAlbum[0]->longitude;
     /*------------------- GET TAG OF ALBUM -------------------------*/
     $strTag = $this->getAlbumTags($albumId);
     $this->view->strTag = $strTag;
     /*------------------ CHECK LIKED-UNLIKED ALBUM ------------------*/
     $whereVote = "item_type='album' AND item_id='{$albumId}' AND user_id='{$userId}' AND vote='1'";
     $arrVote = $objModelVote->fetchAll($whereVote);
     if (count($arrVote) > 0) {
         $this->view->numVote = 1;
     } else {
         $this->view->numVote = 0;
     }
     $this->view->likeSrcUrl = Zend_Registry::get('siteurl') . "%2Falbum%2Fmy-photos%2Falbum-photos%2Fid%2F" . $albumId;
 }
Пример #13
0
 /**
  * @Created By : Mahipal Singh Adhikari
  * @Created On : 19-Jan-2011
  * @Description: Select all users subscribed for newsletter service
  */
 public function newsletterUsersAction()
 {
     $sSQL = "SELECT u.id, u.email, u.username, u.first_name, u.last_name, u.sex, s.addedon";
     $sSQL .= " FROM user AS u";
     $sSQL .= " JOIN subscribe AS s ON s.user_id=u.id";
     $sSQL .= " WHERE u.status!='deleted' AND s.status=1";
     $sSQL .= " ORDER BY s.addedon DESC";
     //$settings	=	new Admin_Model_GlobalSettings();
     //$page_size	=	$settings->settingValue('pagination_size');
     $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageDataRaw($sSQL, $page, $page_size);
     //$paginator	=	$pageObj->fetchPageData($model,$page,$page_size, $where);
     //set view variables
     $this->view->total_users = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
 }
Пример #14
0
 public function indexAction()
 {
     $this->view->title = "Articles";
     $this->view->headTitle(" - " . $this->view->title);
     //create search form
     $form = new Admin_Form_SearchAdvice();
     $elements = $form->getElements();
     $form->clearDecorators();
     foreach ($elements as $element) {
         $element->removeDecorator('label');
         $element->removeDecorator('td');
         $element->removeDecorator('tr');
         $element->removeDecorator('row');
         $element->removeDecorator('HtmlTag');
         $element->removeDecorator('placement');
         $element->removeDecorator('data');
     }
     //search Articles
     $where = "id IS NOT NULL";
     $order = "addedon DESC";
     $param = $this->_getParam('submit');
     if (isset($param) && $param == "Search") {
         $linkArray = array();
         if ($this->getRequest()->isPost()) {
             $params = $this->getRequest()->getPost();
         } else {
             $params = $this->getRequest()->getParams();
         }
         foreach ($params as $k => $v) {
             if ($k != "page" && $k != "module" && $k != "controller" && $k != "action" && $v != "") {
                 $linkArray[$k] = $v;
             }
         }
         $this->view->linkArray = $linkArray;
         $title = $this->_getParam('title');
         $category_id = $this->_getParam('category_id');
         $status = $this->_getParam('status');
         //search by title
         if ($title != "") {
             $where .= " AND title LIKE '%{$title}%'";
         }
         //search by category
         if ($category_id != "") {
             $where .= " AND category_id = {$category_id}";
         }
         //search by status
         if ($status != "") {
             $where .= " AND status = '{$status}'";
         }
         $options = array("title" => $title, "category_id" => $category_id, "status" => $status);
         $form->populate($options);
     }
     $this->view->form = $form;
     //$settings	=	new Admin_Model_GlobalSettings();
     //$page_size	=	$settings->settingValue('pagination_size');
     $this->view->page_size = $page_size = $this->_getParam('page_size', 25);
     $model = new Application_Model_Advice();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
 }
Пример #15
0
 /**
  * @Created By	: Mahipal Singh Adhikari
  * @Created On	: 10-Mar-2011
  * @Description	: Display listing of countries with paging and searching functionality
  */
 public function manageCountryAction()
 {
     $where = "id IS NOT NULL";
     $order = "name ASC";
     //create search form
     $form = new Admin_Form_SearchCountry();
     $elements = $form->getElements();
     $form->clearDecorators();
     foreach ($elements as $element) {
         $element->removeDecorator('label');
         $element->removeDecorator('td');
         $element->removeDecorator('tr');
         $element->removeDecorator('row');
         $element->removeDecorator('HtmlTag');
         $element->removeDecorator('placement');
         $element->removeDecorator('data');
     }
     $this->view->form = $form;
     $param = $this->_getParam('submit');
     if (isset($param) && $param == "Search") {
         $linkArray = array();
         if ($this->getRequest()->isPost()) {
             $params = $this->getRequest()->getPost();
         } else {
             $params = $this->getRequest()->getParams();
         }
         foreach ($params as $k => $v) {
             if ($k != "page" && $k != "module" && $k != "controller" && $k != "action" && $v != "") {
                 $linkArray[$k] = $v;
             }
         }
         $this->view->linkArray = $linkArray;
         $name = $this->_getParam('name');
         $continent_id = $this->_getParam('continent_id');
         //search by name
         if ($name != "") {
             $country = ucfirst($name);
             $where .= " AND name LIKE '%{$country}%'";
         }
         //search by continent
         if ($continent_id != "") {
             $where .= " AND continent_id={$continent_id}";
         }
         $options = array("name" => $name, "continent_id" => $continent_id);
         $form->populate($options);
     }
     $model = new Application_Model_Country();
     $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->page_size = $page_size;
 }
Пример #16
0
 public function userLikeThisAction()
 {
     $this->_helper->layout->setLayout('journal-layout-2column');
     //$item_id = $this->_getParam("blog_id");
     $item_id = $this->_getParam("item_id");
     $item_type = $this->_getParam("type");
     //$userNs = new Zend_Session_Namespace('members');
     //$this->view->userId = $userNs->userId;
     $item = false;
     $itemTypeText = "";
     if ($item_type != "") {
         if ($item_type == 'blog') {
             $blogM = new Application_Model_Blog();
             $this->view->blog = $item = $blogM->find($item_id);
             $itemTypeText = "Journal Post";
         }
         if ($item_type == 'status_comment' || $item_type == 'blog_comment') {
             $commentM = new Application_Model_Comment();
             $item = $commentM->find($item_id);
             $itemTypeText = "Comment";
             $item_type = "comment";
         }
         if ($item_type == 'status') {
             $wallM = new Application_Model_Wall();
             $item = $wallM->find($item_id);
             $itemTypeText = "Wall Post";
         }
         $this->view->itemTypeText = $itemTypeText;
     }
     //if item is not exists then redirect to Journal home page
     if (false === $item) {
         $this->_helper->redirector()->gotoUrl('/journal/index/');
         exit;
     }
     //Now get all positive votes of item
     //$where		= "item_id = $item_id AND vote=1 AND item_type='blog'";
     $where = "item_id = {$item_id} AND vote=1";
     if ($item_type == 'comment') {
         $where .= " AND (item_type='status_comment' OR item_type='blog_comment')";
     } else {
         $where .= " AND item_type='{$item_type}'";
     }
     $voteM = new Application_Model_Vote();
     $rawdata = $voteM->fetchAll($where);
     //Get all users ID voted on an item
     if (false !== $rawdata) {
         $user_array = array();
         foreach ($rawdata as $row) {
             $user_array[] = $row->getUserId();
         }
     }
     //get all users information from above User Ids
     $this->view->totalUsers = 0;
     if (count($user_array) > 0) {
         $usrstr = implode(",", $user_array);
         $userM = new Application_Model_User();
         $whereuser = "******";
         $userData = $userM->fetchAll($whereuser, "first_name ASC");
         $this->view->userData = $userData;
         $settings = new Admin_Model_GlobalSettings();
         $page_size = $settings->settingValue('pagination_size');
         //$page_size = 1;
         $page = $this->_getParam('page', 1);
         $pageObj = new Base_Paginator();
         $paginator = $pageObj->fetchPageData($userM, $page, $page_size, $whereuser);
         $this->view->totalUsers = $pageObj->getTotalCount();
         $this->view->paginator = $paginator;
     }
 }
Пример #17
0
 public function albumPhotosAction()
 {
     $albumId = $this->_getParam('id');
     $usersNs = new Zend_Session_Namespace("members");
     $userId = $usersNs->userId;
     $this->view->userId = $userId;
     $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
     $objModelAlbum = new Album_Model_Album();
     $objModelSetting = new Admin_Model_GlobalSettings();
     $objModelVote = new Application_Model_Vote();
     $objPage = new Base_Paginator();
     /*----------- GET ALBUM WITH PAGINATION VALUE --------------------*/
     $pageSize = $objModelSetting->settingValue('album_photo_page_size');
     $page = $this->_getParam('page', 1);
     $whereAlbumPhoto = "album_id='{$albumId}' AND user_id='{$userId}' AND status=1";
     $orderAlbumPhoto = "addedon DESC";
     $arrAlbumPhoto = $objPage->fetchPageData($objModelAlbumPhoto, $page, $pageSize, $whereAlbumPhoto, $orderAlbumPhoto);
     $this->view->totalAlbumPhoto = $objPage->getTotalCount();
     $this->view->arrAlbumPhoto = $arrAlbumPhoto;
     /*------------------- GET ALBUM DETAIL --------------------------*/
     $whereAlbum = "id='{$albumId}'";
     $arrAlbum = $objModelAlbum->fetchAll($whereAlbum);
     $this->view->arrAlbum = $arrAlbum;
     $this->view->myLatitude = $latitude = $arrAlbum[0]->latitude;
     $this->view->myLongitude = $longitude = $arrAlbum[0]->longitude;
     /*------------------- GET TAG OF ALBUM -------------------------*/
     $strTag = $this->getAlbumTags($albumId);
     $this->view->strTag = $strTag;
     /*------------------ CHECK LIKED-UNLIKED ALBUM ------------------*/
     $whereVote = "item_type='album' AND item_id='{$albumId}' AND user_id='{$userId}' AND vote='1'";
     $arrVote = $objModelVote->fetchAll($whereVote);
     if (count($arrVote) > 0) {
         $this->view->numVote = 1;
     } else {
         $this->view->numVote = 0;
     }
 }
 public function friendsAction()
 {
     $username = $this->_getParam('username');
     $this->view->userName = $username;
     $user = $this->getLeftPanel($username);
     $this->view->userObject = $user;
     $userM = new Application_Model_User();
     //Redirect user if not active, added by Mahipal Adhikari on 3-jan-2011
     if (false === $userM->checkUserActiveStatus($user->getId())) {
         $this->_helper->redirector('index', 'index');
     }
     $userNs = new Zend_Session_Namespace("members");
     $loggedInUser = $userNs->userId;
     $this->view->loggedInUser = $loggedInUser;
     /************************ Check user privacy settings START *****************/
     $loggedin_id = $loggedInUser;
     $user_id = $user->getId();
     //echo "user id=".$user_id." and Login id=".$loggedin_id;
     //now check user profile privacy permissions
     $view_profile = false;
     $userObj = new Application_Model_User();
     $view_profile = $userObj->checkUserPrivacySettings($user_id, $loggedin_id, 6);
     //if logged in user has no permission then display error page
     if (!$view_profile) {
         $this->view->user_id = $user->getId();
         $this->render('error');
     }
     /************************ Check user privacy settings END *****************/
     $where = "user_id='{$user->getId()}' AND status='accept'";
     $params = $this->getrequest()->getParams();
     $extra = array();
     //search by Connection Type
     if (isset($params['searchkey']) && $params['searchkey'] != '') {
         $key = $params['searchkey'];
         $this->view->ctype = $key;
         $where .= " AND connection_type = '{$key}'";
         $extra['searchkey'] = $key;
     }
     //search by Name
     if (isset($params['searchname']) && $params['searchname'] != '' && $params['searchname'] != 'Search Names') {
         $userarray[] = -1;
         $searchname = trim($params['searchname']);
         $this->view->searchname = $searchname;
         $user_where_sql = "";
         $user_where_sql .= " CONCAT(first_name,' ',last_name ) LIKE '%{$searchname}%' || username LIKE '%{$searchname}%'";
         $userdata = $userM->fetchAll($user_where_sql);
         if (count($userdata) > 0) {
             foreach ($userdata as $userrow) {
                 $userarray[] = $userrow->getId();
             }
         }
         $userstr = implode(',', $userarray);
         $where .= " AND friend_id IN ({$userstr})";
         $extra['searchname'] = $searchname;
         //set message if no record found
         $this->view->no_record = "Try another search to find what you're looking for.";
     }
     $friendM = new Application_Model_Friend();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('friend_page_size');
     $this->view->page_size = $page_size;
     //$page_size = 1;
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($friendM, $page, $page_size, $where);
     $this->view->totalFriends = $pageObj->getTotalCount();
     //$this->view->paginator=$paginator;
     $data = $friendM->fetchAll($where, "addedon ASC", $page_size);
     $this->view->data = $data;
 }
Пример #19
0
 /**
  * @Created By : Mahipal Singh Adhikari
  * @Created On : 22-Feb-2011
  * @Description: Display blog tags
  */
 public function tagsAction()
 {
     //$settings	=	new Admin_Model_GlobalSettings();
     //$page_size	=	$settings->settingValue('pagination_size');
     $page_size = $this->_getParam('page_size', 25);
     $model = new Application_Model_Tags();
     $pageObj = new Base_Paginator();
     $page = $this->_getParam('page', 1);
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, null, "tag ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     //set error message
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
 }
Пример #20
0
 public function allFriendsAction()
 {
     $userNs = new Zend_Session_Namespace('members');
     $userId = $userNs->userId;
     $where = "1=1 AND id!='{$userId}'";
     $where .= " AND status = 'active'";
     $name = "";
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         $name = $params['nickname'];
     }
     if ($name != "") {
         //$where .= " AND (username LIKE '%{$name}%' OR first_name LIKE '%{$name}%' OR  last_name LIKE '%{$name}%')";
         //$where .= " AND (CONCAT(first_name,' ',last_name ) LIKE '%$name%' OR username LIKE '%$name%')";
         $where .= " AND (CONCAT(first_name,' ',last_name ) LIKE '%{$name}%' )";
         $this->view->param = array('nickname' => $name);
     }
     $friendM = new Application_Model_Friend();
     $frienddata = $friendM->fetchAll("user_id = {$userId} AND status = 'accept'");
     if (count($frienddata) > 0) {
         foreach ($frienddata as $friend) {
             $friendids[] = $friend->getFriendId();
         }
         $friend_str = implode(',', $friendids);
         $where .= " AND id NOT IN({$friend_str})";
     }
     $userM = new Application_Model_User();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($userM, $page, $page_size, $where);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
 }
Пример #21
0
 public function albumPhotosAction()
 {
     $objModelUser = new Application_Model_User();
     $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
     $objModelAlbum = new Album_Model_Album();
     $objModelSetting = new Admin_Model_GlobalSettings();
     $objModelVote = new Application_Model_Vote();
     $objPage = new Base_Paginator();
     /*---------------------------------------------*/
     $username = $this->_getParam('username');
     $user = $this->getLeftPanel($username);
     $this->view->userName = $username;
     $this->view->userObject = $user;
     $userRecord = $objModelUser->getDataByUsername($username);
     $userId = $userRecord->getId();
     $userNs = new Zend_Session_Namespace('members');
     $this->view->loggedInUserId = $loggedInUserId = $userNs->userId;
     $this->view->userFullName = $username;
     /*------------------------ CHECK RELATION -------------*/
     $relationCondition = $this->checkRelation($userId, $loggedInUserId);
     $this->view->relationCondition = $relationCondition;
     /*-------------------------------------------------*/
     $albumId = $this->_getParam('id');
     $this->view->userId = $userId;
     $this->view->albumId = $albumId;
     /*----------- GET ALBUM WITH PAGINATION VALUE --------------------*/
     $pageSize = $objModelSetting->settingValue('album_photo_page_size');
     $page = $this->_getParam('page', 1);
     $whereAlbumPhoto = "album_id='{$albumId}' AND user_id='{$userId}' AND status=1 AND ({$relationCondition})";
     $orderAlbumPhoto = "addedon DESC";
     $arrAlbumPhoto = $objPage->fetchPageData($objModelAlbumPhoto, $page, $pageSize, $whereAlbumPhoto, $orderAlbumPhoto);
     $this->view->totalAlbumPhoto = $objPage->getTotalCount();
     $this->view->arrAlbumPhoto = $arrAlbumPhoto;
     /*------------------- GET ALBUM DETAIL --------------------------*/
     $whereAlbum = "id='{$albumId}'";
     $arrAlbum = $objModelAlbum->fetchAll($whereAlbum);
     $this->view->arrAlbum = $arrAlbum;
     $this->view->myLatitude = $latitude = $arrAlbum[0]->latitude;
     $this->view->myLongitude = $longitude = $arrAlbum[0]->longitude;
     /*------------------- GET TAG OF ALBUM -------------------------*/
     $strTag = $this->getAlbumTags($albumId);
     $this->view->strTag = $strTag;
     /*------------------ CHECK LIKED-UNLIKED ALBUM ------------------*/
     $whereVote = "item_type='album' AND item_id='{$albumId}' AND user_id='{$loggedInUserId}' AND vote='1'";
     $arrVote = $objModelVote->fetchAll($whereVote);
     if (count($arrVote) > 0) {
         $this->view->numVote = 1;
     } else {
         $this->view->numVote = 0;
     }
     $this->view->likeSrcUrl = Zend_Registry::get('siteurl') . "%2Fprofile%2Falbum-photos%2Fusername%2F" . $username . "%2Fid%2F" . $albumId;
 }
 public function detailAction()
 {
     $id = $this->_getParam("id");
     $articlesM = new Application_Model_Articles();
     $where = "category_id ={$id} AND status='1'";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $this->view->param = array('id' => $id);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($articlesM, $page, $page_size, $where, "title ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->articles = $paginator;
     $categoryM = new Application_Model_Category();
     $this->view->category = $categoryM->find($id);
 }
Пример #23
0
 /**
  * @Created By : Mahipal Singh Adhikari
  * @Created On : 10-Feb-2011
  * Description : Display advice category details home page and advice listing to that category
  */
 public function categoryAction()
 {
     $params = $this->getRequest()->getParams();
     $category_id = $params["id"];
     //get category detail
     $categoryM = new Application_Model_Category();
     $category = $categoryM->find($category_id);
     if (false !== $category) {
         $this->view->name = $category->getName();
         $this->view->description = $category->getDescription();
         $this->view->param = array('id' => $category_id);
     }
     //display advices in right block associated with this category
     $this->view->category_id = $category_id;
     //now get advices associsted with category
     $adviceM = new Application_Model_Advice();
     $where = "category_id={$category_id} AND status='1'";
     $order = "addedon DESC";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     //$page_size	=	1;
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($adviceM, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->advices = $paginator;
 }