From 49ccefd6c7add622ba84c72769a68d08ef043ef5 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 5 May 2012 17:53:23 -0700 Subject: bad sql left after the mailbox in/out merge --- mod/message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index dbca45930..aa8851e46 100644 --- a/mod/message.php +++ b/mod/message.php @@ -198,7 +198,7 @@ function message_content(&$a) { $o .= $header; $r = q("SELECT count(*) AS `total` FROM `mail` - WHERE `mail`.`uid` = %d AND `from-url` $eq '%s' GROUP BY `parent-uri` ORDER BY `created` DESC", + WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `created` DESC", intval(local_user()), dbesc($myprofile) ); -- cgit v1.2.3 From 57920849c4138920b5715931a268dd2a55c76003 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 6 May 2012 19:53:34 -0700 Subject: email recip autocomplete --- mod/acl.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mod') diff --git a/mod/acl.php b/mod/acl.php index 88f150d7a..402d37376 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -13,6 +13,14 @@ function acl_init(&$a){ $type = (x($_REQUEST,'type')?$_REQUEST['type']:""); + // For use with jquery.autocomplete for private mail completion + + if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) { + $type = 'm'; + $search = $_REQUEST['query']; + } + + if ($search!=""){ $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'"; $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; @@ -115,6 +123,23 @@ function acl_init(&$a){ else $r = array(); + + if($type == 'm') { + $x = array(); + $x['query'] = $search; + $x['suggestions'] = array(); + $x['data'] = array(); + if(count($r)) { + foreach($r as $g) { + $x['suggestions'][] = sprintf( t('%s [%s]'),$g['name'],$g['url']); + // '' . t('Image/photo') . '' . + $x['data'][] = intval($g['id']); + } + } + echo json_encode($x); + killme(); + } + if(count($r)) { foreach($r as $g){ $contacts[] = array( -- cgit v1.2.3 From 851264161f1b0e638a818a0ebfa80feeb46dfa44 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 6 May 2012 19:55:39 -0700 Subject: mail autcomplete testing --- mod/message.php | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index aa8851e46..70b85b84c 100644 --- a/mod/message.php +++ b/mod/message.php @@ -4,20 +4,7 @@ require_once('include/acl_selectors.php'); require_once('include/message.php'); function message_init(&$a) { - $tabs = array( - /* - array( - 'label' => t('All'), - 'url'=> $a->get_baseurl(true) . '/message', - 'sel'=> ($a->argc == 1), - ), - array( - 'label' => t('Sent'), - 'url' => $a->get_baseurl(true) . '/message/sent', - 'sel'=> ($a->argv[1] == 'sent'), - ), - */ - ); + $tabs = array(); $new = array( 'label' => t('New Message'), 'url' => $a->get_baseurl(true) . '/message/new', @@ -29,6 +16,20 @@ function message_init(&$a) { '$tabs'=>$tabs, '$new'=>$new, )); + $base = $a->get_baseurl(); + + $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= <<< EOT + + +EOT; } @@ -171,7 +172,9 @@ function message_content(&$a) { $preselect = (isset($a->argv[2])?array($a->argv[2]):false); - $select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10); +// $select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10); + $select = ''; + $tpl = get_markup_template('prv_message.tpl'); $o .= replace_macros($tpl,array( '$header' => t('Send Private Message'), -- cgit v1.2.3 From b74a776162b86b6257acf0406e7df4da236c8f09 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 6 May 2012 20:06:39 -0700 Subject: I'll leave the private mail recipient autocomplete partially done. Need a good UI/JS person to finish it off. --- mod/message.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index 70b85b84c..6fa128808 100644 --- a/mod/message.php +++ b/mod/message.php @@ -23,7 +23,7 @@ function message_init(&$a) {