public function indexAction()
 {
     // action body
     if (isset($this->authIdentity)) {
         $NotificationModel = new Application_Model_Notification($this->registry->DB);
         $limit = $this->getRequest()->getParam('limit');
         $from = $this->getRequest()->getParam('from');
         if (empty($from) && !(is_int($from) || ctype_digit($from))) {
             $from = 0;
         }
         $this->view->results = $NotificationModel->getNotification($this->authIdentity->userid, $limit, $from);
     }
 }
Пример #2
0
 public function getcountAction()
 {
     if (isset($this->authidentity)) {
         $notificationModel = new Application_Model_Notification($this->registry->DB);
         echo json_encode($notificationModel->getReviewCount($this->authidentity->userid));
     }
 }
Пример #3
0
 public function CreateUserAccount($username = null, $password, $fname = null, $lname = null, $email, $sex = null, $dob, $type = 'user', $fbuser)
 {
     if (!isset($username)) {
         $username = '******' . mt_rand() . "_" . mt_rand();
     }
     if ($this->checkUniqueUserid($username, $email) && strlen($username) >= 6) {
         $ip2c = new Application_Model_ip2c($this->_db);
         $a = array();
         $b = serialize($a);
         if ($sex == 'male') {
             $propic = 1;
         } else {
             $propic = 2;
         }
         if ($type == 'user') {
             $freniz = array('userid' => $username, 'type' => $type, 'url' => $username, 'adminpages' => $b, 'username' => $fname . ' ' . $lname, 'createdipadd' => $ip2c->getIpAdd(), 'propic' => $propic);
             $search = array('userid' => $username, 'username' => $fname . ' ' . $lname, 'type' => 'user');
             $user_info = array('userid' => $username, 'fname' => $fname, 'lname' => $lname, 'dob' => $dob, 'sex' => $sex, 'email' => $email, 'date' => new Zend_Db_Expr('NOW()'), 'musics' => $b, 'books' => $b, 'movies' => $b, 'games' => $b, 'celebrities' => $b, 'other' => $b, 'pinnedpic' => $b, 'sports' => $b, 'playlist' => $b, 'school' => $b, 'college' => $b, 'language' => $b, 'adminpages' => $b, 'employer' => $b, 'url' => $username, 'blocklist' => $b, 'blockedby' => $b, 'reviews' => $b, 'reqfrmme' => $b, 'style' => 'blue-world.css', 'groups' => $b, 'propic' => $propic);
             $apps = array('userid' => $username, 'slambook' => $b, 'diary' => $b, 'inivitation' => $b);
             $a1 = array();
             $b1 = array('post', 'image', 'admire', 'pin', 'video');
             foreach ($b1 as $c1) {
                 $a1[$c1] = array();
             }
             $d1 = serialize($a1);
             $friends_vote = array('userid' => $username, 'friendlist' => $b, 'incomingrequest' => $b, 'sentrequest' => $b, 'vote' => $b, 'voted' => $b);
             $privacy = array('userid' => $username, 'postignore' => $b, 'testyignore' => $b, 'postspeci' => $b, 'testyspeci' => $b, 'blogspeci' => $b, 'posthidden' => $b, 'testyhidden' => $b, 'bloghidden' => $b, 'autoacceptusers' => $d1, 'blockactivityusers' => $d1, 'hidestreams' => $b, 'hideusersstream' => $b, 'staturespeci' => $b, 'staturehidden' => $b, 'postspecificpeople' => $b, 'testyspecificpeople' => $b, 'videospecificpeople' => $b, 'staturespecificpeople' => $b, 'statureignore' => $b, 'albumignore' => $b, 'albumspecificpeople' => $b, 'albumspeci' => $b, 'albumhidden' => $b, 'messagespecificpeople' => $b, 'messageignore' => $b);
         } else {
             $freniz = array('userid' => $username, 'type' => $type, 'url' => $username, 'adminpages' => $b, 'username' => '', 'createdipadd' => $ip2c->getIpAdd(), 'propic' => $propic);
         }
         $userstable = array('userid' => $username, 'pass' => $password, 'email' => $email);
         if ($fbuser) {
             $userstable['facebook'] = $fbuser;
         }
         $notification = array('userid' => $username, 'notifications' => 'a:0:{}');
         $db = $this->_db;
         $this->insert($freniz);
         $userstableModel = new Application_Model_Userstable($db);
         $userstableModel->insert($userstable);
         if ($type == 'user') {
             $user_infoModel = new Application_Model_UserInfo($db);
             $user_infoModel->insert($user_info);
             $appsModel = new Application_Model_Apps($db);
             $appsModel->insert($apps);
             $friends_voteModel = new Application_Model_Friendsvote($db);
             $friends_voteModel->insert($friends_vote);
             $privacyModel = new Application_Model_Privacy($db);
             $privacyModel->insert($privacy);
             $albumModel = new Application_Model_Album($db);
             $profilepicalbum = $this->createAlbumData($username, 'Profile photos');
             $propicid = $albumModel->insert($profilepicalbum);
             $secpicalbum = $this->createAlbumData($username, 'Wallpapers');
             $secpicid = $albumModel->insert($secpicalbum);
             $chartpicalbum = $this->createAlbumData($username, 'Chart photos', true);
             $chartpicid = $albumModel->insert($chartpicalbum);
             $albumids = array('propicalbum' => $propicid, 'secondarypicalbum' => $secpicid);
             $where = "userid='{$username}'";
             $user_infoModel->update($albumids, $where);
             $this->_db->insert('searchtable', $search);
         }
         $notificationModel = new Application_Model_Notification($db);
         $notificationModel->insert($notification);
         return array('status' => "true", 'message' => '', 'un' => $username, 'pass' => $password);
     } else {
         return array('status' => "false", 'message' => "Name already taken. Please choose another one.");
     }
 }