forked from elsplatto/hcf-btw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.php
258 lines (224 loc) · 7.65 KB
/
404.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
<?php
$pageMetaTitle = "Beyond the Wharf - Sydney Harbour, Sydney Activities, Sydney Ferries";
$pageSection = "home";
$pageMetaDesc = "Beyond the Wharf provides local and international insights to Sydney Harbour.";
include 'includes/head.php';
/*global includes in head.php*/
?>
<body>
<?php
include 'includes/nav.php';
?>
<section class="featureImgHolder">
<img src="img/featureImages/harbourPano-2.jpg" />
<div class="headerHolder">
<h2 class="sub">You lost?</h2>
<h2>Want to find something to do?</h2>
<p style="color: #fff; ">Visit our <a href="<?=$baseURL?>" style="text-decoration: underline; color: #fff">homepage</a> or use the nav and/or search box above.</p>
</div>
<a href="#" id="creditToggle" data-target="featureCreditPanel" class="triggerContainer" title="Click here for photo credits">
<div class="flip-container">
<div class="flipper">
<div class="cameraIcon"></div>
<div class="closeIcon"></div>
</div>
</div>
</a>
<div id="featureCreditPanel" class="creditPanel">
<span class="latLng">33.8368 S, 151.2811 E</span>
<span class="location">MINER'S POINT</span>
<span class="routes darling">Darling Harbour</span>
<span class="credit">Photo by David Jones</span>
<span><a href="#" target="_blank" rel="nofollow">Visit David's Gallery</a></span>
</div>
</section>
<?php
include 'includes/footer.php';
?>
<script>
$(document).foundation({
orbit: {
animation: 'slide', // Sets the type of animation used for transitioning between slides, can also be 'fade'
timer_speed: 10000 ,
pause_on_hover: false,
animation_speed: 500,
navigation_arrows: false,
bullets: false,
slide_number: false
}
});
$(function() {
if ($('#creditToggle').length > 0)
{
$('#creditToggle').animate({
right: 0,
easing: 'easeOut'
}, 200);
}
$('body').on('click', '#creditToggle', function(e)
{
e.preventDefault();
var target = $('#'+$(this).attr('data-target'));
var targetLeft = target.offset().left;
var targetWidth = target.outerWidth();
var windowWidth = $(document).width();
if (targetLeft >= windowWidth)
{
target.animate({
left: windowWidth - targetWidth
});
$(this).addClass('flip');
}else{
target.animate({
left: windowWidth + targetWidth
});
$(this).removeClass('flip');
}
});
$('body').on('click','a.userLikes', function(e){
e.preventDefault();
var url = $(this).attr('data-url');
var el = $(this);
$.ajax({
type: 'POST',
url: url,
beforeSend: function()
{
beforeLikeSendHandler(el);
},
success: function(data)
{
unLikeSuccessHandler(data);
}
});
});
$('body').on('click','a.userNoLikes', function(e){
e.preventDefault();
var url = $(this).attr('data-url');
var el = $(this);
$.ajax({
type: 'POST',
url: url,
beforeSend: function()
{
beforeLikeSendHandler(el);
},
success: function(data)
{
likeSuccessHandler(data);
}
});
});
function beforeLikeSendHandler(el) {
var mediaId = el.attr('data-mediaId');
var triggerLikesCount = el.attr('data-likesCount');
if (el.hasClass('userNoLikes'))
{
//console.log('you clicked to like');
//switch urls
el.attr('data-url','<?=$mediaUnLikeURL?>?media_id='+mediaId);
//change classes on heart icon
$('.userNoLikes[data-mediaId="'+mediaId+'"]').each(function(i){
$(this).removeClass('userNoLikes').addClass('userLikes');
});
//update count data and text
$('[data-mediaId="'+mediaId+'"][data-likesCount]').each(function(i){
var newCount = parseInt('0'+$(this).attr('data-likesCount'))+1;
var newCountText = likeNumberFormatter(newCount);
$(this).attr('data-likesCount',newCount);
var hasAttr = $(this).attr('data-displayCount');
if (typeof hasAttr !== 'undefined' && hasAttr !== false)
{
$(this).text(newCountText);
}
});
$('p.commentsShoutout').each(function(i) {
var existingHTML = $(this).html();
if ($(this).text().toLowerCase().trim() == '')
{
$(this).html('<a href="http://instagram.com/<?=$instagramUsername?>" target="_blank">You</a> like this.');
}
else if (parseInt('0'+triggerLikesCount) == 1)
{
$(this).html('<a href="http://instagram.com/<?=$instagramUsername?>" target="_blank">You</a> and '+ existingHTML);
}
else if (parseInt('0'+triggerLikesCount) > 1)
{
$(this).html('<a href="http://instagram.com/<?=$instagramUsername?>" target="_blank">You</a>, '+ existingHTML);
}
});
}
else
{
//console.log('you clicked to unlike');
//switch urls
el.attr('data-url','<?=$mediaLikeURL?>?media_id='+mediaId);
$('.userLikes[data-mediaId="'+mediaId+'"]').each(function(i){
$(this).removeClass('userLikes').addClass('userNoLikes');
});
$('[data-mediaId="'+mediaId+'"][data-likesCount]').each(function(i){
var newCount = parseInt('0'+$(this).attr('data-likesCount'))-1;
var newCountText = likeNumberFormatter(newCount);
$(this).attr('data-likesCount',newCount);
var hasAttr = $(this).attr('data-displayCount');
if (typeof hasAttr !== 'undefined' && hasAttr !== false)
{
$(this).text(newCountText);
}
});
//@TODO: fix you text removal
$('p.commentsShoutout').each(function(i) {
//console.log('['+$(this).text().toLowerCase().trim()+']');
var existingHTML = $(this).html();
$(this).css({
outline: '1px solid red'
});
$(this).remove('.youText');
});
}
}
function unLikeSuccessHandler(data){
var obj = JSON.parse(data);
if (obj.hasOwnProperty('meta'))
{
if (obj.meta.code === 200)
{
//console.log('unlike server response successful');
}
else
{
//console.log('unlike server response error');
//console.dir(obj);
}
}
}
function likeSuccessHandler(data){
var obj = JSON.parse(data);
if (obj.hasOwnProperty('meta'))
{
if (obj.meta.code === 200)
{
//console.log('like server response successful');
}
else
{
//console.log('like server response error');
//console.dir(obj);
}
}
}
function isJson(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
});
</script>
<?php
include 'includes/analytics.php';
?>
</body>
</html>