forked from DECENTRALIZEDCOMMUNISMSPOEMS/dns.chudo.i2p
-
Notifications
You must be signed in to change notification settings - Fork 1
/
list_domains.php
45 lines (41 loc) · 1.38 KB
/
list_domains.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php include('templates/header.php');?>
<?php
function request(){
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
require_once("classes/base64_class.php");
include("classes/sam.php");
require_once('classes/addressbook_class_mysql.php');
$addressbook = new addressbook_service();
$offset=0;
$status = 1;
if( isset($_GET['o']) ){
$offset = intval($_GET['o']);
}if (isset($_GET['status']) ){
$status = intval($_GET['status']);
}
$domains=$addressbook->getDomains($offset, 5,$status);
echo "<div id='domains'>";
foreach( $domains as $value){
$host=$value['host'];
$b64=$value['b64'];
$desc=$value['description'];
$cache_online=$addressbook->existOnlineStatus($host);
$last_online=$cache_online['last_online'];
$b32 = (new b32_b64())->b32from64($b64) . ".b32.i2p";
if( !strlen($desc) ) $desc = "no info";
echo "<a href='http://$host/?i2paddresshelper=$b64'>$host (Last seen: $last_online)</a> - $desc <br/>($b32)<hr/>";
}//foreach
$np=$offset+5;
$bp=$offset-5;
if($offset) print( "<a href='?o=$bp&status=$status'><</a>" );
echo "<a href='?o=$np&status=$status'>></a><hr/><a href=index.php>main page</a>";
echo "|<a href=?status=1>online only</a>";
echo "|<a href=?status=0>offline only</a>";
echo "</div>";
return true;
}
request();
?>
<?php include('templates/footer.php');?>