-
Notifications
You must be signed in to change notification settings - Fork 0
/
people.php
99 lines (77 loc) · 2.36 KB
/
people.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
<?php
/**
* friend_requests
*
* @package Delus
* @author Dmitry
*/
// fetch bootloader
require('bootloader.php');
// user access
user_access();
try {
// get view content
switch ($_GET['view']) {
case '':
// page header
page_header(__("Discover People") . ' | ' . __($system['system_title']));
// get new people
$smarty->assign('people', $user->get_new_people());
break;
case 'find':
// page header
page_header(__("Find People"));
// valid inputs
if (!isset($_POST['submit'])) {
redirect('/people');
}
// search users
$people = $user->search_users($_POST['distance_value'], $_POST['query'], $_POST['gender'], $_POST['relationship'], $_POST['status']);
$smarty->assign('people', $people);
$smarty->assign('query', htmlentities($_POST['query'], ENT_QUOTES, 'utf-8'));
$smarty->assign('distance_value', $_POST['distance_value']);
$smarty->assign('gender', $_POST['gender']);
$smarty->assign('relationship', $_POST['relationship']);
$smarty->assign('status', $_POST['status']);
break;
case 'friend_requests':
// check if friends enabled
if (!$system['friends_enabled']) {
_error(404);
}
// page header
page_header(__("Friend Requests"));
break;
case 'sent_requests':
// check if friends enabled
if (!$system['friends_enabled']) {
_error(404);
}
// page header
page_header(__("Friend Requests Sent"));
// get friend requests sent
$user->_data['friend_requests_sent'] = $user->get_friend_requests_sent();
break;
default:
_error(404);
break;
}
/* assign variables */
$smarty->assign('view', $_GET['view']);
// get total friend requests sent
$user->_data['friend_requests_sent_total'] = $user->get_friend_requests_sent_total();
// get genders
$smarty->assign('genders', $user->get_genders());
// get custom fields
$smarty->assign('custom_fields', $user->get_custom_fields(["get" => "search"]));
// get ads campaigns
$smarty->assign('ads_campaigns', $user->ads_campaigns());
// get ads
$smarty->assign('ads', $user->ads('people'));
// get widgets
$smarty->assign('widgets', $user->widgets('people'));
} catch (Exception $e) {
_error(__("Error"), $e->getMessage());
}
// page footer
page_footer('people');