3 function notes_init(&$a) {
10 $which = $a->user['nickname'];
12 // profile_load($a,$which,$profile);
17 function notes_content(&$a) {
20 notice( t('Permission denied.') . EOL);
24 require_once("include/bbcode.php");
25 require_once('include/security.php');
26 require_once('include/conversation.php');
27 require_once('include/acl_selectors.php');
33 $remote_contact = false;
35 $contact_id = $_SESSION['cid'];
36 $contact = $a->contact;
41 $o .= '<h3>' . t('Private Notes') . '</h3>';
51 'is_owner' => $is_owner,
52 'allow_location' => (($a->user['allow_location']) ? true : false),
53 'default_location' => $a->user['default-location'],
54 'nickname' => $a->user['nickname'],
55 'lockstate' => 'lock',
59 'profile_uid' => local_user(),
64 $o .= status_editor($a,$x,$a->contact['id']);
67 // Construct permissions
69 // default permissions - anonymous user
71 $sql_extra = " AND `allow_cid` = '<" . $a->contact['id'] . ">' ";
73 $r = q("SELECT COUNT(*) AS `total`
74 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
75 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
76 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
77 AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 0
84 $a->set_pager_total($r[0]['total']);
85 $a->set_pager_itemspage(40);
88 $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
89 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
90 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
91 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
92 AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 0
94 ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
96 intval($a->pager['start']),
97 intval($a->pager['itemspage'])
101 $parents_arr = array();
106 $parents_arr[] = $rr['item_id'];
107 $parents_str = implode(', ', $parents_arr);
109 $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
110 `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`,
111 `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
112 `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
113 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
114 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
115 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
116 AND `item`.`parent` IN ( %s )
118 ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ",
119 intval(local_user()),
124 $o .= conversation($a,$r,'notes',$update);