forked from junioryauricasa/soshialsoshialnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.php
50 lines (40 loc) · 999 Bytes
/
messages.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
/**
* signup
*
* @package Marsesweb v2+
* @author Marwin Silva
*/
// fetch bootstrap
require('bootstrap.php');
// user access
user_access();
// page header
page_header(__("Messages"));
// check cid
if(!isset($_GET['cid'])) {
if(count($user->_data['conversations']) > 0) {
$conversation = $user->_data['conversations'][0];
try {
$conversation['messages'] = $user->get_conversation_messages($conversation['conversation_id']);
} catch (Exception $e) {
_error(__("Error"), $e->getMessage());
}
}
} else {
/* check cid is valid */
if(is_empty($_GET['cid']) || !is_numeric($_GET['cid'])) {
_error(404);
}
try {
$conversation = $user->get_conversation($_GET['cid']);
$conversation['messages'] = $user->get_conversation_messages($conversation['conversation_id']);
} catch (Exception $e) {
_error(__("Error"), $e->getMessage());
}
}
// assign variables
$smarty->assign('conversation', $conversation);
// page footer
page_footer("messages");
?>