2012-05-16 07:31:36 +02:00
< ? php
/*
site_name
version
url
plugins ( arr )
register_policy
admin :
name
profile
*/
function siteinfo_content ( & $a ) {
$o .= '<style>tr { margin-top: 10px; td { margin: 0px 5px 0px 5px; } </style>' ;
$o .= '<h3>Friendica Public Portals</h3>' ;
$o .= '<p>Sites running Friendica that you can join. (Please check current registration status.)</p>' ;
$o .= '<p>Friendica is experiencing very rapid growth and we need more public portals - as some of our primary servers are reaching capacity. Friendica is a decentralised and distributed network. Help us share the load. If you can provide a Friendica server for public use, please send the URL to info at friendica dot com. We will include you in our list.</p>' ;
2012-05-30 12:37:30 +02:00
$r = q ( " select * from site where url != '' and version != '' and not plugins like '%%testdrive%%' order by rand() " );
2012-05-16 07:31:36 +02:00
$policy = array ( 'REGISTER_CLOSED' => 'closed' , 'REGISTER_OPEN' => 'open' , 'REGISTER_APPROVE' => 'requires approval' );
2012-05-30 12:37:30 +02:00
$results = false ;
2012-05-16 07:31:36 +02:00
if ( count ( $r )) {
2012-05-30 12:37:30 +02:00
$results = true ;
2012-05-16 07:31:36 +02:00
$o .= '<table border=1>' ;
$o .= '<tr>' ;
$o .= '<td>' . t ( 'Site Name' ) . '</td>' ;
$o .= '<td>' . t ( 'Registration' ) . '</td>' ;
$o .= '<td>' . t ( 'Additional Info' ) . '</td>' ;
$o .= '<td>' . t ( 'Version' ) . '</td>' ;
$o .= '<td>' . t ( 'Plugins Installed' ) . '</td>' ;
$o .= '<td>' . t ( 'Site Administrator' ) . '</td>' ;
$o .= '<td>' . t ( 'Record Updated (UTC)' ) . '</td>' ;
$o .= '</tr>' ;
foreach ( $r as $rr ) {
if ( ! $rr [ 'version' ])
continue ;
$o .= '<tr>' ;
$o .= '<td>' . '<a href="' . $rr [ 'url' ] . '"><strong>' . $rr [ 'name' ] . '</strong><br />' . $rr [ 'url' ] . '</a>' . '</td>' ;
$o .= '<td>' . $policy [ $rr [ 'reg_policy' ]] . '</td>' ;
$o .= '<td>' . $rr [ 'info' ] . '</td>' ;
$o .= '<td>' . $rr [ 'version' ] . '</td>' ;
$o .= '<td>' . str_replace ( ',' , ', ' , $rr [ 'plugins' ]) . '</td>' ;
$o .= '<td>' . '<a href="' . $rr [ 'admin_profile' ] . '">' . $rr [ 'admin_name' ] . '</a>' . '</td>' ;
$o .= '<td>' . $rr [ 'updated' ] . '</td>' ;
$o .= '</tr>' ;
}
}
2012-05-30 12:37:30 +02:00
$r = q ( " select * from site where url != '' and version != '' and plugins like '%%testdrive%%' order by rand() " );
2012-05-16 07:31:36 +02:00
if ( count ( $r )) {
2012-05-30 12:37:30 +02:00
$o .= '<tr><td colspan="7" height="100px" ><strong>-- Demo and test sites -- Limited account duration with expiration --</stron></td></tr>' ;
2012-05-16 07:31:36 +02:00
foreach ( $r as $rr ) {
2012-05-30 12:37:30 +02:00
if ( ! $rr [ 'version' ])
continue ;
$o .= '<tr>' ;
$o .= '<td>' . '<a href="' . $rr [ 'url' ] . '"><strong>' . $rr [ 'name' ] . '</strong><br />' . $rr [ 'url' ] . '</a>' . '</td>' ;
$o .= '<td>' . $policy [ $rr [ 'reg_policy' ]] . '</td>' ;
$o .= '<td>' . $rr [ 'info' ] . '</td>' ;
$o .= '<td>' . $rr [ 'version' ] . '</td>' ;
$o .= '<td>' . str_replace ( ',' , ', ' , $rr [ 'plugins' ]) . '</td>' ;
$o .= '<td>' . '<a href="' . $rr [ 'admin_profile' ] . '">' . $rr [ 'admin_name' ] . '</a>' . '</td>' ;
$o .= '<td>' . $rr [ 'updated' ] . '</td>' ;
$o .= '</tr>' ;
2012-05-16 07:31:36 +02:00
}
}
2012-05-30 12:37:30 +02:00
if ( $results )
$o .= '</table>' ;
// $r = q("select * from site where url != '' and version = '' order by name asc");
// if(count($r)) {
// $o .= '<p>Sites that could not be verified. May be running older versions.</p>';
// foreach($r as $rr) {
// $o .= '<a href="' . $rr['url'] . '">' . $rr['url'] . '</a><br />';
// }
// }
2012-05-16 07:31:36 +02:00
return $o ;
}