예제 #1
0
 public function getPublications($publicationid)
 {
     $dataPost = $this->input->post();
     $listPubliLoad = array();
     $arrCommentOpen = array();
     if (!empty($dataPost)) {
         $listPubliLoad = $dataPost['data'];
         $arrCommentOpen = isset($dataPost['arrCommentOpen']) ? $dataPost['arrCommentOpen'] : array();
     }
     //var_dump("<pre>",$dataPost);Exit;
     $range = 10;
     $dataUser = $this->session->userdata('user_data');
     $notices = $this->publication->getPublicationId($publicationid);
     $arrPubli = delDupli($notices, 0, $listPubliLoad);
     if (empty($arrPubli)) {
         echo json_encode(array());
         exit;
     }
     $strArr = implode(",", $arrPubli['array']);
     $listPublication = $this->notices->getNoticesAux($strArr);
     $arrTemp = $this->notices->PublicationImage($arrPubli['array']);
     $arrPublicationImg = $arrTemp['rpta'] ? $arrTemp['array'] : array();
     $data = array();
     $arrData = setFormatNotices($arrPubli['complete'], $listPublication);
     $data['publication'] = formatHtml($arrData, $arrPublicationImg, $arrCommentOpen);
     //var_dump("<pre>",$data['publication']);Exit;
     $data['arrId'] = $arrPubli['complete'];
     $data['activityid'] = $arrPubli['useractivity_id'];
     $data['base_url'] = base_url();
     $data['site_url'] = site_url();
     $data['dataUser'] = $dataUser;
     echo json_encode($data);
 }
예제 #2
0
 public function getNewNotices($limit = 0)
 {
     $dataPost = $this->input->post();
     $arrPublication = array(0);
     $maxActivity = 0;
     if (!empty($dataPost)) {
         $arrPublication = isset($dataPost['data']) ? $dataPost['data'] : array();
         $maxActivity = $dataPost['maxActivity'];
         $listPubliLoad = isset($dataPost['arrPublica']) ? $dataPost['arrPublica'] : array();
     }
     //var_dump("<pre>",$arrPublication);Exit;
     $range = 10;
     $dataUser = $this->session->userdata('user_data');
     $userid = $dataUser['userid'];
     $typeNotices = $dataUser['typenotices'];
     if ($typeNotices == 2) {
         $notices = $this->notices->getNotices($userid, 0, $range);
     } else {
         $notices = $this->notices->getAllNotices($userid, 0, $range);
     }
     $arrPubli = delDupli($notices, $maxActivity, $listPubliLoad);
     if (empty($arrPubli)) {
         echo json_encode(array());
         exit;
     }
     $strArr = implode(",", $arrPubli['array']);
     $listPublication = $this->notices->getNoticesAux($strArr);
     $arrTemp = $this->notices->PublicationImage($arrPubli['array']);
     $arrPublicationImg = $arrTemp['rpta'] ? $arrTemp['array'] : array();
     $data = array();
     $arrData = setFormatNotices($arrPubli['complete'], $listPublication);
     $data['publication'] = formatHtml($arrData, $arrPublicationImg, $arrPublication);
     $data['arrId'] = $arrPubli['complete'];
     $data['activityid'] = $arrPubli['useractivity_id'];
     $data['userid'] = $userid;
     $data['base_url'] = base_url();
     $data['site_url'] = site_url();
     echo json_encode($data);
 }