PHP - Moved: Problem With Facebook Share
This topic has been moved to Other Libraries and Frameworks.
http://www.phpfreaks.com/forums/index.php?topic=347238.0 Similar TutorialsCan 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? I have placed the Facebook LIKE/SHARE buttons on a website using the following:
<div class="fb-like" data-href="http://mysite.com" data-layout="standard" data-action="like" data-show-faces="false" data-share="true" data-width="280px"></div>the LIKE button works fine. the SHARE button works but i cannot seem to customize and of the values such as which image to include. i have the following in my HEAD section but it does nothing. do i need to create an APP and reference the ID? any help is much appreciated <meta property="og:type" content="website" /> <meta property="og:title" content="Can tea make for a happy marriage" /> <meta property="og:url" content="http://mysite.com/index.php" /> <meta property="og:image" content="http://mysite.com/pics/gallery/2.jpg" /> Edited by BuildMyWeb, 28 September 2014 - 05:18 PM. after spending many hours thinking this through and not really getting anywhere, trying to figure out how this site works, so that i can replicate it and make a single image from multiple images that are positioned overlaying with css positioning
the site in question is: http://www.dahippo.c...6360ZZ0ZZ0ZZ0ZZ
it is a type of calculator for an online game, the part that interests me is the image of the ship that is built up from many images
is also uses a php script to place all these images into on image file outputted to html, this is what interests me and i am trying to recreate, like he http://www.dahippo.c...6360ZZ0ZZ0ZZ0ZZ
here is the outputted html:
<html> <head> <meta name="viewport" content="width=device-width, minimum-scale=0.1"> <title>get.php (635x317)</title> </head> <body style="margin: 0px;"> <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;" src="http://www.dahippo.com/bp/ship/get.php?image=4J01Q180O0K0E013C3A3C3A3636360ZZ0ZZ0ZZ0ZZ" width="408" height="204"> </body> </html>what php code used in the get.php script make all these images with css positioning into 1 image? i have asked the site owner, and got no reply :/ Hi all, I'm not great with PHP and I have this one problem that I hope you can help with. I have a script that generates an URL. The output string is $shorturl and displays properly when I echo it using Code: [Select] <?php echo '$shorturl' ?>. However, when I try the following script for a Facebook share button Code: [Select] <fb:share-button> <a name="fb_share" type="button" share_url="<?php echo '$shorturl' ?>" href="http://www.facebook.com/sharer.php" layout="button_count">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> </fb:share-button> The resulting URL it produces is: http://</?php+echo+%27http%3A%2F%2Fshelb... Any idea's? Thank you! This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=309715.0 I have been trying to replicate the facebook "share" functionality , well actually i was in need of this functionality even before i knew that fb already had it.. I learnt a few things that this can be achieved by using the "Curl" and I also hear that this setting may have been switched in some servers so if anyone can refer me to other options that would always fetch me the - Title- Description- Images for sure I' d be thankful Regards Hi every one I want to share a page content(or an article) into my facebook page via php . How should I do that ? Thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=349561.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 Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=356192.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=357535.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319295.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 I have this code curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_URL, $link); $wall = curl_exec($ch); but the $link is a facebook wall page that takes a couple of seconds to load fully. and you have to scroll down the page before more loads or you have to click older posts when i run the script the $wall doesnt have the full page. Is there a way that i can delay the $link from saving the file so that it reads more of the page?? My game on facebook is being displayed in the facebook application iframe. When users register in firefox or google chrome everything is fine and to a certain extent in IE as well. However, when logging into the game, through the browsers the game loads fine except when loaded in IE.... Basically i am using a session to state that the game is currently in facebook mode: Code: [Select] <?php session_start(); $_SESSION['isface'] = 1; include("game.php"); ?> All is good until it hits this code: Code: [Select] <html> <frameset cols="130" noresize border=0> <frame src="nav.php" name="nav"> <frame src="hq.php" name="main"> </frameset> </html> The frames then output error message: Code: [Select] <?php if ($isface !="1") { if (sha1($info[4]) != $pass) { mysql_close(); echo $isface; die("<br><br><center><body bgcolor='#000000'><b><font color='#FFFFFF' face='Verdana' size='2pt'>{$isface} Your username cannot be found or password doesnt match</font></b></center></body></html>"); } } ?> essentially the game is using cookies for authentication on the main site, but since this is facebook this is not needed so it SHOULD skip this check and proceed with using the facebook details as the login. this is only happening in IE... i dont get it. any ideas? Hi i have a facebook login social plugin made but my ? is why do i get symbols in my url link ?. I login with the plugin to facebook but when page returns me back to my site i have symbols at the end of url. Like this http://www.games-flash.co.uk/#_=_ Ps sry if i have made this post in wrong section. Hey there I'm trying to gather a users Facebook info and use that to create a user account for them on my database. My code works perfectly for the first person who links his Facebook account with my site and adds all the user info to the database. After that with any other users it will display the logged in Facebook users name with their profile pic. The problem arises when it tries to add this person to the mysql database. It returns the error "An error has occurred and we are unable to sync your Facebook account." Before the <head> Code: [Select] <?php define('FACEBOOK_APP_ID', 'imagine_app_id_here'); define('FACEBOOK_SECRET', 'imagine_secret_here'); function get_facebook_cookie($app_id, $application_secret) { $args = array(); parse_str(trim($_COOKIE['fbs_' . $app_id], '"'), $args); ksort($args); $payload = ''; foreach ($args as $key => $value) { if ($key != 'sig') { $payload .= $key . '=' . $value; } } if (md5($payload . $application_secret) != $args['sig']) { return null; } return $args; } $cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET); ?> In the <body> Code: [Select] <?php if ($cookie) { //###cookie is set, user is logged in $user = json_decode(file_get_contents('https://graph.facebook.com/'.$cookie['uid'])); define('INCLUDE_CHECK',true); require("connect.php"); $fbookid = $user->{'id'}; $fbookname = $user->{'name'}; $query = mysql_query("SELECT * FROM tz_members WHERE facebook_id='$fbookid'"); $numrows = mysql_num_rows($query); if ($numrows == 1){ echo "<font color='#FF0000'>You are logged in through Facebook.</font>"; } else { mysql_query("INSERT INTO tz_members(facebook_id,usr,regIP,dt) VALUES( '".$fbookid."', '".$fbookname."', '".$_SERVER['REMOTE_ADDR']."', NOW() )"); $query = mysql_query("SELECT * FROM tz_members WHERE facebook_id='$fbookid'"); $numrows = mysql_num_rows($query); if ($numrows == 1){ echo "<font color='#FF0000'>Your Facebook account has been synced with our user database.</font>"; } else { echo "<font color='#FF0000'>An error has occured and we are unable to sync your Facebook account.</font>"; } mysql_close(); } echo '<img src="http://graph.facebook.com/'.$user->{'id'}.'/picture" alt="'.$user->{'name'}.'"/>'; echo $user->{'name'}; echo '<fb:login-button perms="email,user_birthday" onlogin="window.location.reload(true);" autologoutlink="true"></fb:login-button>'; } else { //###user is not logged in, display the Facebook login button echo '<fb:login-button perms="email,user_birthday" autologoutlink="true"></fb:login-button>'; } ?> Javascript: Code: [Select] <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({appId: '<?= FACEBOOK_APP_ID ?>', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); }); </script> Any help would be greatly appreciated! |