]> git.mxchange.org Git - friendica.git/commitdiff
Only show foreign items if the profile of the user isn't hidden. Show the user's...
authorMichael Vogel <icarus@dabo.de>
Wed, 27 Aug 2014 23:06:41 +0000 (01:06 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 27 Aug 2014 23:06:41 +0000 (01:06 +0200)
boot.php
include/nav.php
mod/display.php
mod/item.php

index f4468bee9278742e3a898b37143876fae2076bb0..122201839c54025d9d8d2ccd94f682566ed74595 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1414,7 +1414,9 @@ if(! function_exists('profile_load')) {
 
                $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
 
-               $_SESSION['theme'] = $a->profile['theme'];
+               if (!$profiledata)
+                       $_SESSION['theme'] = $a->profile['theme'];
+
                $_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
 
                /**
index f838830a8873b109537acec32edc15de36907c96..7708f09e6b812d9dff9a158e601c0b821dea5987 100644 (file)
@@ -55,7 +55,7 @@ function nav_info(&$a) {
         */
 
        $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
-               
+
        $sitelocation = $myident . substr($a->get_baseurl($ssl_state),strpos($a->get_baseurl($ssl_state),'//') + 2 );
 
 
@@ -86,7 +86,7 @@ function nav_info(&$a) {
                        'icon' => (count($r) ? $a->get_cached_avatar_image($r[0]['micro']) : $a->get_baseurl($ssl_state)."/images/person-48.jpg"),
                        'name' => $a->user['username'],
                );
-               
+
        }
        else {
                $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in'));
@@ -101,7 +101,7 @@ function nav_info(&$a) {
        if(! $homelink)
                $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
 
-       if(($a->module != 'home') && (! (local_user()))) 
+       if(($a->module != 'home') && (! (local_user())))
                $nav['home'] = array($homelink, t('Home'), "", t('Home Page'));
 
 
index c6d33ce05f286bdd1810510043fcd9638df65891..abb03b6d5bfaaf948e5ad7fff0ab48b1814a7233 100644 (file)
@@ -33,7 +33,7 @@ function display_init(&$a) {
                                WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
                                        AND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = ''
                                        AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = ''
-                                       AND `item`.`private` = 0
+                                       AND `item`.`private` = 0 AND NOT `user`.`hidewall`
                                        AND `item`.`guid` = '%s'", $a->argv[1]);
                                //      AND `item`.`private` = 0 AND `item`.`wall` = 1
                        if (count($r)) {
@@ -65,6 +65,10 @@ function display_init(&$a) {
                                } else
                                        $profiledata = array();
                        }
+               } else {
+                       $a->error = 404;
+                       notice( t('Item not found.') . EOL);
+                       return;
                }
        }
 
@@ -220,7 +224,7 @@ function display_content(&$a, $update = 0) {
                                        WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
                                                AND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = ''
                                                AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = ''
-                                               AND `item`.`private` = 0
+                                               AND `item`.`private` = 0  AND NOT `user`.`hidewall`
                                                AND `item`.`guid` = '%s'", $a->argv[1]);
                                        //      AND `item`.`private` = 0 AND `item`.`wall` = 1
                                if (count($r)) {
index a08d0e02b3b6733f027a09bc10875b533bdbde29..0e2fce7bf79c750da6d3d16f5320a92b931fa6ce 100644 (file)
@@ -736,7 +736,7 @@ function item_post(&$a) {
                update_thread($post_id);
 
                // update filetags in pconfig
-                file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
+               file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
 
                proc_run('php', "include/notifier.php", 'edit_post', "$post_id");
                if((x($_REQUEST,'return')) && strlen($return_path)) {
@@ -792,8 +792,8 @@ function item_post(&$a) {
                dbesc($datarray['attach']),
                intval($datarray['bookmark']),
                intval($datarray['origin']),
-               intval($datarray['moderated']),
-               dbesc($datarray['file'])
+               intval($datarray['moderated']),
+               dbesc($datarray['file'])
               );
 
        $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
@@ -804,7 +804,7 @@ function item_post(&$a) {
                add_thread($post_id);
 
                // update filetags in pconfig
-                file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
+               file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
 
                // Store the fresh generated item into the cache
                $cachefile = get_cachefile($datarray["guid"]."-".hash("md5", $datarray['body']));
@@ -942,25 +942,25 @@ function item_post(&$a) {
                                        . '<br />';
                                $disclaimer .= sprintf( t('You may visit them online at %s'), $a->get_baseurl() . '/profile/' . $a->user['nickname']) . EOL;
                                $disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL; 
-                                if (!$datarray['title']=='') {
-                                    $subject = email_header_encode($datarray['title'],'UTF-8');
-                                } else {
+                               if (!$datarray['title']=='') {
+                                   $subject = email_header_encode($datarray['title'],'UTF-8');
+                               } else {
                                    $subject = email_header_encode('[Friendica]' . ' ' . sprintf( t('%s posted an update.'),$a->user['username']),'UTF-8');
-                                }
+                               }
                                $link = '<a href="' . $a->get_baseurl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
                                $html    = prepare_body($datarray);
                                $message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
-                                include_once('include/html2plain.php');
-                                $params = array (
-                                    'fromName' => $a->user['username'],
-                                    'fromEmail' => $a->user['email'],
-                                    'toEmail' => $addr,
-                                    'replyTo' => $a->user['email'],
-                                    'messageSubject' => $subject,
-                                    'htmlVersion' => $message,
-                                    'textVersion' => html2plain($html.$disclaimer),
-                                );
-                                enotify::send($params);
+                               include_once('include/html2plain.php');
+                               $params = array (
+                                   'fromName' => $a->user['username'],
+                                   'fromEmail' => $a->user['email'],
+                                   'toEmail' => $addr,
+                                   'replyTo' => $a->user['email'],
+                                   'messageSubject' => $subject,
+                                   'htmlVersion' => $message,
+                                   'textVersion' => html2plain($html.$disclaimer),
+                               );
+                               enotify::send($params);
                        }
                }
        }