]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
multi-user, do not cache open mbox
[friendica.git] / mod / network.php
index 5461aae3feb5de3382f2e7716eddd739decf3f96..746206031c679ab08e51e50f1c21398aea834a53 100644 (file)
@@ -21,12 +21,14 @@ function network_init(&$a) {
 
        $a->page['aside'] .= '</div>';
 
-       $a->page['aside'] .= group_side('network','network');
+       $a->page['aside'] .= group_side('network','network',true);
 }
 
 
 function network_content(&$a, $update = 0) {
 
+       require_once('include/conversation.php');
+
        if(! local_user())
        return login(false);
 
@@ -92,6 +94,28 @@ function network_content(&$a, $update = 0) {
 
                $jotplugins = '';
                $jotnets = '';
+
+
+               $mail_enabled = false;
+               $pubmail_enabled = false;
+
+
+               $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
+                       intval(local_user())
+               );
+               if(count($r)) {
+                       $mail_enabled = true;
+                       if(intval($r[0]['pubmail']))
+                               $pubmail_enabled = true;
+               }
+
+               if($mail_enabled) {
+              $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
+                       $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . 'value="1" /> '
+               . t("Post to Email") . '</div>';
+               }
+
+
                call_hooks('jot_tool', $jotplugins);
                call_hooks('jot_networks', $jotnets);
 
@@ -202,7 +226,7 @@ function network_content(&$a, $update = 0) {
                // "New Item View" - show all items unthreaded in reverse created date order
 
                $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
                        `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                        FROM `item`, `contact`
@@ -246,7 +270,7 @@ function network_content(&$a, $update = 0) {
                        $parents_str = implode(', ', $parents_arr);
 
                        $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-                               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+                               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
                                `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
                                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                                FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`, `contact`
@@ -262,9 +286,10 @@ function network_content(&$a, $update = 0) {
                }
        }
 
-       $mode = (($nouveau) ? 'network-new' : 'network');
+       // Set this so that the conversation function can find out contact info for our wall-wall items
+       $a->page_contact = $a->contact;
 
-       require_once('include/conversation.php');
+       $mode = (($nouveau) ? 'network-new' : 'network');
 
        $o .= conversation($a,$r,$mode,$update);