aboutsummaryrefslogtreecommitdiffstats
path: root/mod/pubsites.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-05 22:00:06 -0700
committerfriendica <info@friendica.com>2013-09-05 22:00:06 -0700
commitc65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65 (patch)
tree6b1e2faaa0a85aa9216d674ebecd48e0df049cd3 /mod/pubsites.php
parentf8801185588a058a26c7aabd6be22ec27ee91b38 (diff)
downloadvolse-hubzilla-c65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65.tar.gz
volse-hubzilla-c65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65.tar.bz2
volse-hubzilla-c65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65.zip
public site list (will take a few days to populate, assuming folks have updated their site access policy which old sites do not have)
Diffstat (limited to 'mod/pubsites.php')
-rw-r--r--mod/pubsites.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/mod/pubsites.php b/mod/pubsites.php
new file mode 100644
index 000000000..3e8833a9d
--- /dev/null
+++ b/mod/pubsites.php
@@ -0,0 +1,37 @@
+<?php
+
+function pubsites_content(&$a) {
+
+ $dirmode = intval(get_config('system','directory_mode'));
+
+ if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
+ $url = z_root() . '/dirsearch';
+ }
+ if(! $url) {
+ $directory = find_upstream_directory($dirmode);
+
+ if($directory) {
+ $url = $directory['url'] . '/dirsearch';
+ }
+ else {
+ $url = DIRECTORY_FALLBACK_MASTER . '/dirsearch';
+ }
+ }
+ $url .= '/sites';
+
+ $o .= '<h1>' . t('Public Sites') . '</h1>';
+
+ $ret = z_fetch_url($url);
+ if($ret['success']) {
+ $j = json_decode($ret['body'],true);
+ if($j) {
+ $o .= '<table><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td></tr>';
+ foreach($j as $jj) {
+ $o .= '<tr><td>' . $jj['url'] . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td></tr>';
+ }
+
+ $o .= '</table>';
+ }
+ }
+ return $o;
+}