 PostBadge tag to show
// FeedBurner FeedFlare.
// -------------------------
// FeedBurner account and feed required.
// Sign up at http://feedburner.com
//================================================

class module_feedflare {
	function init(){
		global $gregarious;
		$gregarious->add_settings ( array ( 'feedburner_url' => '' ) );
		$gregarious->add_page ( 'FeedFlare', 'modules/feed-flare/icn_Flare.png', 'page_feedflare();', 'feedFlare' );
	}

	function postbadge_tags(){
		return array (
		array (	'tag' => '%FLARE%', 'replacewith' => 'feed_flare("",false)' ),
		);
	}

	function update_info(){
		return 100;
	}
}

//------------------------------------------
// TEMPlATE TAGS
//------------------------------------------

function feed_flare($settings = '', $echo = true){
	global $wp_query;
	$post = $wp_query->post;
	$sets = array('postID' => $post->ID, 'before' => '', 'after' => '<span style="display:none">Gregarious FeedFlare</span>', 'force' => 0 );

	grab_sets($settings, $sets);
	if ( !$sets['force'] && hideOnID($sets['postID']) ){
		return '';
	}

	if( !$path = _get_feedburner_url() )
		return '';

	if( substr( $path, -1 ) == '/' ){
		$path = substr( $path, 0, strlen( $path ) -1 );
	}

	$path = str_replace ( 'feedburner.com/', 'feedburner.com/~s/', $path );

	$path .= '?i='.get_permalink($sets['postID']);

	$result = $sets['before'] . "<script src='$path' type='text/javascript'></script>" . $sets['after'];
	if($echo) echo $result;
	else return $result;
}

function _get_feedburner_url(){
	$feedurl = greg_get_option( 'feedburner_url' );
	if ( $feedurl ){
		return attribute_escape($feedurl);
	} else {
		$feedburner_settings = get_option('feedburner_settings');
		if( is_array($feedburner_settings) && ($feedurl = $feedburner_settings['feedburner_url']) ) {
			return attribute_escape($feedurl);
		} else {
			return false;
		}
	}
}

//------------------------------------------
// OPTIONS PAGE
//------------------------------------------

function page_feedflare(){
	$feedurl = _get_feedburner_url();
?>
<ul>
	<li class="page_code">
		<label class="wrapping">Feedburner feed URL: <input type='text' name='feedburner_url' value='' />
		</label>
	</li>
	<li class="transmit">
		<a class="wrapping" href="http://www.feedburner.com/fb/a/publishers/feedflare;">About FeedFlare &raquo;</a>
	</li>
	<li class="stat">
		<a class="wrapping" href="http://www.feedburner.com/fb/a/dashboard;">FeedStats Dashboard &raquo;</a>
	</li>
</ul>

/* Comment Stuff */
.awpcomments ol.comments{
	padding-left:0;
	margin-left:0;
	list-style-type:none !important;
}

.awpcomments ol.comments * > ol.reply{
	list-style-type:none !important;
	padding-left:1.3em;
	margin-left:0;
}

.awpcomments * ol.reply{
	list-style-type:none !important;
}

.awpcomments * .authorcomment {
	border:1px solid #c0c0c0;
	line-height:1.5em;
	margin:3px;
	padding:4px;
}

.awpcomments * .commentbar {
	display:block;
	margin:0 !important;
	padding:5px 5px 10px 5px !important;

	font-weight:400;
	text-align:left;
}

.awpcomments * .commentbar cite{
	font-style:normal;
}

.comment_form input[type=text], .comment_form textarea, .input {
	font-size: 1.1em;
	padding: 3px;
	border: 2px solid #B3B3B3 !important;
}

.comment_form input[type=text]:focus, .comment_form  textarea:focus, .input:focus {
	background: #fff;
	color: #333;
	border: 2px solid #B3B3B3 !important;
}

.preview_comment{
	border: 2px solid #B3B3B3 !important;
	padding-top: 10px;
	background: #ffffff  url('http://anthologyoi.com/wp-content/plugins//aWP/modules/inlinecommentform/close_normal.gif') top left no-repeat;
}
.comment_form input[type=text] {
	width: 45%;
	margin: 5px 5px 1px 0;
}

.comment_form textarea {
	height: 250px;
	width: 95% !important;
	margin-right:4% !important;
	font-size: 1.2em;
}

.ed_button, .submit, .comment_form input[type=submit],.comment_form input[type=button] {
	border:1px solid #B2B2B2;
	font-size:1em;
	margin-right:2px;
	padding:3px;
	width:auto;
}

.wp-smiley{
	vertical-align:middle;
	border:0;
}
.bigthrobber{
	right:30%;
	position:absolute;
	z-index:100;
	height:50px;
	width:50px;
}

/*Dummy*/
.dummyclass{
	border:0;
}

