]> git.mxchange.org Git - friendica.git/commitdiff
site config to force publish in site directory
authorFriendika <info@friendika.com>
Mon, 3 Jan 2011 06:09:54 +0000 (22:09 -0800)
committerFriendika <info@friendika.com>
Mon, 3 Jan 2011 06:09:54 +0000 (22:09 -0800)
mod/directory.php
mod/settings.php

index e1c83f05e3b6d000c2567a864530dad892c82c57..b0cee76cb72330e59ae8e537dd24b72de0e2dcee 100644 (file)
@@ -39,16 +39,16 @@ function directory_content(&$a) {
                $search = dbesc($search);
        $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
 
+       $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
 
 
-
-       $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `publish` = 1 AND `user`.`blocked` = 0 $sql_extra ");
+       $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(count($r))
                $a->set_pager_total($r[0]['total']);
 
 
 
-       $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `publish` = 1 AND `user`.`blocked` = 0 $sql_extra ORDER BY `name` ASC LIMIT %d , %d ",
+       $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ORDER BY `name` ASC LIMIT %d , %d ",
                intval($a->pager['start']),
                intval($a->pager['itemspage'])
        );
index eb27de06efc255aa8383750bcf71983b8d3f002d..0f01807a20af74bf99a873d762bb9bbe2c75ce6b 100644 (file)
@@ -247,13 +247,16 @@ function settings_content(&$a) {
        }
 
 
-
-
-       $opt_tpl = load_view_file("view/profile-in-directory.tpl");
-       $profile_in_dir = replace_macros($opt_tpl,array(
-               '$yes_selected' => (($profile['publish'])      ? " checked=\"checked\" " : ""),
-               '$no_selected'  => (($profile['publish'] == 0) ? " checked=\"checked\" " : "")
-       ));
+       if(get_config('system','publish_all')) {
+               $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
+       }
+       else {
+               $opt_tpl = load_view_file("view/profile-in-directory.tpl");
+               $profile_in_dir = replace_macros($opt_tpl,array(
+                       '$yes_selected' => (($profile['publish'])      ? " checked=\"checked\" " : ""),
+                       '$no_selected'  => (($profile['publish'] == 0) ? " checked=\"checked\" " : "")
+               ));
+       }
 
        if(strlen(get_config('system','directory_submit_url'))) {
                $opt_tpl = load_view_file("view/profile-in-netdir.tpl");