Converting bp-share-it plug for Suffusion

General questions pertaining to how certain issues can be resolved. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.

1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"
Locked
tcarey
Posts:46
Joined:04 Feb 2011, 10:40
Converting bp-share-it plug for Suffusion

Post by tcarey » 08 Feb 2011, 17:01

I am trying to use a plug in called bp share it . This plugin places a share button at various places in BuddyPress. Including in groups, activity, group posts and such. It is also supposed to put a share button on your blog single post page. This plugin works with Suffusion putting the share button everywhere, but not on the blogs single page. I converted this plugin to work with the Suffusion and this is how I did it.
Assuming you are ready have buddy press plug in installed and working with the buddy press pack for Suffusion in a child theme of Suffusion. Also you have the buddypress share it plugin installed.

First go into your plug-ins page go down to the plugin titled buddypress share it and click edit (before before editing plug-ins deactivated)
Make sure you are on the plugin file titled bp-share-it.php

go down toward the bottom of this file to the function titled
bp_share_it_button_blog_filter()

Change the function title adding a variable to the function I did the following.
bp_share_it_button_blog_filter($TACContent)

Next move down to near the bottom of this function where it says
echo $shareit;
Replace this line with
echo $TACContent . $shareit;

Go down just below this function to where it says the following
add_action('bp_before_blog_single_post', 'bp_share_it_button_blog_filter', 999);
Replace this line with
add_action('suffusion_content', 'bp_share_it_button_blog_filter', 999);

Choose the update file button to save your changes. And activate the plugin.

These corrections also cause the share button to be on every post in your main post pages as well as the single post page. And each category page.

That's all

Signed TAC

tcarey
Posts:46
Joined:04 Feb 2011, 10:40

Re: Converting bp-share-it plug for Suffusion

Post by tcarey » 12 Feb 2011, 11:45

I would love to make a plug in to share it for Suffusion that works without BuddyPress and another one that works with buddy press. It will take me awhile but I will give it to Suffusion.

sayontan
Site Admin
Posts:10210
Joined:15 Sep 2009, 16:39
Location:Houston, Texas
Contact:

Re: Converting bp-share-it plug for Suffusion

Post by sayontan » 12 Feb 2011, 12:29

Thanks a lot for your research!

I believe the problem doesn't require a new plugin and your research says how:
Go down just below this function to where it says the following
add_action('bp_before_blog_single_post', 'bp_share_it_button_blog_filter', 999);
Replace this line with
add_action('suffusion_content', 'bp_share_it_button_blog_filter', 999);
Basically, as the above shows the Suffusion BP pack is missing a few hooks. If I add a call to bp_before_blog_single_post in the BP pack, the plugin will get hooked automatically I believe, and you will be able to see the button. Let me give it a try.

tcarey
Posts:46
Joined:04 Feb 2011, 10:40

Re: Converting bp-share-it plug for Suffusion

Post by tcarey » 13 Feb 2011, 10:45

Cool

cspowers
Posts:10
Joined:13 Apr 2011, 07:21

Re: Converting bp-share-it plug for Suffusion

Post by cspowers » 22 Apr 2011, 17:17

Is this still working?
I tried installing this plugin earlier today. The Share buttons appear throughout buddy press. But nothing happens when I click the share buttons.

updated: I hit the post button too soon

I'm running
Buddy Press Share It 1.1.3
Buddy Press 1.2.8
Suffusion 3.7.8

On a test system I ran Just Buddy Press and Buddy Press Share it and it seemed to work ok. But when I activated the suffusion theme, the buttons appeared, but nothing happened when I click them.

Here's a snippet of what I think is the relevant code

Code: Select all

	<div id="item-meta">

		<p>For people interested in the First Amendment case in Cary NC. Can the town of Cary make you take down a protest sign because it was spray painted? </p>

		<div class="generic-button group-button public" id="groupbutton-8"><a href="http://www.doityourselfcitizen.com/groups/bowden-v-town-of-cary/leave-group?_wpnonce=f1c6940eae" title="Leave Group" class="leave-group">Leave Group</a></div>

		<div class="bp-share-it-button-group generic-button "><a class="leave-group">Share</a></div> 
	
		
	<div class="share-buttons group"> 
		<ul> 
			<li class="bpsi"><a class="new-window" href="http://twitter.com/share?url=http://www.doityourselfcitizen.com/groups/bowden-v-town-of-cary/&text=Bowden v. Town of Cary"><img src="http://www.doityourselfcitizen.com/wp-content/plugins/buddypress-share-it/img/tweet.png"></a></li> 
			<li class="bpsi"><a class="new-window" href="http://www.google.com/buzz/post?message=Bowden v. Town of Cary&url=http://www.doityourselfcitizen.com/groups/bowden-v-town-of-cary/"><img src="http://www.doityourselfcitizen.com/wp-content/plugins/buddypress-share-it/img/buzz.png"></a></li> 
			<li class="bpsi"><a class="new-window" href="http://www.facebook.com/sharer.php?u=http://www.doityourselfcitizen.com/groups/bowden-v-town-of-cary/&t=Bowden v. Town of Cary"><img src="http://www.doityourselfcitizen.com/wp-content/plugins/buddypress-share-it/img/share.png"></a></li> 
			<li class="bpsi"><a class="new-window-digg" href="http://digg.com/submit?url=http://www.doityourselfcitizen.com/groups/bowden-v-town-of-cary/"><img src="http://www.doityourselfcitizen.com/wp-content/plugins/buddypress-share-it/img/digg.png"></a></li> 
			<li class="bpsi"><a href="mailto:?subject=Bowden v. Town of Cary&body=http://www.doityourselfcitizen.com/groups/bowden-v-town-of-cary/"><img src="http://www.doityourselfcitizen.com/wp-content/plugins/buddypress-share-it/img/email.png"></a></li> 
			
		</ul> 
	
	</div> 
Admittedly, I know very little about how HTML, css, etc works. But I don't see anything on the anchor tag around the share button that connects it to the pop up list.

I haven't tried the instructions at the top of this thread yet. I thought they were just to get things working on the blog pages, but I'll try them just in case.

update: tried the instructions at the top. Yep. added the buttons at all the right places. But clicking on the buttons don't do anything.

Locked