<?
/*
Plugin Name: WP Subtitle
Plugin URI: http://www.husani.com/ventures/wordpress-plugins/wp-subtitle/
Description: Add a subtitle to pages and posts.  Place &lt;?=the_subtitle()?&gt; where you'd like the subtitle to appear.  Similar to the_title, you can pass before, after, and display arguments.  Documentation included in this plugin's readme file.  Get help at <a href="http://forums.husani.com/forum/wp-subtitle/" target="_blank">support forums</a> and sign up for the <a href="http://www.husani.com/ventures/wordpress-plugins/wp-subtitle/mailing-list/" target="_blank">mailing list</a> to receive updates and news about WP Subtitle.  By <a href="http://www.husani.com" target="_blank">Husani Oakley</a>.
Author
Version: 1.0
*/

/*  Copyright 2009  Husani Oakley  (email : wordpressplugins@husani.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

/**
 * query db and echo page/post subtitle, if any
 */
function wps_get_the_subtitle(){
  global $post;
  echo get_post_meta($post->ID, "wps_subtitle", true);
}

/** HOOKS */
add_action('admin_menu', 'wps_addPanelXHTML');
add_action('save_post', 'wps_saveSubtitle');

/** FUNCTIONS FOR HOOKS */

/**
 * display xhtml for subtitle panel
 */
function wps_addPanelXHTML(){
  if( function_exists( 'add_meta_box' )) {
    add_meta_box('wps_panel', 'Page Subtitle', 'wps_showSubtitlePanel', 'page', 'normal', 'high');
    add_meta_box('wps_panel', 'Post Subtitle', 'wps_showSubtitlePanel', 'post', 'normal', 'high');
  } else {
    add_action('dbx_page_advanced', 'wps_showSubtitlePanelOld');
    add_action('dbx_post_advanced', 'wps_showSubtitlePanelOld');
  }
  //include css if admin
  if(is_admin()){
    add_action('admin_print_styles', 'wps_addPanelCSS');
  }
}

/**
 * include CSS for subtitle panel
 */
function wps_addPanelCSS(){
  $css = WP_PLUGIN_URL . '/wp-subtitle/admin/css/panel.css';
  wp_register_style('wps_css', $css);
  wp_enqueue_style( 'wps_css');
}

/**
 * include XHTML for form inside panel
 */
function wps_showSubtitlePanel(){
  include ABSPATH . PLUGINDIR . "/wp-subtitle/admin/panel.inc.php";
}

/**
 * for pre-2.5, include shell for panel
 */
function wps_showSubtitlePanelOld(){
  include ABSPATH . PLUGINDIR . "/wp-subtitle/admin/compat_panel.inc.php";
}

/**
 * store subtitle content in db as custom field
 */
function wps_saveSubtitle($post_id){
  //verify
  if (!wp_verify_nonce( $_POST['wps_noncename'], 'wp-subtitle')) {
    return $post_id;
  }
  if ('page' == $_POST['post_type']){
    if (!current_user_can('edit_page', $post_id)){
      return $post_id;
    }
  } else {
    if (!current_user_can('edit_post', $post_id)){
      return $post_id;
    }
  }
  //save data
  if(!update_post_meta($post_id, "wps_subtitle", $_POST["wps_subtitle"])){
    add_post_meta($post_id, "wps_subtitle", $_POST["wps_subtitle"]);
  }
}

/**
 * return subtitle from post inside The Loop
 */
function the_subtitle($before="", $after="", $display=true){
  global $post;
  $subtitle = $before . get_post_meta($post->ID, "wps_subtitle", true) . $after;
  if($display){
    echo $subtitle;
  } else {
    return $subtitle;
  }
}

/**
 * return (or display) subtitle from post with ID passed as argument
 */
function get_the_subtitle($id, $before="", $after="", $display=true){
  $subtitle = $before . get_post_meta($id, "wps_subtitle", true) . $after;
  if($display){
    echo $subtitle;
  } else {
    return $subtitle;
  }
}


?><?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AMERICAN GRIDLOCK &#187; Six “Firsts”</title>
	<atom:link href="http://americangridlock.com/category/six-firsts/feed/" rel="self" type="application/rss+xml" />
	<link>http://americangridlock.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Tue, 07 Feb 2012 07:35:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>6</title>
		<link>http://americangridlock.com/2011/12/22/6/</link>
		<comments>http://americangridlock.com/2011/12/22/6/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:46:22 +0000</pubDate>
		<dc:creator>American Gridlock Editor</dc:creator>
				<category><![CDATA[Six “Firsts”]]></category>

		<guid isPermaLink="false">http://americangridlock.com/?p=235</guid>
		<description><![CDATA[The first book to argue that political science and political theory are more fundamental than economics. But both disciplines are currently ignored in policy debates. They should not be. Brock proposes a new discipline of political science centered around the concept of “multi-lateral bargaining” developed by the “Beautiful Mind” scholar John Nash, and by John [...]]]></description>
			<content:encoded><![CDATA[<p>The first book to argue that political science and political theory are more fundamental than economics.<span id="more-235"></span> But both disciplines are currently ignored in policy debates. They should not be. Brock proposes a new discipline of political science centered around the concept of “multi-lateral bargaining” developed by the “Beautiful Mind” scholar John Nash, and by John Harsanyi—both of whom shared the 1994 Nobel Prize.</p>
]]></content:encoded>
			<wfw:commentRss>http://americangridlock.com/2011/12/22/6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5</title>
		<link>http://americangridlock.com/2011/12/22/5/</link>
		<comments>http://americangridlock.com/2011/12/22/5/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:45:49 +0000</pubDate>
		<dc:creator>American Gridlock Editor</dc:creator>
				<category><![CDATA[Six “Firsts”]]></category>

		<guid isPermaLink="false">http://americangridlock.com/?p=233</guid>
		<description><![CDATA[The first book to utilize advanced macro-economic theory to derive a hands-on solution to today’s “Lost Decade”: A Marshall Plan for the US emphasizing not merely infrastructure investment, but rather profitable investment that pleases the bond market while re-invigorating economic growth and employment at the same time. Importantly, Brock establishes the need to replace the [...]]]></description>
			<content:encoded><![CDATA[<p>The first book to utilize advanced macro-economic theory to derive a hands-on solution to today’s “Lost Decade”<span id="more-233"></span>: A Marshall Plan for the US emphasizing not merely infrastructure investment, but rather <em>profitable</em> investment that pleases the bond market while re-invigorating economic growth and employment at the same time. Importantly, Brock establishes the need to replace the concept of a fiscal deficit with a new concept: Good versus Bad fiscal deficits. Good deficits (where borrowed money is spent productively) do not trouble the bond market, whereas Bad deficits of the kind we run today do.</p>
]]></content:encoded>
			<wfw:commentRss>http://americangridlock.com/2011/12/22/5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4</title>
		<link>http://americangridlock.com/2011/12/22/4/</link>
		<comments>http://americangridlock.com/2011/12/22/4/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:44:48 +0000</pubDate>
		<dc:creator>American Gridlock Editor</dc:creator>
				<category><![CDATA[Six “Firsts”]]></category>

		<guid isPermaLink="false">http://americangridlock.com/?p=231</guid>
		<description><![CDATA[The first book to deal with the prospect of national bankruptcy due to future health-care spending.  Remarkably, Brock derives an overall solution to this problem from the following three “axioms” or first principles: First, the nation needs greater access to health care for more people. Second, the nation needs more supply of health-care services so [...]]]></description>
			<content:encoded><![CDATA[<p>The first book to deal with the prospect of national bankruptcy due to future health-care spending.<span id="more-231"></span>  Remarkably, Brock derives an overall solution to this problem from the following three “axioms” or first principles: First, the nation needs greater access to health care for more people. Second, the nation needs more supply of health-care services so that, when you call a doctor in distress, someone answers the phone. Third, the total expenditure on health care as a share of GDP must be driven down from 18.4% today to about 10% in the long run. The author proves that there is one and only one set of policies that achieve these three goals.</p>
]]></content:encoded>
			<wfw:commentRss>http://americangridlock.com/2011/12/22/4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3</title>
		<link>http://americangridlock.com/2011/12/22/3/</link>
		<comments>http://americangridlock.com/2011/12/22/3/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:44:16 +0000</pubDate>
		<dc:creator>American Gridlock Editor</dc:creator>
				<category><![CDATA[Six “Firsts”]]></category>

		<guid isPermaLink="false">http://americangridlock.com/?p=229</guid>
		<description><![CDATA[The first book to delve deeply into the issue of “fair shares” or Distributive Justice.  Who should receive how much of the “pie” and why?  Brock shows how a compelling theory of justice must and can incorporate two different types of fairness: To each according to his Needs; and To each according to his Contribution. [...]]]></description>
			<content:encoded><![CDATA[<p>The first book to delve deeply into the issue of “fair shares” or Distributive Justice.<span id="more-229"></span>  Who should receive how much of the “pie” and why?  Brock shows how a compelling theory of justice must and can incorporate two different types of fairness: To each according to his Needs; and To each according to his Contribution. <em>Both</em> aspects of fairness must be satisfied, not just one or the other as has been the case in all previous theories.  Since the Left has traditionally focused on Needs-justice, and the Right upon Contribution-justice, a new theory incorporating both will drive another stake into the heart of today’s Left/Right divide, and further brake gridlock.</p>
]]></content:encoded>
			<wfw:commentRss>http://americangridlock.com/2011/12/22/3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2</title>
		<link>http://americangridlock.com/2011/12/22/2/</link>
		<comments>http://americangridlock.com/2011/12/22/2/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:42:49 +0000</pubDate>
		<dc:creator>American Gridlock Editor</dc:creator>
				<category><![CDATA[Six “Firsts”]]></category>

		<guid isPermaLink="false">http://americangridlock.com/?p=226</guid>
		<description><![CDATA[The first book to demonstrate how today’s “Dialogue of the Deaf” between the Left and Right wing has generated full-stop policy gridlock in Washington—and how to put an end to today’s Left/Right shouting match.  The author develops three innovative strategies for terminating the Dialogue of the Deaf, and policy gridlock in the process.]]></description>
			<content:encoded><![CDATA[<p>The first book to demonstrate how today’s “Dialogue of the Deaf” between the Left and Right wing has generated full-stop policy gridlock in Washington—and how to put an end to today’s Left/Right shouting match.<span id="more-226"></span>  The author develops three innovative strategies for terminating the Dialogue of the Deaf, and policy gridlock in the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://americangridlock.com/2011/12/22/2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>1</title>
		<link>http://americangridlock.com/2011/12/22/1/</link>
		<comments>http://americangridlock.com/2011/12/22/1/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:40:25 +0000</pubDate>
		<dc:creator>American Gridlock Editor</dc:creator>
				<category><![CDATA[Six “Firsts”]]></category>

		<guid isPermaLink="false">http://americangridlock.com/?p=222</guid>
		<description><![CDATA[The first book to identify and interrelate six of the principal themes of the 2012 US presidential election: (1) Distributive Justice, the issue of who owes what to whom currently receiving media attention in the Occupy Wall Street protests;  (2) Today’s “Lost Decade” of sky-high unemployment and tepid economic growth, and what to do about [...]]]></description>
			<content:encoded><![CDATA[<p>The first book to identify and interrelate six of the principal themes of the 2012 US presidential election<span id="more-222"></span>: (1) Distributive Justice, the issue of who owes what to whom currently receiving media attention in the Occupy Wall Street protests;  (2) Today’s “Lost Decade” of sky-high unemployment and tepid economic growth, and what to do about it; (3)  Exploding “entitlements” spending on Social Security and Me0edicare threatening to bankrupt the nation by 2040, and how to control these; (4) Confronting Chinese aggression, in particular the loss of millions of good US jobs to Chinese currency manipulation and intellectual property theft; (5) Future financial market Perfect Storms of the kind that brought down the global economy during 2007–2009, and how to prevent these; and (6) The contrast between <em>true</em> capitalism of the kind proposed by Adam Smith  and today’s “crony capitalism” in which Wall Street goes to Washington so as to rig the game in its favor.</p>
]]></content:encoded>
			<wfw:commentRss>http://americangridlock.com/2011/12/22/1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
