X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontacts.php;h=fb4595739b5e1f3047ddf67d1b4bb0b6075e2fb8;hb=15cae001d947d27a75147aecec089e44d7b8c31f;hp=769239fe0cd81c62c5fd41cb1841978044fa1fbe;hpb=dedaa301cba5ca6c21af9ec54cc54a7f7480e2f4;p=friendica.git diff --git a/mod/contacts.php b/mod/contacts.php index 769239fe0c..fb4595739b 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -43,6 +43,26 @@ function contacts_init(&$a) { $a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= networks_widget('contacts',$_GET['nets']); + $base = $a->get_baseurl(); + + $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= <<< EOT + + +EOT; + + } function contacts_post(&$a) { @@ -315,6 +335,7 @@ function contacts_content(&$a) { $tab_tpl = get_markup_template('common_tabs.tpl'); $tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs)); + $lost_contact = (($contact['archive'] && $contact['term-date'] != '0000-00-00 00:00:00' && $contact['term-date'] < datetime_convert('','','now')) ? t('Communications lost with this contact!') : ''); $o .= replace_macros($tpl,array( '$header' => t('Contact Editor'), @@ -339,6 +360,7 @@ function contacts_content(&$a) { '$poll_interval' => contact_poll_interval($contact['priority'],(! $poll_enabled)), '$poll_enabled' => $poll_enabled, '$lastupdtext' => t('Last update:'), + '$lost_contact' => $lost_contact, '$updpub' => t('Update public posts'), '$last_update' => $last_update, '$udnow' => t('Update now'), @@ -457,12 +479,13 @@ function contacts_content(&$a) { - + $searching = false; if($search) { $search_hdr = $search; - $search = dbesc($search.'*'); + $search_txt = dbesc(protect_sprintf(preg_quote($search))); + $searching = true; } - $sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : ""); + $sql_extra .= (($searching) ? " AND `name` REGEXP '$search_txt' " : ""); if($nets) $sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets)); @@ -479,7 +502,6 @@ function contacts_content(&$a) { } - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ", intval($_SESSION['uid']), intval($a->pager['start']), @@ -546,7 +568,7 @@ function contacts_content(&$a) { '$total' => $total, '$search' => $search_hdr, '$desc' => t('Search your contacts'), - '$finding' => (strlen($search) ? t('Finding: ') . "'" . $search . "'" : ""), + '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""), '$submit' => t('Find'), '$cmd' => $a->cmd, '$contacts' => $contacts,