You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.8 KiB
PHP
57 lines
1.8 KiB
PHP
<!-- Copyright 2008 Neil Edelman, distributed under the terms of the
|
|
GNU General Public License, see copying.txt -->
|
|
<div style = "text-align: right;">
|
|
<a href = "http://www.facebook.com/apps/application.php?id=45884241760">about</a> |
|
|
<a href = "news.php">feed sex</a> |
|
|
<a href = "stats.php">statistics</a> |
|
|
<a href = "help.html">help</a> |
|
|
<a href = "privacy.html">privacy</a>
|
|
</div>
|
|
<h1>Sex Centre</h1>
|
|
<?php
|
|
require_once 'fb/facebook.php';
|
|
require 'sex.php';
|
|
$apikey = 'd35c4d090afad9b89dc6f50edab81b95';
|
|
$secret = '1252a1a9dadb492f70a278eebd31ef73';
|
|
$fb = new Facebook($apikey, $secret);
|
|
$user = $fb->require_login();
|
|
$old = SexExtract($fb->api_client->profile_getFBML($user));
|
|
|
|
// if 'update' then the form has been self-referencing submitted
|
|
if(isset($_POST['update'])) {
|
|
$pos = $_POST['update'];
|
|
// change the box
|
|
$box = '<div style = "text-align: right;">'.
|
|
'<a href = "http://apps.facebook.com/sexfuck/">sex centre</a>'.
|
|
'</div>'.
|
|
'<div style = "text-align: center;">'.
|
|
'<img src = "http://www.cs.mcgill.ca/~nedelm/sex/stuff/'.$pos.'.jpg?!" width = 128 height = 128>'.
|
|
'</div>';
|
|
try {
|
|
$fb->api_client->profile_setFBML(null, $user, $box, null, null, $box);
|
|
} catch(FacebookRestClientException $e) {
|
|
echo '<p>FacebookRestClientException (oh no!): '.$e->getMessage().'<p>';
|
|
}
|
|
// update stats
|
|
SexLoad();
|
|
SexChange($old, $pos);
|
|
SexSave();
|
|
$old = $pos;
|
|
}
|
|
|
|
// echo pos'n
|
|
if(isset($old)) {
|
|
echo '<div style = "text-align: center;">'.
|
|
'<img src = "http://www.cs.mcgill.ca/~nedelm/sex/stuff/'.$old.
|
|
'.jpg" width = 128 height = 128></div>';
|
|
} else {
|
|
echo '<p>No position selected.</p>';
|
|
}
|
|
|
|
// menu
|
|
echo '<div style = "text-align: center;">';
|
|
SexInterface();
|
|
echo '</div>';
|
|
?>
|
|
<p style = "text-align: center;"><fb:add-section-button section="profile"/></p>
|