Pastoid

The page you are looking at now is at this URL: http://pastoid.com/bwd

This paste was last updated on August 12, 2009 at 3:29 pm.

Pasted Coderaw

<?php
 
// ...
$form = $post->comment_form();
$form->get(null, false);
// Was this a FormUI form, or a regular comment form?
if($form->submitted) {
	if($form->success) {
		$this->add_comment(
			$post->id,
			$form->commenter->value,
			$form->email->value,
			$form->url->value,
			$form->content->value
		);
	}
	else {
		Session::error(_t('There was a problem submitting your comment.'));
		foreach($form->validate() as $error) {
			Session::error($error);
		}
		$form->bounce();
	}
}
else {
	// make sure all our default values are set so we don't throw undefined index errors
	foreach ( $defaults as $k => $v ) {
		if ( !isset( $this->handler_vars[ $k ] ) ) {
			$this->handler_vars[ $k ] = $v;
		}
	}
 
	$this->add_comment(
		$this->handler_vars['id'],
		$this->handler_vars['name'],
		$this->handler_vars['email'],
		$this->handler_vars['url'],
		$this->handler_vars['content']
	);
 
}
 
 

Toggle wordwrap

Referring DomainHits
Unknown Referer 127
pastoid.com 5
Is this paste spam?
<Hide