34) { $tx = preg_replace('/[^a-zA-Z0-9]+/', '', $q[1]); } else { $page = (int) $q[1]; } } if (isset($q[2])) { if (strlen($q[2]) == 34) { $ns = preg_replace('/[^a-zA-Z0-9]+/', '', $q[2]); } else { $page = (int) $q[2]; } } } $limit = PAGE_LIMIT * $page; $db = new MySQL(); if ($ns) { $namespaceValue = $db->getNamespaceName($ns); } else { $namespaceValue = false; } $data = []; foreach ($db->getData($ns, $tx, $query, $limit, PAGE_LIMIT) as $value) { $data[] = [ 'namehash' => $value['namehash'], 'block' => $value['block'], 'txid' => $value['txid'], 'time' => date('d-m-Y H:i', $value['time']), 'key' => nl2br($value['key']), 'value' => nl2br($value['value']), ]; } if (SEF_MODE) { if (in_array($page, [0, 1])) { $newer = false; } else { if ($page == 2) { $newer = ($ns ? $ns : ''); } else { $newer = ($ns ? $ns . '/' . ($page - 1) : ($page - 1)); } } if ($data) { if (in_array($page, [0, 1])) { $older = ($ns ? $ns . '/2' : '/2'); } else { $older = ($ns ? $ns . '/' . ($page + 1) : '/' . ($page + 1)); } } else { $older = false; } } else { if (in_array($page, [0, 1])) { $newer = false; } else { if ($page == 2) { $newer = ($ns ? '?ns=' . $ns : ($query ? '?q=' . $query : '')); } else { $newer = ($ns ? '?ns=' . $ns . '&page=' . ($page - 1) : '?page=' . ($page - 1) . ($query ? '&q=' . $query : '')); } } if ($data) { if (in_array($page, [0, 1])) { $older = ($ns ? '?ns=' . $ns . '&page=2' : '?page=2' . ($query ? '&q=' . $query : '')); } else { $older = ($ns ? '?ns=' . $ns . '&page=' . ($page + 1) : '?page=' . ($page + 1) . ($query ? '&q=' . $query : '')); } } else { $older = false; } } if ($ns) { if ($page) { $hrefThisPage = $ns . '/' . $page; } else { $hrefThisPage = $ns; } } else { if ($page) { $hrefThisPage = $page; } else { $hrefThisPage = ''; } } require_once('index.phtml');