-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
69 lines (60 loc) · 2.04 KB
/
single.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
require_once('initial.php');
$ugid = mysql_real_escape_string($_GET['if']);
$singlegoal = getGoalText($ugid);
?>
<head prefix="og: http://ogp.me/ns# awesomeif:
http://ogp.me/ns/apps/awesomeif#">
<meta property="og:url" content="http://todaywouldbeawesomeif.com/if/<?php echo $ugid; ?>">
<meta property="og:title" content="Today would be awesome if...<?php echo $singlegoal;?>" />
</head>
<?php
require_once('header.php');
require_once('functions-single.php');
?>
<div id="single-if">
<h1 id="masthead">today would be <span class="awesome">awesome</span> if…</h1>
<div id="todays-goal"><?php echo $singlegoal; ?></div>
<?php
$goalencode = urlencode("Today would be awesome if... $singlegoal. RT to show your support! http://twbai.me/if/$ugid #twbai");
require_once('modules/share-the-awesome.php'); ?>
<div id="supporters">
<h3>we think this is awesome</h3>
<p>help spread this wish - tweet it and your support will appear below!</p>
<ul>
<?php
$tweets = getTweets($ugid);
$tweets = $tweets['results'];
//print_r($tweets);
$tweeters = array();
foreach($tweets as $tw){
$avatar = $tw['profile_image_url'];
$user = $tw['from_user'];
if(!in_array($user, $tweeters)){
$tweeters[] = $user;
echo "<li><a href='http://twitter.com/$user'><img src='$avatar' alt='$user' /></a></li>";
}
}
?>
</ul>
</div>
</div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<script>
FB.init({appId: "294829963933906", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
link: 'http://todaywouldbeawesomeif.com/if/<?php echo $ugid; ?>',
name: "Today would be awesome if... <?php echo $goaltext; ?>",
caption: 'What would make your day awesome? Post your wish on Today would be awesome if...',
// description: 'What would make your day awesome?'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>
<?php require_once('footer.php'); ?>