]> git.mxchange.org Git - friendica.git/blobdiff - mod/notes.php
Reworked mod/item - fixing wrong thread parent and mail stuff
[friendica.git] / mod / notes.php
index 835627586cada10d58b75113a1783e4a852f4386..c02f0a759e298e2dd37cf5cb3808d4449a4e408a 100644 (file)
@@ -1,6 +1,11 @@
 <?php
-
+/**
+ * @file mod/notes.php
+ */
 use Friendica\App;
+use Friendica\Content\Nav;
+use Friendica\Database\DBM;
+use Friendica\Model\Profile;
 
 function notes_init(App $a) {
 
@@ -12,9 +17,9 @@ function notes_init(App $a) {
 
        $which = $a->user['nickname'];
 
-       nav_set_selected('home');
+       Nav::setSelected('home');
 
-//     profile_load($a,$which,$profile);
+       //Profile::load($a, $which, $profile);
 
 }
 
@@ -30,7 +35,7 @@ function notes_content(App $a, $update = false) {
        require_once('include/security.php');
        require_once('include/conversation.php');
        require_once('include/acl_selectors.php');
-       $groups = array();
+       $groups = [];
 
 
        $o = '';
@@ -43,7 +48,7 @@ function notes_content(App $a, $update = false) {
        $is_owner = true;
 
        $o ="";
-       $o .= profile_tabs($a,True);
+       $o .= Profile::getTabs($a, true);
 
        if(! $update) {
                $o .= '<h3>' . t('Personal Notes') . '</h3>';
@@ -51,7 +56,7 @@ function notes_content(App $a, $update = false) {
                $commpage = false;
                $commvisitor = false;
 
-               $x = array(
+               $x = [
                        'is_owner' => $is_owner,
                        'allow_location' => (($a->user['allow_location']) ? true : false),
                        'default_location' => $a->user['default-location'],
@@ -63,7 +68,7 @@ function notes_content(App $a, $update = false) {
                        'profile_uid' => local_user(),
                        'button' => t('Save'),
                        'acl_data' => '',
-               );
+               ];
 
                $o .= status_editor($a,$x,$a->contact['id']);
 
@@ -73,7 +78,7 @@ function notes_content(App $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
@@ -85,7 +90,7 @@ function notes_content(App $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,10 +107,10 @@ function notes_content(App $a, $update = false) {
 
        );
 
-       $parents_arr = array();
+       $parents_arr = [];
        $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);
@@ -119,7 +124,7 @@ function notes_content(App $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);