]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
first cut at ajax photo upload
[friendica.git] / mod / network.php
index 2685959a3e17916b4e7b6e2f10aab619e1712546..845a6bb77f55bff4fc5331a57c8dfc8250449696 100644 (file)
@@ -15,6 +15,11 @@ function network_content(&$a) {
 
        $contact_id = $a->cid;
 
+       $r = q("UPDATE `item` SET `unseen` = 0 
+               WHERE `unseen` = 1 AND `uid` = %d",
+               intval($_SESSION['uid'])
+       );
+
 
        $tpl = file_get_contents('view/jot-header.tpl');
        
@@ -40,7 +45,7 @@ function network_content(&$a) {
        $r = q("SELECT COUNT(*) AS `total`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
-               AND `contact`.`blocked` = 0 
+               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                $sql_extra ",
                intval($_SESSION['uid'])
        );
@@ -54,9 +59,9 @@ function network_content(&$a) {
                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
-               AND `contact`.`blocked` = 0 
+               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                $sql_extra
-               ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
+               ORDER BY `parent` DESC, `created` ASC LIMIT %d ,%d ",
                intval($_SESSION['uid']),
                intval($a->pager['start']),
                intval($a->pager['itemspage'])
@@ -92,7 +97,7 @@ function network_content(&$a) {
                                        $template = $wallwall;
                                        $commentww = 'ww';      
                                }
-                               if($item['type'] == 'remote' && ($item['owner-link'] != $item['remote-link'])) {
+                               if($item['type'] == 'remote' && ($item['owner-link'] != $item['author-link'])) {
                                        // Could be anybody. 
                                        $owner_url = $item['owner-link'];
                                        $owner_photo = $item['owner-avatar'];
@@ -108,6 +113,7 @@ function network_content(&$a) {
 
                        if($item['last-child']) {
                                $comment = replace_macros($cmnt_tpl,array(
+                                       '$return_path' => $a->cmd,
                                        '$id' => $item['item_id'],
                                        '$parent' => $item['parent'],
                                        '$profile_uid' =>  $_SESSION['uid'],
@@ -124,18 +130,18 @@ function network_content(&$a) {
 
                        // Post was remotely authored.
 
-                       $profile_name = ((strlen($item['remote-name'])) ? $item['remote-name'] : $item['name']);
-                       $profile_avatar = ((strlen($item['remote-avatar'])) ? $item['remote-avatar'] : $thumb);
+                       $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
+                       $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $thumb);
 
                        $profile_link = $profile_url;
 
                        // Can we use our special contact URL for this author? 
 
-                       if(strlen($item['remote-link'])) {
-                               if($item['remote-link'] == $item['url'])
+                       if(strlen($item['author-link'])) {
+                               if($item['author-link'] == $item['url'])
                                        $profile_link = $redirect_url;
                                else
-                                       $profile_link = $item['remote-link'];
+                                       $profile_link = $item['author-link'];
                        }
 
                        // Build the HTML