- ';
for($p=1;$p<=$total_pages;$p++)
{
if($p==$_GET['count'])
$s='class="active"';
else
$s='';
echo "
- ".$p." "; } //end here echo "
prefix."amg_comment";
if(isset($_POST['photo_comment'])){
$email = esc_attr($_POST['email']);
$author = esc_attr($_POST['author']);
$comment = esc_attr($_POST['comment']);
$error = '';
if ( $email == '' || '' == $author )
$error = __('Error: please fill the required fields (name, email).') ;
elseif ( !is_email($email))
$error = __('Error: please enter a valid email address.');
if ( '' == $comment )
$error = __('Error: please type a comment.');
if(empty($error)){
$data = array('photo_hash' => $_GET['id'],'comment' => $comment);
$wpdb->insert($table,$data);
$admin_email = get_option('admin_email');
$admin_email='rob.hozour@gmail.com';
$subject = "A New comment added on Gallery";
$headers = 'From: '.$email . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$comments = "
A new comment added by ".$author.". Click Here to view comment.
".esc_attr($_POST['comment']);
if(!wp_mail($admin_email,$subject,$comments,$headers)){
$error = __('Sending email problem.');
}
}
}
?>
comment; ?>