News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Advance Facebook Like button with OpenGraph (For Each Post)

Started by Ricky., October 15, 2011, 09:50:15 AM

Previous topic - Next topic

Ricky.

Well, I gave it a good look, looks like FB creates an invisible iframe or something that causes that scroll bar, though not yet clear, once I get to know exact reason, I will fix it. Will update it here.. I guess there is not any urgency !

PLAYBOY

Time for an update... :)
FYI, If you put all the lines here, i will translate them to Turkish so you can add that to the update.

Manu.G


I installed the mod and everythings works fine the only problem I've is Internet Explorer :(

On the forum index the "Like" button isn't to see, I add the button manual because I use a copy of the Core-Theme and
modified it. I think the problem with IE are the java-scripts, there a way to much on my forum.

When I'm in a topic than the "Like" button upper the date is to see, but not when I'm on the Portal (SimplePortal 2.3.3)
or on Boradindex. Google Chrome and Mozilla showing everything perfect :)

Is there a way to solve the problem?


Next question :)
I haven't enabled "Show FB like button on each post" and it works fine, but when the topic is having more than 1 page
the "Like" button is to see on the first post of every page of the topic. Is there a way to change it?


Sorry, I'm not an English person and don't know to explain it better :)
Version SMF 2.0.8
SimplePortal 2.3.5

Ricky.

The upper part is important  as it contains call to FB Like script, so if on any page, upper script is not properly included, Like button won't work on rest of the page.

Regarding Like button on first post of second page, I had noticed it however, little short on time , will look into some work around.

So, now I have following to dos ..
1. Fix scroll bar issue,
2. On first post for second page, change link to actual post, not to whole topic.

Manu.G

The script are all included, and I think it's not a problem of the mod, it's a problem with my forum.
Could be there a way to much javascript installed and this is causing IE problems. I don't know, could be
possible.
Version SMF 2.0.8
SimplePortal 2.3.5

Ricky.


PLAYBOY

Quote
So, now I have following to dos ..
1. Fix scroll bar issue,
2. On first post for second page, change link to actual post, not to whole topic.

Option for permission settings?

Ricky.

Alright ..

1. Fix scroll bar issue,
2. On first post for second page, change link to actual post, not to whole topic.
3. Group based permission to turn it on / off.

I hope I get time soon !

PLAYBOY

"FYI, If you put all the lines here, i will translate them to Turkish so you can add that to the update."

The reason i want you to list all the lines is because i dont wanna just translate what i could find then it will be half ass job. I remember translating many mods which has lot more lines then the ones in language.modification.php

stang7043

Any chance this will be coded for 1.1.15 ? Id really like to add the like button for each post and not just for the entire thread. Any help would be appreciated.

berntan

hi ricky,

my facebook like button is not showing in my theme.
but it's showing in the default theme. i can't find anything wrong.
what's the problem?
pls advice. tks

Ricky.

Hi Berntan:

You need to make manual edit in your custom theme, somewhere in header (at your desired location), add following code:
if(!empty($modSettings['e_fb_enable']) && $context['current_action'] != 'admin'){
// Advance FB like with OG
echo '<span style="float: right; margin-top: 10px;"><div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: \'',(empty($modSettings['e_fb_appId'])?'your app id':$modSettings['e_fb_appId']),'\', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement(\'script\'); e.async = true;
    e.src = document.location.protocol +
      \'//connect.facebook.net/en_US/all.js\';
    document.getElementById(\'fb-root\').appendChild(e);
  }());
</script>
<fb:like send="false" layout="button_count" width="100" show_faces="false" font=""></fb:like></span>';

As I guess only that one is missing.


berntan

hi ricky,

i can't add within header. error occurs.
i had pm u.

thanks mate

Ricky.

I can't give you exact location as you have custom theme, code I gave you can be placed anywhere in index.template.php (but should be in header). 

Dan_y2k

Looks cool, probably WILL try this.

May I suggest (if no one suggested it yet) to move the Like & Send button to the left of the "Report to moderator" & "(IP) Logged"? Or better yet, right above them!

1 question though, can you make it language specific? I mean in the mod settings, Admin will have a text field called "Language", and he can insert his desired language? Like he_IL, in my case?

Last thing would be RTL support... Instead of floating it to the right, float it to the left...

Like I said, probably will test this, even though I prefer these suggestions will be implemented first. :)

Good job, and thanks for this mod. :)
Regards,
Dan_y2k.

PLAYBOY

1- I dont have the buttons appear on the homepage. But everytime the homepage load, it also sends/inquires connect.facebook.net

2- There is still a big blank space on the right side of the forum cause by this mod. I think this was the scroll bar issue and it still continues.

Ricky.

1- I dont have the buttons appear on the homepage. But everytime the homepage load, it also sends/inquires connect.facebook.net
Because   you theme may have missed code required to show button on top. Was there any install error for theme you are using ?

2- There is still a big blank space on the right side of the forum cause by this mod. I think this was the scroll bar issue and it still continues.
Because FB need more space then they promise to use in this widget , I have found fix for it, may need some code fixes , will do it soon.

PLAYBOY

QuoteBecause   you theme may have missed code required to show button on top. Was there any install error for theme you are using ?

I dont think so. Bu i dont remember. Its been a long time. I may have fix the error and then install the mod. But i never force to install when the error is still there.

QuoteBecause FB need more space then they promise to use in this widget , I have found fix for it, may need some code fixes , will do it soon.

Oh please. Thank you.

krash661

yeah, It does not show up on my test forum at all.And i searched everywhere for it.everything is enabled,but no show.
Version Information:
Forum version: SMF 2.0.1
Theme:Insidious by TD-Forums.
Modification Packages:
   Mod Name                                                Version    
1.    AjaxChat Integration                                3.2.2b
2.    SMF 2.0.1 Update                                            1.0
3.    Advance Facebook Like with OpenGraph    0.2    
4.    Soundcloud                                                    1.0    
5.    YouTube BBCode                                            2.6    
6.    New Hooks                                                    0.1    
7.    Quick Translation                                            0.5


Advertisement: