Topic-icon Social Stream - link TO Facebook post?

Active Subscriptions:

None
11 years 5 months ago #49974 by tmsrDD
I have successfully set up a SC Social Stream on my site:
oakcreekwatershed.org

However, the post list does not link back to the Facebook posts on Facebook. Is there a way to do that?
tmsrDD
The topic has been locked.
Support Specialist
11 years 5 months ago #49976 by mel
We don't currently have this functionality yet, as the social streams are a newer feature. However, I have this issue in our tracker to address in the next release. In the meantime, you can see the following forum posts on how to address this temporarily if you desire:

www.sourcecoast.com/forums/jfbconnect/jf...-stream-link-to-post
www.sourcecoast.com/forums/jfbconnect/jf...-link-to-post#p49866

-Melissa
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #49979 by tmsrDD
I went to this post:
www.sourcecoast.com/forums/jfbconnect/jf...-link-to-post#p49866

I modified carefully the three files they recommend to change, I cleared the admin Cache and Purged it. The only thing I have is a link on the DATE link of the Facebook posts - but it just opens a new window to my OWN homepage. Did I do something wrong in the implementation of the posts' suggestion?
tmsrDD
The topic has been locked.
Support Specialist
11 years 5 months ago #49981 by mel
Have you tried the first suggestion from Alex yet? The one that you tried was submitted by a user and is untested by us.
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #49982 by tmsrDD
I had not, but now I am trying it.
I went to this post:
www.sourcecoast.com/forums/jfbconnect/jf...-stream-link-to-post

I followed the first step to modify the page.php, but for the second, he doesn't specify WHERE to insert this line in the facebook.php code:
<a href="www.facebook.com/oakcreekwatershed.org/posts/id; ?>">Link to post

I tried a couple of things and it seemed to work at one point, but the date was a link and no where was it saying "Link to post" so I thought I did it wrong - and now can't get it to work at all.

Please advise. We must be close...
tmsrDD
The topic has been locked.
Support Specialist
11 years 5 months ago #49984 by alzander
The code in the first post *looks* correct. If the link is going to your home page, I'm guessing the single quotes and double-quotes in the post got a bit messed up. The post showed that the link should look like:
echo '<a href="' . $this->fbArticleLink . '" target="_blank"><div class="date">' . $date . '</div></a>';
Please make sure that there is a double-quote followed by a single quote after the href= and single-quote followed by double-quote before the target=..

If that doesn't work, let us know a URL where we can see the social stream linking to the home page. Seeing the link that's being inserted will help us understand the problem.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #49989 by tmsrDD
I lost you on this last reply. I am not sure which of the two posts I was given in #49976 above that you are referring to.
I had back-tracked since I was asked if I tried the suggestion posted here:
www.sourcecoast.com/forums/jfbconnect/jf...-stream-link-to-post

I cleared out any modified files, and started with the files that had been in place before this thread began.
I followed the first step to modify the page.php by finding this line (in my file, it was about line 71):
$post->id = $data;

and inserting this line after it (correct?):
$post = new JFBConnectPost();

For the second modification Alex (you?) asked for, I was not sure WHERE to insert this line in the facebook.php code:
<a href="www.facebook.com/oakcreekwatershed.org/posts/id; ?>">Link to post

I tried a couple of things and it seemed to work at one point, but the date was a link and no where was it saying "Link to post" so I thought I did it wrong - and now can't get it to work at all.

For example, go to this page:
oakcreekwatershed.org/creek-resources

There is NO link in any of the posts in the stream, except on WITHIN the post on December 12 (see the Link to post) and that isn't going to a correct page in Facebook.

So if you could backtrack here, I will UNDO what I did in facebook.php and then follow you instruction as to where to to insert this line you gave in your post:
<a href="www.facebook.com/oakcreekwatershed.org/posts/id; ?>">Link to post

Also, just to clarify, should I be adding this line to facebook.php in more than one place?

Please advise.
tmsrDD
The topic has been locked.
Support Specialist
11 years 5 months ago #49991 by mel
Sorry for the confusion. Since we initially provided the workaround in www.sourcecoast.com/forums/jfbconnect/jf...-stream-link-to-post I believe that the ID for the post returned from Facebook may have changed. There needs to be some slight tweaking to the page id; otherwise, the link will send you to an error page on Facebook. I just implemented the following on my test site and have it working.

#1. Edit the /components/com_jfbconnect/libraries/provider/facebook/channel/page.php file. Around line 71, you'll see:
$post = new JFBConnectPost();
Change this to:
$post = new JFBConnectPost();

$post->id = $data['id'];
$ids = explode("_", $post->id);
if(count($ids) > 1)
   $post->id = $ids[1];

#2. One good option to add the link to the post is for the Facebook icon. The following will make that image a link that launches the post in a new window. In /media/sourcecoast/themes/scsocialstream/default/facebook.php, around line 15, change
echo '<div class="provider"><img src="' . JUri::root(true) . '/media/sourcecoast/images/provider/facebook/icon.png" /></div>';
to
echo '<div class="provider"><a href="https://www.facebook.com/oakcreekwatershed.org/posts/'.$this->id.'" target="_blank"><img src="' . JUri::root(true) . '/media/sourcecoast/images/provider/facebook/icon.png" /></a></div>';

#3. Another option is to add the link directly after the message of the post. Around line 24, change
<div class="message span12">' . $message . '</div>
to
<div class="message span12">' . $message . '</div>
<div class="link span12"><a href="https://www.facebook.com/oakcreekwatershed.org/posts/'.$this->id.'">Link to post</a></div>

#4. In the /media/sourcecoast/themes/scsocialstream/default/styles.css, around line 39, change the following block from:
.socialstream .post .message {
    margin: 0;
    padding: 5px;
    font-size:.9em;
}
to
.socialstream .post .message,
.socialstream .post .link {
    margin: 0;
    padding: 5px;
    font-size:.9em;
}

Please try this and let me know if you're still having problems.
-Melissa
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #49999 by tmsrDD
I followed your careful instructions in this last post and believe we have accomplished our goal.

The only change I made was to add target="_blank" to your #3, line 24 change so that the Link to post opened in a new window.

NOTE: I implemented your change completely and the facebook icon did link to the post correctly. However, I then turned that option off since I have a header saying OCWC on Facebook, and as it stands right now, that is the only social media site the client wants to stream from.

Thank you for getting me this far. Hope this helps in implementing it into your next iteration of the JFB Connect module. And that it is of help to others seeking this behavior in the meantime.
tmsrDD
The topic has been locked.
Support Specialist
11 years 5 months ago #50001 by mel
Glad to hear it is working for you now, with only slight tweaks. I've checked in these changes for the feature, so it will definitely be included in the next release :)

-Melissa
The topic has been locked.