]> git.mxchange.org Git - friendica.git/blobdiff - mod/notes.php
Split the name in the hcard
[friendica.git] / mod / notes.php
index 74ab18a6f95f0aeeb16418b584709163a471c981..c5c45be7243c8a7081b9d5de0056df7d55d15267 100644 (file)
@@ -1,9 +1,13 @@
 <?php
 
-function notes_init(&$a) {
+use Friendica\App;
+use Friendica\Database\DBM;
 
-       if(! local_user())
+function notes_init(App $a) {
+
+       if (! local_user()) {
                return;
+       }
 
        $profile = 0;
 
@@ -16,9 +20,9 @@ function notes_init(&$a) {
 }
 
 
-function notes_content(&$a,$update = false) {
+function notes_content(App $a, $update = false) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
@@ -70,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
@@ -82,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);
        }
@@ -102,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);
@@ -116,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);