]> git.mxchange.org Git - friendica.git/blobdiff - mod/notes.php
Split the name in the hcard
[friendica.git] / mod / notes.php
index d9222dca5104a41b8f57c4794f228330cf5c5c1b..c5c45be7243c8a7081b9d5de0056df7d55d15267 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
-function notes_init(&$a) {
+use Friendica\App;
+use Friendica\Database\DBM;
+
+function notes_init(App $a) {
 
        if (! local_user()) {
                return;
@@ -17,7 +20,7 @@ function notes_init(&$a) {
 }
 
 
-function notes_content(&$a,$update = false) {
+function notes_content(App $a, $update = false) {
 
        if (! local_user()) {
                notice( t('Permission denied.') . EOL);
@@ -71,7 +74,7 @@ function notes_content(&$a,$update = false) {
 
        // default permissions - anonymous user
 
-       $sql_extra = " AND `allow_cid` = '<" . $a->contact['id'] . ">' ";
+       $sql_extra = " AND `item`.`allow_cid` = '<" . $a->contact['id'] . ">' ";
 
        $r = q("SELECT COUNT(*) AS `total`
                FROM `item` %s
@@ -83,7 +86,7 @@ function notes_content(&$a,$update = false) {
 
        );
 
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                $a->set_pager_total($r[0]['total']);
                $a->set_pager_itemspage(40);
        }
@@ -103,7 +106,7 @@ function notes_content(&$a,$update = false) {
        $parents_arr = array();
        $parents_str = '';
 
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                foreach($r as $rr)
                        $parents_arr[] = $rr['item_id'];
                $parents_str = implode(', ', $parents_arr);
@@ -117,7 +120,7 @@ function notes_content(&$a,$update = false) {
                        dbesc($parents_str)
                );
 
-               if (dbm::is_result($r)) {
+               if (DBM::is_result($r)) {
                        $items = conv_sort($r,"`commented`");
 
                        $o .= conversation($a,$items,'notes',$update);