]> git.mxchange.org Git - friendica.git/blobdiff - mod/directory.php
Better content detection for posts to Twitter
[friendica.git] / mod / directory.php
index ba48bb3926c737a91e03587fa9fc3c008c8be8f8..9e004ab5d8b41c1e2a28bb630aa95618f7585998 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Friendica\App;
+
 function directory_init(App $a) {
        $a->set_pager_itemspage(60);
 
@@ -9,24 +11,18 @@ function directory_init(App $a) {
                $a->page['aside'] .= findpeople_widget();
 
                $a->page['aside'] .= follow_widget();
-
        }
        else {
                unset($_SESSION['theme']);
                unset($_SESSION['mobile-theme']);
        }
-
-
 }
 
-
 function directory_post(App $a) {
        if(x($_POST,'search'))
                $a->data['search'] = $_POST['search'];
 }
 
-
-
 function directory_content(App $a) {
        global $db;
 
@@ -75,7 +71,7 @@ function directory_content(App $a) {
        $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
 
 
-       $r = $db->q("SELECT COUNT(*) AS `total` FROM `profile`
+       $r = q("SELECT COUNT(*) AS `total` FROM `profile`
                        LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                        WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
        if (dbm::is_result($r))
@@ -85,11 +81,11 @@ function directory_content(App $a) {
 
        $limit = intval($a->pager['start']).",".intval($a->pager['itemspage']);
 
-       $r = $db->q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`,
+       $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`,
                        `contact`.`addr`, `contact`.`url` AS profile_url FROM `profile`
                        LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                        LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
-                       WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit);
+                       WHERE `is-default` $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit);
        if (dbm::is_result($r)) {
 
                if (in_array('small', $a->argv)) {