<?php
   /*
   Plugin Name: Wordpress Google Scholar
   Plugin URI: http://www.sociology.org/gs
   Description: A plugin to output Google Scholar Metadata
   Version: .01
   Author: Dr. MIke Sosteric
   Author URI: http://www.sociology.org/
   License: GPL2
   */

// insert head meta data
add_action('wp_head', 'head_meta_data');
function head_meta_data() { 
echo "<!-- GOOGLE SCHOLAR DATA -->\n";
	echo hmd_display_content();
}

function hmd_display_content() {
	global $hmd_options;
	$hmd_output = '';
	$hmd_enable = $hmd_options['hmd_enable']; 
	$hmd_format = $hmd_options['hmd_format'];
	if ($hmd_format == false) {
		$close_tag = '" />' . "\n";
	} else {
		$close_tag = '">' . "\n";
	}
	if (is_single()) {
		global $post;
 		$author_id=$post->post_author;
  		$author = get_the_author_meta( 'last_name' ) . ',' . get_the_author_meta( 'first_name');;

		$hmd_output .= '		<meta name="citation_title" content="' 			. $hmd_options['gs_title']       	. $close_tag;
		$hmd_output .= '		<meta name="citation_author" content="'			. $author      				. $close_tag;
		$hmd_output .= '		<meta name="citation_publication_date" content="'  	. get_the_date('F,Y')        		. $close_tag;
		$hmd_output .= '		<meta name="citation_journal_title" content="'  	. get_bloginfo('name')     		. $close_tag;
	}
	return $hmd_output;
}

?>
