-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
296 lines (225 loc) · 9.91 KB
/
index.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?php
// init app-arena once, use init_session.php later...
include_once( "init.php" );
$session->app['fb_share_url'] = "https://apps.facebook.com/" . $session->instance['fb_app_url']."/fb_share.php?aa_inst_id=".$session->instance['aa_inst_id'];
$user_is_fan = false;
$user_is_fan = is_fan();
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- Facebook Meta Data -->
<meta property="fb:app_id" content="<?=$session->instance['fb_app_id']?>" />
<meta property="og:title" content="<?=$session->config['title']['value'];?>" />
<meta property="og:type" content="website" />
<meta property="og:url" content="<?=$session->instance['fb_page_url']."?sk=app_".$session->instance['fb_app_id']?>" />
<meta property="og:image" content="<?=$session->config['image']['value'];?>" />
<meta property="og:site_name" content="<?=$session->config['title']['value'];?>" />
<meta property="og:description" content=""/>
<title></title>
<meta name="description" content="">
<meta name="author" content="iConsultants UG - www.app-arena.com">
<meta name="viewport" content="width=device-width">
<!-- Include bootstrap css files -->
<style type="text/css">
<?=$session->config['css_bootstrap']['value'];?>
</style>
<script src="js/libs/modernizr-2.5.2-respond-1.1.0.min.js"></script>
</head>
<body>
<!-- Here starts the header -->
<!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
chromium.org/developers/how-tos/chrome-frame-getting-started -->
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<?php // Here you can integrate your fangate
if ($user_is_fan == false && $session->config['check_nofan']['value'] == '1') { ?>
<div class="page_non_fans_layer">
<div class="img_non_fans">
<img src="<?php echo $session->config['page_welcome_nonfans']['value']?>" />
</div>
<div id="non_fan_background"> </div>
</div>
<?php
// exit(0);
} else {
//include "templates/.phtml";
//include 'tagger.php';
}?>
<!--<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<nav>
<ul class="nav">
<li><a class="template-welcome"><?//=__p("Homepage");?></a></li>
<li><a class="template-terms"><?//=__p("Terms & Conditions");?></a></li>
</ul>
</nav>
</div>
</div>
</div>-->
<!-- this is the div you can append info/alert/error messages to -->
<div id="msg-container"></div>
<div class="custom-header">
<?php //echo $session->config['custom_header']['value']; ?>
</div>
<div id="main" class="container">
<!-- the main content is managed by initApp() -->
</div> <!-- #main -->
<div class="custom-footer">
<?php //echo $session->config['custom_footer']['value']; ?>
</div>
<!--<footer>
<div class="terms-and-conditions-container">
<?php
//$terms_and_conditions_link = "<a class='template-terms'>" . __t("Terms & Conditions") . "</a>";
//__p("This promotion is not associated to Facebook and is not promoted, supported or organized by Facebook. Please check the %s for further details", $terms_and_conditions_link);
?>
</div>
<div class="branding">
<?php //echo $session->config['footer']['value'];?>
</div>
</footer>-->
<!-- Debug area -->
<!--<span class="btn" onclick='jQuery("#_debug").toggle();'>Show debug info</span>
<div id="_debug" style="display:none;">
<h1>Debug information</h1>
<?php //Zend_Debug::dump($session->fb, "session->fb");?>
<?php //Zend_Debug::dump($session->app, "session->app");?>
<?php //Zend_Debug::dump($_COOKIE, "_COOKIE");?>
<?php //Zend_Debug::dump(parse_signed_request($_REQUEST['signed_request']), "decoded fb signed request");?>
</div>-->
<?php // include the file for the loading screen
require_once( dirname(__FILE__).'/templates/loading_screen.phtml' );
?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<!-- scripts concatenated and minified via ant build script-->
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/script.js?v5"></script>
<!-- end scripts-->
<!--<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; // Change UA-XXXXX-X to be your site's ID
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>-->
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>
<script>window.attachEvent("onload",function(){CFInstall.check({mode:"overlay"})})</script>
<![endif]-->
<div id="fb-root"></div>
<script type="text/javascript">
/** Init AppManager vars for js */
var fb_user_id='';
//defined post wall variables
var fb_share_title= '<?=$session->config["fb_share_title"]["value"]?>';
var fb_share_link= 'https://apps.facebook.com/<?=$session->instance["fb_app_url"].'/fb_share.php?aa_inst_id='.$session->instance['aa_inst_id'] ?>';
var fb_share_subtitle= '<?=$session->config["fb_share_subtitle"]["value"]?>';
var fb_share_desc = '<?=$session->config["fb_share_desc"]["value"]?>';
var fb_share_img='<?=$session->config["fb_share_img"]["value"]?>';
$(document).ready(function() {
userHasAuthorized = false;
fb_app_id = '<?=$session->instance["fb_app_id"]?>';
fb_canvas_url = '<?=$session->instance["fb_canvas_url"]?>';
aa_inst_id = '<?=$session->instance["aa_inst_id"]?>';
//alert( aa_inst_id );
tag_image = '<?=$session->config["image_tagger"]["value"]?>';
showFaces = '<?=$session->config["show_faces"]["value"]?>';
loadTags();
xCoord = 0;
yCoord = 0;
//show_loading();
//initApp();
//width = $("#img_tag").width();
//heightOff = $("#header_img").height();
/*
if( heightOff == 0 ) {
heightOff = $("#header_img").attr("height");
}
*/
$("#img_tag").click( function(e){
//alert("x:"+e.pageX+" - y:"+e.pageY+"\noffX:"+this.offsetLeft+" - offY:"+this.offsetTop);
heightOff = $("#header_img").height();
//$("#_debug").html("offset height: " + heightOff);
// get the mouse-coords where the user clicked the image
xCoord = ( e.pageX - this.offsetLeft );
yCoord = ( e.pageY - heightOff );
authUser( xCoord, yCoord );
});
});
window.fbAsyncInit = function() {
if( typeof( fb_app_id ) == "undefined" ) {
fb_app_id = '<?=$session->instance["fb_app_id"]?>';
}
FB.init({
appId : fb_app_id, // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
oauth : true
});
FB.Canvas.setAutoGrow();
//FB.Canvas.setSize({ width: 640, height: 1800 });
// Additional initialization code here
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// the user is logged in and connected to your
// app, and response.authResponse supplies
// the users ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
fb_user_id = response.authResponse.userID;
fb_user_name = response.authResponse.userName;
fb_status = "connected";
var fb_accessToken = response.authResponse.accessToken;
userHasAuthorized = true;
// get user name
FB.api('/me', function(response) {
fb_user_name = response.name;
});
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
//but not connected to the app
//alert("not connected");
fb_status = "not_authorized";
} else {
// the user isn't even logged in to Facebook.
fb_status = "not_logged_in";
}
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/de_DE/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<!-- Show admin panel if user is admin -->
<?php // Show admin panel, when page admin
if (is_admin()) {
//include_once 'admin/admin_panel.php';?>
<?php } ?>
<div id="_debug"></div>
<?php if ($user_is_fan == true || $session->config['check_nofan']['value'] != '1'): ?>
<div id="header">
<img id="header_img" src="<?=$session->config['image_header']['value']?>" />
</div>
<div id="imgMain" style="position:relative;">
<div id="image1">
<img id="img_tag" src="<?=$session->config['image_to_tag']['value']?>" />
</div>
<div id="image2">
<img src="<?=$session->config['image_notag']['value']?>" />
</div>
</div>
<?php endif; ?>
</body>
</html>