PHP - Moved: Facebook Like Button
This topic has been moved to Other Libraries and Frameworks.
http://www.phpfreaks.com/forums/index.php?topic=356192.0 Similar TutorialsThis topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319295.0 Hello. I have a facebook like button. It is wrapped in an iFrame. What I would like to create is a Form that when the user clicks the submit button the action is to process the Facebook like button. So pressing my button presses the facebook like button as well. Why? Because I would like to keep track of users that click the like button. This is an example of the like button. <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.likethis.com&send=false&layout=standard&width=450&show_faces=true&action=like&colorscheme=light&font&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe> I got this piece of code:
<div class="tbl tbl-facebook" id="<? echo $site->facebook;?>"> Hello! I need a little help here please! This is the end of the code on a page. It shows a pic with a gallery assigned to it. I want to attach a facebook like button to the pic, not the gallery. Since its a dynamic page I modified the like button code. But for some reason I just cant fit it in. Im kind of a novice and i didnt write this code on my own:) Oh and yes I coud stick the code right into the webpage, but its a generic site so i cant do it on every single page. So how do you say in "PHP" to put "this" on the page in "this" div tag, and where do you put it in to work properly? .... $res.="<div class=\"works\"> <div class=\"worksleft\"> <div class=\"worksimg\"> <img src=\"<resource>".$img["name"]."</resource>\" width=\"".$img["x"]."\" height=\"".$img["y"]."\" alt=\"".$mass["xtitle"]."\" title=\"".$mass["xtitle"]."\" > </div> <div class=\"workstxt\">".$tit."</div> </div> <div class=\"worksright\"> ".$gal." </div> <div class=\"clear\"></div> ".$desc." </div>"; } $result[0]["head"]=""; $result[0]["body"]=$res; return($result); } .... and this is the code i have to put in: <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo "http://" . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>&layout=button_count&show_faces=false&width=450&action=like&font&colorscheme=dark&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe> thanks very much in advance! Can somebody please explain how to properly add a Facebook Share button to my site?
It's not simply a matter of generating the button and pasting the code into my pages; in order to ensure that the right information is shared, I also have to add Open Graph metatags.
But the thing that's confusing me is that one of the required Open Graph metatags is this:
<meta property="fb:app_id" content="APP_ID_NUMBER" />Questions 1) Does this mean that I have to register as an app builder before I can add the Share button? If so, why doesn't Facebook say so on the Share button page? 2) When generating the Share button, I am asked for the "URL to share". Does this mean that I have to generate a different Share button for each page? Surely not. 3) I use ShareThis at the moment. Does ShareThis work with Facebook Insights? Hello I am using joomla with sobi2. im working in the sobi2 details template. I am having some difficulties with the like button. maybe i'm going about it all wrong but ill show you what i got and hopefully you can lend me some advise. This works <?php echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='; ?> <?php echo 'www.google.com'; ?> <?php echo '&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>'; ?> output ---- (working like button) ---- this works <?php $testv='www.google.com' ?> <?php echo $testv ?> <?php echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='; ?> <?php echo $testv; ?> <?php echo '&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>'; ?> output ------ www.google.com (working like button) ------- This doesn't work <?php $testv=$fieldsFormatted['field_street']; ?> <?php echo $testv ?> <?php echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='; ?> <?php echo $testv; ?> <?php echo '&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>'; ?> output ------- www.google.com (not working like button) -------- facebook gives me an error "The page at http://<span%20%20id=/ could not be reached." I am trying to allow a user to proceed to another page but only after a user has clicked a Facebook like button and a check has been done to check if the currently logged in user has liked the specific Facebook Page. How can I go about this? Thanks in advance This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=309715.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=349084.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=333229.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=357535.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=347238.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=325948.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=347050.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=314265.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=308101.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=322814.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=353240.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347187.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=346803.0 |