Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aristath
Created November 24, 2013 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristath/7625554 to your computer and use it in GitHub Desktop.
Save aristath/7625554 to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<div id="right-sidebar-single">
<?php
if ( !wp_is_mobile() ) :
dynamic_sidebar( 'sidebar-right-single' );
endif;
?>
</div>
<div id="content-single">
<?php do_action('bp_before_blog_single_post'); ?>
<div class="page" id="blog-single" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div id="leftPanel">
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>
<h1><?php the_title(); ?></h1>
<a href="http://www.facebook.com/share.php?u=<full page url to share" onClick="return fbs_click(600, 250)" target="_blank" title="Share This on Facebook"><img src="http://searchbuzz.co/wp-content/uploads/2013/11/Share_On_Facebook.png" alt="facebook share"></a>
<div class="authorContent-single">
<div id="post-thumbnail">
<?php the_post_thumbnail(array(500, 400)); ?>
</div>
<br />
<div class="socialLikeBlock">
</div>
<div class="authorLinks">
<span class="author"><?php printf(__('%s', 'buddypress'), bp_core_get_userlink($post->post_author)) ?></span>
<span class="days"><?php wp_days_ago_ajax( $mode, $prepend, $append, $threshold, $showDateAfter, $showDateFormat); ?></span> <span class="celebrity"><?php printf(__(' %2$s', 'buddypress'), get_the_date(), get_the_category_list(', ')); ?> </span>
</div >
<?php the_content(__('Read the rest of this entry &rarr;', 'buddypress')); ?>
</div>
<br />
<?php
$post_source = get_post_meta( get_the_ID(), 'cf_Source', true );
$post_source_name = get_post_meta( get_the_ID(), 'cf_Source_name', true );
?>
<?php if( $post_source && $post_source_name ) : addHttp( $post_source ); ?>
<div class="youMayLikeSection" style="width: 100.5%;">
<p>
<strong>SOURCE:</strong>
<?php echo addLinks( $post_source, " rel='nofollow external' class='greenText' target='_blank' style='display:inline;'", $post_source_name ); ?>
</p>
</div>
<a href="http://www.facebook.com/share.php?u=<full page url to share" onClick="return fbs_click(600, 250)" target="_blank" title="Share This on Facebook"><img src="http://searchbuzz.co/wp-content/uploads/2013/11/Share_On_Facebook.png" alt="facebook share"></a>
<?php endif;?>
<br>
<div align="center">
<!-- BuySellAds Zone Code -->
<div id="bsap_1280127" class="bsarocks bsap_8588d4df5d869bce85d2e8bfb698e2fc"></div>
<!-- End BuySellAds Zone Code -->
</div>
<div class="youMayLikeSection">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h4>From Around The Web:</h4>
<iframe class="scribol" height="306" width="470" id="scribol_3559717" scrolling="no" frameborder="0"></iframe>
<script>
var Scribol;
if(typeof Scribol=='undefined'){Scribol={}; Scribol.frames=[];Scribol.site='http://scribol.com/';Scribol.is_preview=false;}
Scribol.frames.push('3559717');</script>
<script async="async" defer="defer" src="http://scribol.com/txwidget1.2.js"></script>
</div>
<div class="commentsZone">
<h6><span><?php if (comments_open()) : ?><?php comments_popup_link('No Comment', '1 Comment', '% Comments'); ?><?php endif; ?></span></h6>
<?php comments_template(); ?>
</div>
</div>
</div> <?php
endwhile;
else:
?>
<p><?php _e('Sorry, no posts matched your criteria.', 'buddypress'); ?></p>
<?php endif; ?> </div>
<?php do_action('bp_after_blog_single_post'); ?> </div><!-- #content -->
<?php get_sidebar(); ?>
<script type="text/javascript"> var jq = jQuery.noConflict();
jq("body").append("<div class='black_overlay js_black_overlay'></div>");
var html = "<div class='white_content js_white_content' id='lbContainer'>"
+ "<div class='close_white_content js_close_white_content'><a onclick='wdw_closeLightbox()'></a></div>"
+ "<div class='emi_share_post_comment'><label>Message:</label><input type='text' name='emi_msg_for_send' id='emi_message_tsxt' class='emi_message_tsxt'/><br/>"
+ "<label>Full Username:</label><input type='text' name='txt_friendname' id='txt_friendname'><br/>"
+ "<input type='submit' id='btn_share_post'/></div>" + "</div>";
jq("body").append(html);
function after_wdw_closeLightbox(lastLB) {
if (lastLB == "WPEI_uploader") {
WPEI_clear_temp_upload();
}
}
function wdw_closeLightbox(){
var lastActiveLightbox = jQuery(".js_white_content").attr('id');
jQuery(".js_black_overlay").fadeOut(500); jQuery(".js_white_content").fadeOut(500);
/*call custom cleanup method*/
if (typeof(after_wdw_closeLightbox) === "function") { // safe to use the function
after_wdw_closeLightbox(lastActiveLightbox);
}
window.location.href = smt_root_domain;
}
jq(window).load(function(){
FB.Event.subscribe('edge.create',
function(response) {
/*
This event will be fired when u like the main website(sticky header bar) as well.
We dont want to do anything if user likes the main webiste.
We'll check if the url user liked is the url(pemalink) of current post,
and if yes then only do our thing...
*/
var shared_post_id = <?php the_ID();?>;
var sharing_user_id = <?php echo bp_loggedin_user_id();?>;
var current_post_url = '<?php the_permalink();?>';
if( response == current_post_url ){
var data = {
action: 'emi_like_a_post',
Post_id: shared_post_id,
limit: 10
};
jq.ajax({
type: "POST",
url: ajaxurl,
data: data,
success: function(response) {
//console.log( 'user liked the post instead of the main website' );
}
});
}
}
);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment