Topic-icon Share wrong site language + other issues

Active Subscriptions:

None
9 years 6 months ago - 9 years 6 months ago #48587 by none
Here I have few problems:

1.
I reported a problem as the share plugins want to share wrong site language.
User browse the English site and click on Twitter or LinkedIn share. In the popup window where Im about to send the share JFBconnect fills in the URL wrong even though Im on the English version of the site. It happens with a simple visitor as well. You dont have to log-in to test it or be a registered member.
For instance check this link: www.tolokapu.info/index.php?option=com_s...r&Itemid=720&lang=en
It is an English page. Now try to click and share it to LinkedIn or Twitter. The prefilled link is going to be:
www.tolokapu.info/index.php?option=com_s...r&Itemid=720&lang=br (Brazilian) You don't even have to share it just check what is in the share window before sharing it. The prefilled links all Brazilian.
May I ask why? You dont have to be logged in. I checked it with logged in users and it is always the same. Brazilian. My users are registered on English site not Brazilian.
I have this problem with LinkedIn and Twitter share. They both act the same. Why isn't the real (where the visitor is at the moment of sharing) language shared?

2.
Is there a plugin code that I can use to add all share options or I have to add these buttons one by one separately? (I want to add extra buttons.) I only found sample codes to add each button separately.
When I add them separately Google+ button has a 200px width even though there is no such parameter added to the plugin code.
See the picture:
File Attachment:


3.
We would like to refresh the page as soon as the alphauserpoints were given. Could you help me which javascript file we need to edit and where or what code I need to add/insert to reload the page?
So I need something like... User likes, share the website --> points are given --> refresh the page.

Thank you
Last edit: 9 years 6 months ago by none.
The topic has been locked.
Support Specialist
9 years 6 months ago #48591 by alzander
1) What are you using for multi-lingual language switching? Are you using Joomla's native language switching, or a 3rd party extension?

In general, JFBConnect simply asks Joomla what the best URL for the current page is and uses it. For some reason, the og:url that's being set on that page looks like:
<meta property="og:url" content="http://www.tolokapu.info/index.php?option=com_sobipro&pid=147&sid=2896:vlr-1800-intruder&Itemid=720&lang=br"/>
Obviously, something is telling JFBC the lang=br is the URL to use. I'm assuming that's the default language?

Either way, I'd recommend moving the JFBCSystem plugin to be ordered highest and lowest in the system plugin group to see if that helps make the language switcher do it's work before or after our plugin. Beyond that, try disabling the language switcher to see if the lang=br is removed from the URL. If so, that will help narrow down the cause.

2) We have the JFBCSocialShare module which can add all the buttons. If you don't want to use a module, then yes, the individual tags is what you'll need.

For the button width, I think it's actually the twitter width that is wrong. Try setting it to something smaller.

3) The Javascript is in our /components/com_jfbconnect/includes/jfbconnect.js file. However, there currently isn't a return value for successfully awarding AUP's, so there's no way to 'know' the AJAX call has completed and is successful. This would take a little more than just a line of code to refresh the page, but the jfbconnect.js file is where to start if you want to develop that functionality.

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

None
9 years 6 months ago - 9 years 6 months ago #48596 by none
Hi Alex,

1.
I had an in-depth look at it and I found out that the social button work fine in any Joomla content apart from SobiPro template. I get strange Brazilian language links for Twitter and LinkedIn only in SobiPro entries. To be honest I don't know why.
I added a Twitter share script to the SobiPro entry.
<a class="twitter-share-button"
  href="https://twitter.com/share">
Tweet
</a>
<script type="text/javascript">
window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);return window.twttr||(t={_e:[],ready:function(f){t._e.push(f)}})}(document,"script","twitter-wjs"));
</script>
Here you can see 2 Tweet buttons: www.tolokapu.info/index.php?option=com_s...0&Itemid=720&lang=en
JFBconnect button doesnt work, but Twitter's script does.
Twitter's script works fine. It doesnt change the language to Brazilian. My default language is English but it should not matter. I use Falang.
I tried to change the system plugin group but nothing changed. The problem remains.
Alex I sent you a PM with access to my site. Could you have a look if you have some free time? Thanks

2.
I can't add module to SobiPro template. I need to add these buttons as a snippet to the SobiPro template therefore an "all-in-one" snippet would be preferable.
I didnt add or set up width for Twitter or Google+ button at all. So I still dont understand why is that space between those 2 buttons.

3.
Thanks, we are going to check this JS file.

4.
I forgot to mention yesterday. I don't get points after sharing the page successfully by LinkedIn. Everything is ok, the shared link appears on LinkedIn as well but points are not awarded.
LinkedIn settings all ok in Alphauserpoints.
Last edit: 9 years 6 months ago by none.
The topic has been locked.
Support Specialist
9 years 6 months ago #48609 by alzander
1) JFBConnect is using the standard Joomla call JURI::getCurrent(); to get the current URL. We then do a little processing to get rid of unnecessary query string variables (like Google Analytics tags) so that the URL is not duplicated and your shares are halved across multiple, identical URLs.

Try updating the custom tag you added to look like:
<a class="twitter-share-button" 
  href="https://twitter.com/share"
  data-url="<?php echo JUri::current(); ?>">
Leave the rest intact. That will do what we're doing and simply ask Joomla what the current URL is. If that's wrong, then you'll need to contact Sobi or the Falang developers to understand why lang=br is used, since, at that point, JFBConnect is completely removed from the URL generation.

2) Gotcha. For not, however, we don't have that option. Just like with the {JFBCLogin} tag, which used to have a different tag for each network, we're planning a universal tag that will let you add the buttons for each. However, it's not available yet, so the above is what you'll need.

3) Cool, let us know how that goes.

4) Not sure why that would be happening. In the jfbconnect.js file, the function you're looking for is jfbc.social.linkedin.share. I'd recommend putting an alert in there to make sure the code is properly called. If so, then check to make sure that the points are properly setup in AUP and other configuration checks. Hopefully, it's a minor config issue. We know others have reported that it does work, but there's always the possibility of some conflict somewhere.

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

None
9 years 6 months ago #48612 by none
1. SobiPro has an XSL template. I can't use php in it. When I change Twitter code i get
Error: 500 - Cannot parse template file at /usr/templates/v2/entry/details.xsl
error.
Sobi support wont answer. Their software is free but you must buy subscription on their site to get answer in their forum. (Even if I had membership Im not sure if they could answer this.) I dont know yet what causes this problem but I would rather not pay 45 Euro to ask them.
Facebook seems working but Google+, LinkedIn, Twitter dont. They all get Brazilian links and description.

4.
Im not a programer so I can't change the code. I have someone to help me sometimes but he is away now for a week and I really would like to solve this issue.
I triple checked everything. Alphauserpoints settings all ok. The page gets shared on LinkedIn but no points rewarded. I really need some help here with these 2 problems.
I get points but Twitter and Facebook but not by LinkedIn.

Thanks
The topic has been locked.
Active Subscriptions:

None
9 years 6 months ago #48614 by none
...furthermore I checked the site with Facebook OG debugger and I get 2 different URLs.
Please check: developers.facebook.com/tools/debug/og/o...id%3D720%26lang%3Dhu

The OG url is wrong when I checked the page source. I still dont know why.
The topic has been locked.
Support Specialist
9 years 6 months ago #48628 by alzander
The reason the URL is wrong in the 2nd example, where you see 2, is because JFBConnect is setting the og:url parameter to always have the lang=br parameter. I'm still unsure why that's happening though.

Unfortunately, I've never used SobiPro before, or their template system, so I don't have a specific answer as to what's happening there either. If you can't use PHP code, there may be a way to set the proper og:url tag from the template file by using our tag. I'm not sure what parameters or variables are available in the XSL template, but if it's possible to get the correct URL from a variable, or to build it your own, in that file, you can add the following tag to the page:
{SCOpenGraph url=http://www.tolokapu.info/index.php?option=com_sobipro&pid=96&sid=2875:ix20&Itemid=720&lang=en}
Again, I don't have any specific guidance on how to do that as I'm not familiar with their system, but hopefully the above helps.

Alex
The topic has been locked.
Active Subscriptions:

None
9 years 6 months ago #48643 by none
Thanks Alex. I still need some help with my 4th problem. Im not getting points for linkedin share. I checked everything but it doesnt work for me. I send you a pm with access to my site.
The topic has been locked.
Support Specialist
9 years 6 months ago #48661 by mel
Regarding Points not being awarded when an item is Shared on LinkedIn:

After looking at your page and reproducing the issue with on my own local site, we have concluded that LinkedIn does not seem to be firing the callback notification that the share was a success. If you look at the following thread on the LinkedIn developer forums, this has been an intermittent problem that seems to be cropping up again. When we released the Alpha User Points social profile with JFBConnect 6.2, I personally tested the LinkedIn Share and received the points, but am also no longer being notified/getting points. I've put an issue on our tracker for more investigation, but I think this is just something that we're going to have to keep an eye on for LinkedIn to resolve.

developer.linkedin.com/thread/2805
The topic has been locked.
Active Subscriptions:

None
9 years 6 months ago #48662 by none
Hi Mel,

Thanks for your time and effort you put into this.
The topic has been locked.