]> git.mxchange.org Git - friendica.git/blobdiff - mod/community.php
add remove_user hook (it looks like dreamhost changed all my file permissions, this...
[friendica.git] / mod / community.php
old mode 100644 (file)
new mode 100755 (executable)
index 90cb7a5..34c992b
@@ -1,5 +1,12 @@
 <?php
 
+function community_init(&$a) {
+       if(! local_user())
+               unset($_SESSION['theme']);
+
+
+}
+
 
 function community_content(&$a, $update = 0) {
 
@@ -19,15 +26,12 @@ function community_content(&$a, $update = 0) {
        require_once('include/security.php');
        require_once('include/conversation.php');
 
-       if(x($_SESSION,'theme'))
-               unset($_SESSION['theme']);
-
 
        $o .= '<h3>' . t('Community') . '</h3>';
        if(! $update) {
-               $o .= '<script> $(document).ready(function() { $(\'#nav-community-link\').addClass(\'nav-selected\'); });</script>';
+               nav_set_selected('community');
                $o .= '<div id="live-community"></div>' . "\r\n";
-               $o .= "<script> var profile_uid = -1; var netargs = ''; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+               $o .= "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
        }
 
        if(x($a->data,'search'))
@@ -42,11 +46,11 @@ function community_content(&$a, $update = 0) {
 
 
        $r = q("SELECT COUNT(*) AS `total`
-               FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `profile` ON `profile`.`uid` = `item`.`uid`
+               FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
                WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
                AND `wall` = 1 AND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = '' 
-               AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = '' AND `profile`.`hidewall` = 0 
-               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `profile`.`is-default` = 1 "
+               AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = '' AND `user`.`hidewall` = 0 
+               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 "
        );
 
        if(count($r))
@@ -61,14 +65,13 @@ function community_content(&$a, $update = 0) {
                `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
                `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
-               `user`.`nickname`, `profile`.`hidewall`
+               `user`.`nickname`, `user`.`hidewall`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
-               LEFT JOIN `profile` ON `profile`.`uid` = `item`.`uid` 
                WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
                AND `wall` = 1 AND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = '' 
-               AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = '' AND `profile`.`hidewall` = 0 
-               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `profile`.`is-default` = 1
+               AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = '' AND `user`.`hidewall` = 0 
+               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                ORDER BY `received` DESC LIMIT %d, %d ",
                intval($a->pager['start']),
                intval($a->pager['itemspage'])