function modify_authd_post()
 {
     // Validation Rules
     $this->form_validation->set_rules('address', 'Address', 'required');
     $this->form_validation->set_rules('title', 'Title', 'required');
     $this->form_validation->set_rules('locality', 'City', 'required');
     // Passes Validation
     if ($this->form_validation->run() == true) {
         $content = $this->social_igniter->get_content($this->get('id'));
         // Access Rules
         //$this->social_auth->has_access_to_modify($this->input->post('type'), $this->get('id') $this->oauth_user_id);
         $content_data = array('content_id' => $this->get('id'), 'parent_id' => $this->input->post('parent_id'), 'category_id' => $this->input->post('category_id'), 'order' => $this->input->post('order'), 'title' => $this->input->post('title'), 'title_url' => form_title_url($this->input->post('title'), $this->input->post('title_url'), $content->title_url), 'content' => $this->input->post('content'), 'details' => $this->input->post('details'), 'access' => $this->input->post('access'), 'comments_allow' => $this->input->post('comments_allow'), 'geo_lat' => $this->input->post('geo_lat'), 'geo_long' => $this->input->post('geo_long'), 'viewed' => 'Y', 'approval' => 'Y', 'status' => form_submit_publish($this->input->post('status')));
         $activity_data = array('title' => $this->input->post('title'), 'address' => $this->input->post('address'), 'locality' => $this->input->post('locality'), 'region' => $this->input->post('region'), 'geo_lat' => $this->input->post('geo_lat'), 'geo_long' => $this->input->post('geo_long'));
         // Update
         $update = $this->social_igniter->update_content($content_data, $this->oauth_user_id, $activity_data);
         if ($update) {
             // Process Tags
             if ($this->input->post('tags')) {
                 $this->social_tools->process_tags($this->input->post('tags'), $content->content_id);
             }
             // Add Place
             $place_data = array('content_id' => $content->content_id, 'address' => $this->input->post('address'), 'district' => $this->input->post('district'), 'locality' => $this->input->post('locality'), 'region' => $this->input->post('region'), 'country' => $this->input->post('country'), 'postal' => $this->input->post('postal'));
             $place = $this->social_tools->update_place($place_data);
             $message = array('status' => 'success', 'message' => 'Awesome, we updated your place', 'data' => $update, 'place' => $place_data);
         } else {
             $message = array('status' => 'error', 'message' => 'Oops, we were unable to update this place');
         }
     } else {
         $message = array('status' => 'error', 'message' => validation_errors());
     }
     $this->response($message, 200);
 }
 function modify_authd_post()
 {
     $content = $this->social_tools->get_tag($this->get('id'));
     // Access Rules
     //$this->social_auth->has_access_to_modify($this->input->post('type'), $this->get('id') $this->oauth_user_id);
     $viewed = 'Y';
     $approval = 'A';
     $content_data = array('parent_id' => $this->input->post('parent_id'), 'access' => $this->input->post('access'), 'category' => $this->input->post('category'), 'category_url' => form_title_url($this->input->post('title'), $this->input->post('title_url'), $content->title_url), 'content' => $this->input->post('content'), 'details' => $this->input->post('details'), 'viewed' => $viewed, 'approval' => $approval);
     // Insert
     $update = $this->social_tools->update_tag($this->get('id'), $tag_data);
     if ($update) {
         $message = array('status' => 'success', 'message' => 'Awesome, we updated your ' . $this->input->post('type'), 'data' => $update);
     } else {
         $message = array('status' => 'error', 'message' => 'Oops, we were unable to post your ' . $this->input->post('type'));
     }
     $this->response($message, 200);
 }
Exemple #3
0
 function modify_authd_post()
 {
     $content = $this->social_igniter->get_content($this->get('id'));
     // Access Rules
     //$this->social_auth->has_access_to_modify($this->input->post('type'), $this->get('id') $this->oauth_user_id);
     $content_data = array('content_id' => $this->get('id'), 'parent_id' => $this->input->post('parent_id'), 'category_id' => $this->input->post('category_id'), 'order' => $this->input->post('order'), 'title' => $this->input->post('title'), 'title_url' => form_title_url($this->input->post('title'), $this->input->post('title_url'), $content->title_url), 'content' => $this->input->post('content'), 'details' => $this->input->post('details'), 'canonical' => $this->input->post('canonical'), 'access' => $this->input->post('access'), 'comments_allow' => $this->input->post('comments_allow'), 'geo_lat' => $this->input->post('geo_lat'), 'geo_long' => $this->input->post('geo_long'), 'viewed' => 'Y', 'approval' => 'Y', 'status' => form_submit_publish($this->input->post('status')));
     // Insert
     $update = $this->social_igniter->update_content($content_data, $this->oauth_user_id);
     if ($update) {
         // Process Tags
         if ($this->input->post('tags')) {
             $this->social_tools->process_tags($this->input->post('tags'), $this->get('id'));
         }
         $message = array('status' => 'success', 'message' => 'Awesome, we updated your ' . $this->input->post('type'), 'data' => $update);
     } else {
         $message = array('status' => 'error', 'message' => 'Oops, we were unable to post your ' . $this->input->post('type'));
     }
     $this->response($message, 200);
 }
 function modify_authd_post()
 {
     if ($category = $this->social_tools->get_category($this->get('id'))) {
         // Access Rules
         //$this->social_auth->has_access_to_modify($this->input->post('type'), $this->get('id') $this->oauth_user_id);
         $viewed = 'Y';
         $approval = 'A';
         $category_data = array('parent_id' => $this->input->post('parent_id'), 'access' => $this->input->post('access'), 'category' => $this->input->post('category'), 'category_url' => form_title_url($this->input->post('category'), $this->input->post('category_url'), $category->category_url), 'description' => $this->input->post('description'), 'details' => $this->input->post('details'));
         // Update
         if ($update = $this->social_tools->update_category($this->get('id'), $category_data, $this->oauth_user_id)) {
             $message = array('status' => 'success', 'message' => 'Awesome, we updated your category', 'data' => $update);
         } else {
             $message = array('status' => 'error', 'message' => 'Oops, we were unable to save your category update');
         }
     } else {
         $message = array('status' => 'error', 'message' => 'Damn that category does not update');
     }
     $this->response($message, 200);
 }
 /**
  * install_content function.
  * 
  * @access public
  * @param mixed $app_content
  * @param mixed $user_id
  * @return void
  */
 function install_content($app_content, $user_id)
 {
     $result = FALSE;
     if ($app_content) {
         foreach ($app_content as $content) {
             $content['site_id'] = config_item('site_id');
             $content['user_id'] = $user_id;
             $content['title_url'] = form_title_url($content['title'], $content['title_url']);
             $content['viewed'] = 'N';
             $content['approval'] = 'Y';
             $content['status'] = 'P';
             // Insert
             $add_content = $this->ci->social_igniter->add_content($content);
             $result .= $content['title'] . ' added';
         }
     }
     return $result;
 }