Update a specific forum post (Requries login)(Moderator+)(UNTESTED).

        Parameters:
            post_id (int): Forum topic id.
            body (str): Post content.
552169
def forum_post_update(self, topic_id, body):
        
        params = {'forum_post[body]': body}
        return self._get('forum_posts/{0}.json'.format(topic_id), params,
                         method='PUT', auth=True)
668551
def forum_post_delete(self, post_id):
        
        return self._get('forum_posts/{0}.json'.format(post_id),
                         method='DELETE', auth=True)
374831
def publish(self, topic, *args, **kwargs):
        
        assert topic is not None

        params = {
            "topic": topic,
            "args": args,
            "kwargs": kwargs
        }

        response = self._make_api_call("POST", self.url, json_params=params)
        return response["id"]
498975
def post(self, request, pk=None):
        
        self.top_level_forum = get_object_or_404(Forum, pk=pk) if pk else None
        return self.mark_as_read(request, pk)
220958
public function save ($post_ID)
    {
        if (!$this->doSave())
            return;
        if ($post_ID === self::SITE)
            update_option($this->identifier, $this->getPostValue());
        else
            update_post_meta($post_ID, $this->identifier, $this->getPostValue());
    }
1214654
def update_forum_votes(sender, **kwargs):
    
    vote = kwargs['instance']
    if vote.content_type.app_label != "fretboard":
        return
    if vote.content_type.model == "topic":
        t = get_model('fretboard', 'Topic').objects.get(id=vote.object.id)
        t.votes = t.score()
        t.save(update_fields=['votes'])
    elif vote.content_type.model == "post":
        p = get_model('fretboard', 'Post').objects.get(id=vote.object.id)
        p.votes = p.score()
        p.save(update_fields=['votes'])
774941
private function updatePost($id)
	{
		$model = $this->loadModel($id);

		if (!$this->user->role->hasPermission('modify'))
			throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));

		if ($this->user->role->isA('author') || $this->user->role->isA('collaborator'))
			$model->author_id = $this->user->id;

		$vid 	= $model->vid;
		$model 	= new Content;
		$model->id = $id;
		$model->populate($_POST);
		$model->vid = Yii::app()->db->createCommand('SELECT MAX(vid)+1 FROM content WHERE id = :id')->bindParam(':id', $id)->queryScalar();

		if ($model->save())
			return $model->getAPIAttributes(array(
					'category_id',
					'parent_id',
					'author_id'
				),
				array(
					'author' => array(
						'password',
						'activation_key',
						'email',
						'about',
						'user_role',
						'status',
						'created',
						'updated'
					),
					'category' => array(
						'parent_id'
					),
					'metadata' => array(
						'content_id'
					)
				));

		return $this->returnError(400, NULL, $model->getErrors());
	}
901726
def update(self, body):
        
        data = values.of({'Body': body, })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return MessageInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            sid=self._solution['sid'],
        )
683444
def update(id, url=default_webhook_url)
      params = {:url => url}
      Mailgun.submit :put, webhook_url(id), params
    end
117991
def edit_post(request, post_id):
    
    post   = get_object_or_404(Post, id=post_id)
    user   = request.user

    topic  = post.topic
    # oughta build a get_absolute_url method for this, maybe.
    post_url = '{0}page{1}/#post{2}'.format(topic.get_short_url(), topic.page_count, post.id)

    if topic.is_locked:
        messages.error(request, 'Sorry, but this topic is closed')
        return HttpResponseRedirect(post_url)

    if user.is_staff is False and user.id != post.author.id:
        messages.error(request, "Sorry, but you can't edit this post.")
        return HttpResponseRedirect(post_url)

    if request.POST and len(request.POST['text']) > 1:
        if request.is_ajax and 'body' in request.POST:  # AJAX REQUEST
            post.text = request.POST['body']
            post.save(update_fields=['text', 'text_formatted'])
            return HttpResponse(str(post.text))
        post.text = request.POST['text']
        post.save(update_fields=['text', 'text_formatted'])

        if 'name' in request.POST:  # updated topic
            topic.name = request.POST['name']
            topic.save(update_fields=['name'])
        return HttpResponseRedirect(post_url)
    # this is a get request
    else:
        if post == topic.post_set.all()[0]:
            form = AddTopicForm(instance=topic, initial={'text': post.text})
        else:
            form = PostForm(instance=post)
        return render(request, 'fretboard/add_edit.html', {
            'quote': post.quote,
            'form' : form,
            'form_title': 'Edit post',
        })
1011303
def update(id, body)
      wf_savedsearch_id?(id)
      raise ArgumentError unless body.is_a?(Hash)
      api.put(id, body)
    end
591111
def remove_commented_topic(self, topic_id):
        
        return [self.remove_comment(topic_id, item['id']) for item in self.list_user_comments(topic_id)]
90576
public void setId(final String id) {
        // Set the DBId as well if it isn't a new id
        if (id.matches(CSConstants.EXISTING_TOPIC_ID_REGEX)) {
            DBId = Integer.parseInt(id);
        }
        this.id = id;
    }
967565
protected function updatePost( $post_id, $status ) {

		$post = get_post( $post_id, 'ARRAY_A' );
		if ( empty( $post ) ) {
			return;
		}

		global $wpdb;
		$menu_order = $wpdb->get_var(
			$wpdb->prepare(
				"SELECT MAX(menu_order) FROM {$wpdb->posts} WHERE post_type = %s AND post_parent = %d AND ID != %d ",
				$post['post_type'],
				$post['post_parent'],
				$post_id
			)
		);
		if ( $menu_order !== null ) {
			$post['menu_order'] = $menu_order + 1;
		}

		$post['post_status'] = $status;

		wp_update_post( $post );
	}
24453
def can_add_post(self, topic, user):
        
        can_add_post = self._perform_basic_permission_check(
            topic.forum, user, 'can_reply_to_topics',
        )
        can_add_post &= (
            not topic.is_locked or
            self._perform_basic_permission_check(topic.forum, user, 'can_reply_to_locked_topics')
        )
        return can_add_post
747830
def update(self, uid):
        '''
        
        '''
        if self.userinfo.role[0] > '0':
            pass
        else:
            return False

        post_data = self.get_post_data()
        post_data['user_name'] = self.userinfo.user_name if self.userinfo else ''
        cur_info = MWiki.get_by_uid(uid)
        MWikiHist.create_wiki_history(cur_info)
        MWiki.update_cnt(uid, post_data)
        if cur_info.kind == '1':
            self.redirect('/wiki/{0}'.format(cur_info.title))
        elif cur_info.kind == '2':
            self.redirect('/page/{0}.html'.format(cur_info.uid))
1365708
def add_comment(self, page_id, text):
        
        data = {'type': 'comment',
                'container': {'id': page_id, 'type': 'page', 'status': 'current'},
                'body': {'storage': {'value': text, 'representation': 'storage'}}}
        return self.post('rest/api/content/', data=data)