-
Notifications
You must be signed in to change notification settings - Fork 0
/
photo.php
50 lines (41 loc) · 1.05 KB
/
photo.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
<?php
// fetch bootloader
require('bootloader.php');
// user access
if ($user->_logged_in || !$system['system_public']) {
user_access();
}
// valid inputs
if (!isset($_GET['photo_id']) || !is_numeric($_GET['photo_id'])) {
_error(404);
}
try {
// get photo
define('PRIVACY_ERRORS', true);
$photo = $user->get_photo($_GET['photo_id'], true);
if (!$photo) {
_error(404);
}
/* assign variables */
$smarty->assign('photo', $photo);
// get ads campaigns
$ads_campaigns = $user->ads_campaigns();
/* assign variables */
$smarty->assign('ads_campaigns', $ads_campaigns);
// get ads
$ads = $user->ads('photo');
/* assign variables */
$smarty->assign('ads', $ads);
// get widgets
$widgets = $user->widgets('photo');
/* assign variables */
$smarty->assign('widgets', $widgets);
} catch (PrivacyException $e) {
_error('PERMISSION');
} catch (Exception $e) {
_error(__("Error"), $e->getMessage());
}
// page header
page_header($photo['og_title'], $photo['og_description'], $photo['og_image']);
// page footer
page_footer("photo");