dir/mod/sites.php
Roland Häder c353b31569
Cleanups:
- don't commit files that are being ignored, better provide a "template" file
  that needs copying to the right file and ignore the file that will have local
  changes like config files will always have.
- fixed CHMOD, no need for executable flag here as the server won't execute
  these files, but only load (read) them
- fixed E_NOTICE in boot.php when entrance/index page (no parameter) is being
  called

Signed-off-by: Roland Haeder <roland@mxchange.org>
2017-03-01 20:00:32 +01:00

30 lines
476 B
PHP

<?php
function sites_content(&$a) {
$sites = array();
$r = q("SELECT `nurl` FROM `profile` WHERE 1");
if(count($r)) {
foreach($r as $rr) {
$h = parse_url($rr['nurl']);
$host = $h['host'];
if($h) {
if(! isset($sites[$host]))
$sites[$host] = 0;
$sites[$host] ++;
}
}
}
$total = 0;
asort($sites);
foreach($sites as $k => $v) {
$o .= $k . ' (' . $v . ')' . "<br />\r\n";
$total ++;
}
$o .= "Total: $total<br />\r\n";
return $o;
}