aboutsummaryrefslogtreecommitdiffstats
path: root/mod/message.php
blob: b2cfcf402ab35c3cf4b052df5f662e2fa793a526 (plain) (blame)
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
<?php

require_once('view/acl_selectors.php');

function message_init(&$a) {


}







function message_content(&$a) {

	if(! local_user()) {
		notice( t('Permission denied.') . EOL);
		return;
	}

	if(($a->argc > 1) && ($a->argv[1] == 'new')) {
		
		$tpl = file_get_contents('view/jot-header.tpl');
	
		$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));

		$select .= contact_select('messageto','message-to-select');
		$tpl = file_get_contents('view/prv_message.tpl');
		$o = replace_macros($tpl,array(
			'$select' => $select

		));

		return $o;
	}

	if($a->argc == 1) {

		$r = q("SELECT * FROM `mail` WHERE `seen` = 0 AND `uid` = %d LIMIT %d , %d ",
			intval($_SESSION['uid']),
			intval($a->pager['start']),
			intval($a->pager['itemspage'])
		);
		if(! count($r)) {
			notice( t('No messages.') . EOL);
			return;
		}


	}


}