PHP - How Does This Site Work? Facebook Share Post Image
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 :/ Similar TutorialsI 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. 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? This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=347238.0 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! 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 Hi all, I am a beginner for PHP. I created a site & now I want to add a wall post to my Facebook Page. This post should be posted via PHP when I add a post to my site, without manually adding that on Facebook Page. I referred Facebook Developer documentations, but those are really mess for me. I really don't want this to do with php-sdk or any other. I want to do this manually. Thanks I am working on a website where I have comments posted by users. I want to display 25 comments and if there are more, it will show a linke Older Posts similar to Facebook. Once I click on that, it will list down the next 25 comments and so on. This is something we can see in Facebook. Do you have any idea where I can find this script. I did search on google but couldn't find it. Probably bad keyword selection. any ideas for the resource. Thanks, Faisal I'm wondering if anyone can help me find/create a script which allows a preview of a link to be generated? Basically I need a user to be able to simply enter a url and click submit and then a preview of that link will be shown in the form of some text and an image. Very similar to what Facebook does when a user shares a link. I think they use the description tag of the site in general. Can anyone point me in the right direction in doing this? I need to be able to do it in php/javascript alone without the use of jquery or plugins. Hello, Have a question that i hope some one can help me answer. I have started creating a facebook app that will translate lovepoems. The problem im having is that facebook redirects everything wrong, which makes my life a living hell. So what i thought is it's possible to while submitting the form and the user gets redirected to the facebook allow app page, wait with submitting the form or maybe bring the post id with me and then post the content to the db liked to the post from a different page. simply so i don't have to make the accept form and then go to the actual content? So I'm using Wordpress as default CMS system if that helps. This is the code. Code: [Select] <?php /* Template Name: Febuary Love testing app */ ?> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Wayne Nolting (w.nolting@home.com) --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function verify() { var themessage = "You are required to complete the following fields: "; if (document.form.title.value=="") { themessage = themessage + " - Title"; } if (document.form.description.value=="") { themessage = themessage + " - Poem"; } if (document.form.post_tags.value=="") { themessage = themessage + " - Keywords"; } //alert if fields are empty and cancel form submit if (themessage == "You are required to complete the following fields: ") { document.form.submit(); } else { alert(themessage); return false; } } // End --> </script> <?php add_filter('fb_php_sdk_load','your_filter'); function your_filter($array) { $array[] = '2.1.2'; //exact version number you need return $array; } $facebook = new Facebook(array( 'appId' => '179200268852090', 'secret' => '3b62bc6b207e4038aa56a28bfc5ed368', 'cookie' => true, )); $session = $facebook->getUser(); if (!empty($session)) { try{ $user = $facebook->getUser(); $user = $facebook->api('/me'); } catch (Exception $e){ } if (!empty($user)) { } else die ("An error occured"); } else{ $loginUrl = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 0, 'scope' => 'offline_access, publish_stream' )); echo "<a href='".$loginUrl."'>Click </a> to add the Copypanther Facebook application"; } ?> <?php $user = $facebook->getUser(); if($user){ $access_token = $facebook->getAccessToken(); } ?> <?php if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == "new_post") { // Do some minor form validation to make sure there is content if (isset ($_POST['title'])) { $title = $_POST['title']; } else { echo 'Please enter the Poem name'; } if (isset ($_POST['description'])) { $description = $_POST['description']; } else { echo 'Please enter some notes'; } $tags = $_POST['post_tags']; $access_token = $_POST['access_token']; $user = $_POST['user']; // ADD THE FORM INPUT TO $new_post ARRAY $new_post = array( 'post_title' => $title, 'post_content' => $description, 'post_category' => array($_POST['cat']), // Usable for custom taxonomies too 'tags_input' => array($tags), 'post_status' => 'draft', // Choose: publish, preview, future, draft, etc. 'post_type' => 'post', //'post',page' or use a custom post type if you want to 'access_token' => $access_token, 'user' => $user, ); //SAVE THE POST $pid = wp_insert_post($new_post); add_post_meta($pid, 'access_token', $access_token, true); add_post_meta($pid, 'user', $user, true); //SET OUR TAGS UP PROPERLY wp_set_post_tags($pid, $_POST['post_tags']); //REDIRECT TO THE NEW POST ON SAVE $link = get_permalink( $pid ); wp_redirect('http://www.ngee.se'); } // END THE IF STATEMENT THAT STARTED THE WHOLE FORM //POST THE POST YO do_action('wp_insert_post', 'wp_insert_post'); get_header(); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div class="form-content"> <?php the_content(); ?> <!-- WINE RATING FORM --> <div class="wpcf7"> <h2>Share some February Love!</h2> <p>Although the 14th of February might and should be dedicated to your loved one, we think that friends, bosses and coworkers deserve some affection, too. So between the 1st and 13th of February we will translate a poem or message from you to them <em>for free</em></p> <form id="new_post" name="new_post" method="post" action="" class="wpcf7-form" enctype="multipart/form-data"> <!-- post name --> <fieldset name="name"> <label for="title">Love poem name:</label> <input type="text" id="title" value="" tabindex="5" name="title" /> </fieldset> <!-- post Category --> <fieldset class="category"> <label for="cat">Translate to:</label> <?php wp_dropdown_categories( 'tab_index=10&taxonomy=category&hide_empty=0' ); ?> </fieldset> <!-- post Content --> <fieldset class="content"> <label for="description">Love poem:</label> <textarea id="description" tabindex="15" name="description" cols="80" rows="10"></textarea> </fieldset> <!-- post tags --> <fieldset class="tags"> <label for="post_tags">Keywords (comma separated):</label> <input type="text" value="" tabindex="35" name="post_tags" id="post_tags" /> </fieldset> <SCRIPT LANGUAGE="JavaScript"> function testResults (form) { var TestVar = form.submit(); } </SCRIPT> <fieldset class="submit"> <input type=button value="Send" value="Send" tabindex="40" id="submit" name="submit" onclick="verify();"> </fieldset> <fieldset class="access_token"> <label for="access_token"></label> <input type="text" value="<?php echo $access_token;?>" id="access_token" name="access_token"/> </feildset> <fieldset class="user"> <label for="user"></label> <input type="text" value="<?php echo $user;?>" id="user" name="user" /> </feildset> <input type="hidden" name="action" value="new_post" /> <?php wp_nonce_field( 'new-post' ); ?> </form> </div> <!-- END WPCF7 --> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-content --> </div><!-- #post-## --> <?php endwhile; // end of the loop. ?> <?php get_footer(); ?> Any one have any idea about how i can solve this problem ? Answers most appreciated! Best Regards GrundeLL EDIT *** I'm using facebook PHP SDK hello dear friends if we want to put a facebook-fanbox on a wordpress-page - so that it looks like this he http://www.designche...ial-media-tabs/ we can go like so: we take the test from the facebook-deeloper site: https://developers.f...e-box-for-pages Initialize the JavaScript SDK using this app: books-page... <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=473241986032774&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> Include the JavaScript SDK on your page once, ideally right after the opening <body> tag. or do i need to inclue this <div class="fb-like-box" data-href="https://www.facebook.com/FacebookDevelopers" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>` love to hear from you This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319295.0 Hi,
I have a page whihc gets Daily motion URL from another page and also location of Image.
I have Face book share button on this page and want to show my inage while trying to share on FB.
unfortunatley face book picks something wrong , and I use Open Graph Debug library then temporarily this picture issue gets resolved but it re-occures again if another URL is selected for sharing purpose.
Code written in header of my page:
<meta property="og:title" content="Greate Web SIte"/> <meta property ="og:url" content="http://www.MySIte.co...howMovie.php"/> <meta property ="og:type" content="website"/> <meta property="og:image:width" content="200" /> <meta property="og:image:height" content="200" /> <?php $selectedImage=$_GET['selectedImg']; // this param is passed from qry string whihc is sent by a previos page, I want to change this param every time parent page sends a request of new image. $ImageAddress='http://www.mySIte.com/'.$selectedImage; //creating URL of image , if i paste this URL in browser , image is fetched successfully. echo '<meta property="og:image" content="'.$ImageAddress.'"/>'; ?> <meta property="og:site_name" content="my Heading"/> <meta property="og:description" content="Bla Bla bla."/> Following is the java script that I have pasted under body tag: <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> following is button for FB sha echo '<div class="fb-post" data-href="'.$pageURL.'" data-width="500"></div>'; // URL that is passed as qry stirng are passed here. kindly do let me know that how can I display the exact image on every attelp to share something. I have sort of an odd request. I wish make a POST to roblox.com with the Xsrf token, let me give you what code might help then ill explain more.
So, I need to parse the page http://www.roblox.co...spx?gid=1039951 to get
the token, which is between the (' ') below (this is taken from the site, as an example and the token changes each time the page refreshes/changes.
<script type="text/javascript">Roblox.XsrfToken.setToken('IVzHt8XOUJpy');</script>After you get the token, I need to make a post with that token to http://www.roblox.co...nge-member-rank with the variables: groupId= newRoleSetId= , targetUserId= , X-CSRF-TOKEN: IVzHt8XOUJpy, X-Requested-With: XMLHttpRequest I also might need to log in? which I think is done like so: POST https://m.roblox.com/Login HTTP/1.1 Host: m.roblox.com Content-Length: 29 Content-Type: application/json {"username":"","password":""}but I am not sure, that is just something I found during my research. I know this is possible, I have seen it done multiple times in the past, and I think I have something going... Just not sure how to put it all together... Hi, Im creating a facebook app and I want to be able to grab the users full size profile picture and save it locally. Apparently you can do it with this code : Code: [Select] <script> FB.api('/me/albums', function(response) { for (album in response.data) { if (response.data[album].name == "Profile Pictures") { FB.api(response.data[album].id + "/photos", function(response) { image = response.data[0].images[0].source; }); } } }); </script> Sorry if this is a stupid question but how would I echo out the image path after funning that ? Im only used to working with php. Thanks, Scott. Hi guys, what I'm struggling to do is 1) Users land on https://www.mysite.com/login.php 2) Users type their email and password 3) POST data submitted to http://www.3rdparty.com/login.php with cURL 4) Users redirected to http://www.3rdparty.com/index.php (logged in). I've been using this simple form to POST directly to the 3rd party site. Code: [Select] <form name="loginform" method="post" target="_blank" action="http://www.3rdparty.com/login.php"> Email <input name="email" type="text"> Password<input name="password" type="password"> <input name="submit" type="submit" id="loginbutton" value="login"></form> This works great. But now I've installed a SSL on my site and I've just realised that using the form above, the data is still POSTed as a plain text because the 3rd party site is not https. So I want to submit the form to my login.php form and let this form take the users to the 3rd party site. So at least the user inputs to my site is encrypted. My new code looks like this. Code: [Select] <form name="loginform" method="post" target="_blank" action="login.php"> Email <input name="email" type="text"> Password<input name="password" type="password"> <input name="submit" type="submit" id="loginbutton" value="login"></form> <?php if(isset($_POST['email'])) $email= $_POST['email']; if(isset($_POST['password'])) $password= $_POST['password']; if(isset($_POST['submit'])) $submit = $_POST['submit']; $Curl_Session = curl_init('http://www.3rdparty.com/login.php'); curl_setopt ($Curl_Session, CURLOPT_POST, 1); curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, "email=$email&password=$password&submit=$submit"); curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec ($Curl_Session); curl_exec ($Curl_Session); curl_close ($Curl_Session); print $result; ?> What this code is doing now is it's just rendering the www.3rdparty.com's login page (not logged in) on my site. When I type wrong values, it renders www.3rdparty.com's login page with an error message on it. So I think at least the values are being POSTed but it doesn't log me in. All of the cURL codes available out there seem to POST the data and fetch some results back not redirecting the users to another site. My ultimate goal is to POST the form and redirect the users to the 3rd party site's member area as well. I tried header("Location: http://www.3rdparty.com/index.php"); but it just takes user to that page without being logged in. Could anyone give me some hints? Hi all, Thanks for reading. I'm hella frustrated at this script I wrote: for some reason, it will not work correctly. Basically, it works. The first 4 names in the table on the database show up when searched. But, anything past these four names in the database will not show up as a result when searched! I'm pulling my hair out here! It's really simple - take a gander: Code: [Select] if (isset($_POST['submit'])) { $search = $_POST['search']; $searchQuery = mysql_query("SELECT * FROM Accounts WHERE FullName='$search'"); if (mysql_num_rows($searchQuery) == 0) { $result = "Your search returned no results. Please try again."; } else { $results = 1; while ($getSearchResults = mysql_fetch_array($searchQuery)) { $fullName = $getSearchResults['FullName']; $result = "Name: ".$fullName.""; } } } ?> ...and the HTML form... Code: [Select] <form action="search.php" method="post"> <p>Search: <input type="text" name="search" size="35" maxlength="100" /></p> <p><input type="submit" value="Search" name="submit" /></p> <?php echo $result; ?> </form> Does anyone have any ideas? I've been out of coding for about 4 years. My client called and said that they upgraded his server and now nothing works. I've don't done some reading and see that there are changes to queries. I originally wrote the program using mysql_query which is now deprecated replaced with MySQLi and PDO_MySQL which I thought would be that simple. Apparently not. My code is below. The error I get is Fatal error: Call to undefined function MySQLi() in /home1/zipclick/public_html/marketingteamates.com/_ZABP_merchants/main-w.php on line 304 which leads me to believe that the upgrade is now solely object oriented.
$result = MySQLi( "SELECT * FROM $users WHERE username = '$username'" ) or die("SELECT Error: ". mysqli_errno()); $num_rows = mysqli_num_rows($result); while ($row = mysqli_fetch_array($result)) { extract($row); }
Hi everyone,
I have just created this affiliate sub-page where I compare webhosting providers in Denmark.
Page: Sammenligning af webhoteller
All links for all hosting providers are affiliate links.
Do you think this is a good approach and is the text ok? (use google translate)
In other words, do you think people will click and possibly ean me a comission?
Thanks for the feedback!
Edited by Stiver112, 21 July 2014 - 03:30 PM. |