Topic-icon Like / Share Button on everything in Jomsocial

Active Subscriptions:

None
12 years 3 weeks ago #26118 by uriel
Hi Alex,

I get a Syntax Error when I do it this way :
Parse error: syntax error, unexpected T_ENDIF in /home/blahbado/public_html/templates/jf_corporate/html/com_community/activities.index.php on line 290

I don't even mind if it only displays for logged in users - I just want to get it working....
When I click Share I get this in the pop up box :
The page at /index.php/your-community/42-super-user/profile?act=48 could not be reached.

When I Click Like it gets stuck... even if I type in a comment it would not allow me to click the Post to Facebook or Close Button...
Your Css trick worked! - thank you very much I can at least now see the pop up boxes...

I don't need the Send Button it seems as there is a Send Button in the pop up box... I dont know how it got there anyway... :-)

Please log in and try it to see what I am on about :-) - Thank you for all your help so far!
The topic has been locked.
Support Specialist
12 years 3 weeks ago #26120 by alzander
If the parse error is displaying, it means that you deleted, or commented out, a section of PHP code regarding the if statements. I just tested with a clean installation of JomSocial. This is what the code should look like, including the original Like/Comment code that I said to modify. The changes there are undone, and there's is just a {JFBCLike..} tag above that block of code now. This will show the Like button to all users, whether they are logged in or not:
<!-- if no one likes yet, then show: -->
                {JFBCLike show_send_button=false href=<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor.'&act='.$act->id); ?>}
				<?php if($allowLike) { ?>
					<?php if($act->userLiked!=COMMUNITY_LIKE) { ?>
						&#x2022; <a id="like_id<?php echo $act->id?>" href="#like" onclick="jax.call('community','system,ajaxStreamAddLike', '<?php echo $act->id; ?>');return false;"><?php echo JText::_('COM_COMMUNITY_LIKE');?></a>
					<?php } else { ?>
						&#x2022; <a id="like_id<?php echo $act->id?>" href="#unlike" onclick="jax.call('community','system,ajaxStreamUnlike', '<?php echo $act->id; ?>');return false;"><?php echo JText::_('COM_COMMUNITY_UNLIKE');?></a>						
					<?php } ?>
				<?php } ?>
The {JFBCLike..} tag above specifically disables the Send button, because, as mentioned above, if you want the Send, you'll need to include it differently (with the {JFBCSend} tag. Let's get the Like button up and then we can work on that...

I just tested on your site, and Like'd the 3 post down (has an image with text "Silence, I delete you"). The Like seemed to work for me. It shows that I Like it, and my image shows up underneath.

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 3 weeks ago #26130 by uriel
Ok Awesome! yes I think my inability to get the full block of code correctly like you have shown me this time, was causing my issues...

I am also on a Mac so my browser is slightly different - i needed to hover a bit lower on the "Post to Facebook" button for it to work... ok that is working now thank you so very much...

I see although I liked it - it doesnt go to Facebook but I think that will come in with the Share Button - Could we now perhaps look at that Alex ?
I appreciate your Support so far...
The topic has been locked.
Active Subscriptions:

None
12 years 2 weeks ago #26202 by uriel
Hi Alex,
Please will you look into this for me as soon as possible - this is all I need to launch my site....
The topic has been locked.
Support Specialist
12 years 2 weeks ago #26207 by alzander
Uriel,
Sorry for the delay. When you say the Share button, I'm assuming you mean the Send button? If so, please try just adding the JFBCSend tag, as below:
<!-- if no one likes yet, then show: --> 
                {JFBCLike show_send_button=false href=<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor.'&act='.$act->id); ?>} 
                {JFBCSend href=<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor); ?>} 
                <?php if($allowLike) { ?>
The problem with the Send button is that you'll be sending a link to the user's profile, not to the actual status update they made. JomSocial doesn't have a link to the user's actual status update, so it's simply something you can't 'Send' to other Facebook users.

Hope that makes sense and works how you want it to, but if not, let us know.

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

None
12 years 2 weeks ago #26208 by uriel
Hi Alex,

Please can you give me the full block of code together with our earlier block as per :
<!-- if no one likes yet, then show: -->

{JFBCLike show_send_button=false href=<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor.'&act='.$act->id); ?>}

<?php if($allowLike) { ?>

<?php if($act->userLiked!=COMMUNITY_LIKE) { ?>

&#x2022; <a id="like_id<?php echo $act->id?>" href="#like" onclick="jax.call('community','system,ajaxStreamAddLike', '<?php echo $act->id; ?>');return false;"><?php echo JText::_('COM_COMMUNITY_LIKE');?></a>

<?php } else { ?>

&#x2022; <a id="like_id<?php echo $act->id?>" href="#unlike" onclick="jax.call('community','system,ajaxStreamUnlike', '<?php echo $act->id; ?>');return false;"><?php echo JText::_('COM_COMMUNITY_UNLIKE');?></a>

<?php } ?>

<?php } ?>

What I mean to achieve is for a user to be able to share or send whatever he finds on my site to Facebook

You said : The problem with the Send button...
Did you mean Share Button ?
The topic has been locked.
Support Specialist
12 years 2 weeks ago #26209 by alzander
There is no Share button anymore. Facebook deprecated the Share button over 2 years ago and doesn't recommend using it anymore. Instead, they recommend the Like button, which you're using. When an item is Like'd, Facebook will choose whether it should go in your timeline, post to your wall, or additionally, go to your friends wall as something that you like.

Hope that makes sense, but if you were looking for something else, let us know.

Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 weeks ago #26227 by uriel
Hi Alex,

Thats great.
I still dont know what the full block of code would be to add both Like and Send Button.
I don't want to break what is done already so can you please indicate to me how I would get a Send button together with the Like Button as per earlier code :


{JFBCLike show_send_button=false href=actor.'&act='.$act->id); ?>}



userLiked!=COMMUNITY_LIKE) { ?>

" " href="#like" onclick="jax.call('community','system,ajaxStreamAddLike', 'id; ?>');return false;">



" " href="#unlike" onclick="jax.call('community','system,ajaxStreamUnlike', 'id; ?>');return false;">

I dont see anything on my Facebook Profile when I clicked Like by the way. At the moment I am the only one on my JFBConnect site so I understand that you saying Facebook will choose if it should go to my Profile or my Wall or my friends Profile - but surely with me being the only one on it should then Show up on my Profile or my Wall ?

If the Like Button worked I would not be hassling with the Send Button... My needs are simple - I just want to be able to Post my content to Facebook and allow users to do the same.
The topic has been locked.
Support Specialist
12 years 2 weeks ago #26255 by alzander
When you go to your profile, there is an "Activity Log" button under your cover photo. Click that and see all your activity. The Like click should be in there. If not, let us know.

As for the Send button, just so you know what it does, it's a way to let your users send the specified page to a selection of their friends. It won't "Send" it to the user's wall or anything like the old Share button did. It's a much more specific targetting of who the page should go to.

If you still want to add it, you can do so with the following code. This is the same as I posted a few threads above as the 'original' JomSocial code in the block below is unchanged:
<!-- if no one likes yet, then show: --> 
                {JFBCLike show_send_button=false href=<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor.'&act='.$act->id); ?>} 
                {JFBCSend href=<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor); ?>} 
                <?php if($allowLike) { ?> 
                    <?php if($act->userLiked!=COMMUNITY_LIKE) { ?> 
                        &#x2022; <a id="like_id<?php echo $act->id?>" href="#like" onclick="jax.call('community','system,ajaxStreamAddLike', '<?php echo $act->id; ?>');return false;"><?php echo JText::_('COM_COMMUNITY_LIKE');?></a> 
                    <?php } else { ?> 
                        &#x2022; <a id="like_id<?php echo $act->id?>" href="#unlike" onclick="jax.call('community','system,ajaxStreamUnlike', '<?php echo $act->id; ?>');return false;"><?php echo JText::_('COM_COMMUNITY_UNLIKE');?></a>                        
                    <?php } ?> 
                <?php } ?>
Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 weeks ago #26275 by uriel
Hi Alex,

I have inspected my entire Activity Log and none of my Likes from the JFB Connect buttons are there... The Like button have also Stopped working again - I cant Click Post to Facebook anymore
The topic has been locked.