View previous topic :: View next topic |
Author |
Message |
mastermindzorg webmaster
Joined: Dec 04, 2010 Posts: 6
|
Posted: Fri Jan 07, 2011 1:19 am Post subject: Facebook like box |
|
|
Here is the FaceBook like code I used on my site.
Code:
$uri1 = urlencode("http://".$_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
// Code By MasterMind of MasterMindz.org
$str = <<<STR
<iframe src="http://www.facebook.com/plugins/like.php?href=$uri1&layout=button_count&show_faces=false&width=125&action=recommend&font=tahoma&colorscheme=light&height=30" scrolling="no" frameborder="0" style="border:none; width:110px; height:24px" allowTransparency="true"></iframe>
STR;
$str2 = <<<STR
<iframe src="http://www.facebook.com/plugins/like.php?href=$uri1&layout=standard&show_faces=true&width=300&action=like&colorscheme=light&height=10" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:24px;" allowTransparency="true"></iframe>
STR;
echo $str;
echo $str2;
|
|
|
Back to top |
|
|
kguske Site Admin
Joined: May 12, 2005 Posts: 876
|
Posted: Wed Jan 12, 2011 9:30 pm Post subject: |
|
|
Interesting. Did you add this to the content page and other sections of your site? _________________ |
|
Back to top |
|
|
mastermindzorg
|
Posted: Thu Jan 13, 2011 12:19 am Post subject: Yes I added it |
|
|
Yes I added this script to the downloads, content, and the news module. It works great! |
|
Back to top |
|
|
Guardian webmaster
Joined: Dec 25, 2005 Posts: 364 Location: Vsetin, Czech Republic
|
Posted: Mon Jan 17, 2011 7:05 pm Post subject: |
|
|
I'm using something similar for my News module but it doesn't use IFRAME - I just spent 2 days cleaning someones site that got hacked through the use of an iframe to a 'trusted' site - every single file had to be cleansed and I'm still not finished. |
|
Back to top |
|
|
sortilege2021 webmaster
Joined: Dec 02, 2010 Posts: 5
|
|
Back to top |
|
|
Guardian
|
Posted: Mon Feb 14, 2011 12:09 pm Post subject: |
|
|
Just to let you know, I used the iframe code on a static page website and experienced a worrying issue.
I then tried the same code at CodeAuthors and was able to replicate the 'problem'. It might just be coincidence but it is worth mentioning.
When viewing a page with the 'Like' button iframe code, navigate away and then hit your browser 'back' button.
In both cases, on two different websites, the 'Like' button had now been replaced by a banner advert.
*Edit* for additional comment. I reviewed the HTML page source code and everything seems fine, so this seems to confirm the iframe has a problem. |
|
Back to top |
|
|
mastermindzorg
|
Posted: Mon Feb 14, 2011 1:29 pm Post subject: |
|
|
I cant get the issue to replicate what browser are you using? |
|
Back to top |
|
|
Guardian
|
Posted: Mon Feb 14, 2011 3:40 pm Post subject: |
|
|
Firefox 3.6.13 though I cannot see how it might be browser lated it is possible I guess.
Both sites used jQuery but that is about the only common thing between the two sites. The code I used was lacking your first line of code because the url link is created differently but it was rather disconcerting that it would happen on two unrelated sites.
Since IFRAME doesn't validate for (x)HTML compliance I only used it as a temporary thing any way. |
|
Back to top |
|
|
mastermindzorg
|
Posted: Mon Feb 14, 2011 7:45 pm Post subject: |
|
|
see how this works for you maybe better?
Code:
$str = <<<STR
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"</script>
<fb></fb>
STR;
echo $str;
|
The code Above needs to look like the below inside the <>
fb:like
/fb:like |
|
Back to top |
|
|
Guardian
|
Posted: Tue Feb 15, 2011 3:38 am Post subject: |
|
|
Yes, that uses the FB API, which may be better.
I'm currently using Disqus now on one site which has built in support for Facebook 'Like' and Twitter etc |
|
Back to top |
|
|
montego webmaster
Joined: Dec 26, 2005 Posts: 254
|
Posted: Tue Feb 15, 2011 6:20 am Post subject: |
|
|
Just curious Guardian, does it like/Tweet the whole page or just the comment? _________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
Back to top |
|
|
Guardian
|
Posted: Tue Feb 15, 2011 7:06 am Post subject: |
|
|
Disqus Tweets the actual content page, so for example at the bottom of this article in what appears to be the last comment box
http://www.code-authors.com/article165.html#disqus_thread
You can see it Tweeted for the article page url.
Disqus calls Tweets and Facebook 'Likes' as 'Reactions'
Since Disqus comments use the url as the unique identifier, it works really, really well. |
|
Back to top |
|
|
Guardian
|
Posted: Tue Feb 15, 2011 7:13 am Post subject: |
|
|
Correction to the above.
The whole page can be Like or Tweeted because it uses the page URL but I just noticed that individual comments (that are NOT your own comments) can also be Liked.
There is an additional setting at Disqus to Tweet your own comments but I have not looked at it yet. |
|
Back to top |
|
|
GazJ webmaster
Joined: Mar 20, 2007 Posts: 29
|
Posted: Wed Mar 30, 2011 12:41 am Post subject: |
|
|
|
|
Back to top |
|
|
|