Hi,
habe versucht, eine FB App zu programmieren, funktioniert auch, bis auf die Seite, die aufgerufen wird, wenn man die Seite geliked hat. Code:
Wenn es aufgerufen wird, kommt aber nur:
Bei FB, mehr nicht. Ka, worans lietg. randim.php erzeugt ein zufälliges Bild, die Variable sollte der Link dazu in "" sein.
Bitte um Hilfe.
MfG
Mayesters
habe versucht, eine FB App zu programmieren, funktioniert auch, bis auf die Seite, die aufgerufen wird, wenn man die Seite geliked hat. Code:
PHP Code:
<?php ?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>This Page is Liked!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no" />
<style type="text/css">
body {
overflow:visible;
overflow-x:hidden;
}
</style>
<script type='text/javascript'>
window.fbAsyncInit = function() {
FB.Canvas.setSize({ width: 520, height: 1000 });
}
function sizeChangeCallback() {
FB.Canvas.setSize({ width: 520, height: 1000 });
}
</script>
</head>
<body>
<?PHP
$randomimg = "\"http://sdfsdfsdfsdfsdfds.herokuapp.com//randim.php\""
<html><body><img src=<?php $randomimg ?>></body></html>
$request['message'] = "Cool! Diese Konsole passt zu mir. Schau doch auch, welche Konsole zu dir passt!";
$request['link'] = "https://www.facebook.com/pages/XXXX-ftXXXXw/15704XXXXXXXXX86?sk=app_1XXXXXXXXXXX285";
$request['name'] = "Welche Konsole passt zu mir?";
$request['image'] = $randomimg;
$request['description'] = "https://www.facebook.com/pages/XXX-fXXw/15XXXXXXXXXXXXX6?sk=app_1XXXXXXXXXxx5";
try{
$response = $facebook->api('/me/feed',"POST",$request);
}
catch(FacebookApiException $ex){
?>
<script>window.top.location = 'http://graph.facebook.
com/oauth/authorize?cli
ent_id=<?PHP echo
$facebook->getAppId();
?>&redirect_uri=http://apps.facebook.com/XXXXXXXtapp&scope=publish_stream' </script>
<?PHP
}
?>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId : 'XXXXXXXXXXX',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
</script>
</body>
</html>
PHP Code:
> $request['message'] = "Cool! Diese Konsole passt zu mir. Schau doch auch, welche Konsole zu dir passt!"; $request['link'] = "https://www.facebook.com/pages/XXXXX-ftXXXw/1570XXXXXXXx86?sk=app_1XXXXXX5"; $request['name'] = "Welche Konsole passt zu mir?"; $request['image'] = $randomimg; $request['description'] = "https://www.facebook.com/pages/GXXXXng-fXXXXXXXXXXXXXXX6?sk=app_17XXXXXXXXXXXX85"; try{ $response = $facebook->api('/me/feed',"POST",$request); } catch(FacebookApiException $ex){ ?>
Bitte um Hilfe.
MfG
Mayesters