|
|
@ -4,24 +4,23 @@ require_once('../config.php'); |
|
|
|
require_once('../library/icon.php'); |
|
|
|
require_once('../library/icon.php'); |
|
|
|
require_once('../library/sqlite.php'); |
|
|
|
require_once('../library/sqlite.php'); |
|
|
|
|
|
|
|
|
|
|
|
$query = isset($_GET['q']) ? preg_replace('/[^\w\s]+/u', '', $_GET['q']) : ''; |
|
|
|
$query = isset($_GET['q']) ? preg_replace('/[^\w\s]+/u', '', urldecode($_GET['q'])) : ''; |
|
|
|
$ns = isset($_GET['ns']) ? preg_replace('/[^a-zA-Z0-9]+/', '', $_GET['ns']) : ''; |
|
|
|
$ns = ''; |
|
|
|
$tx = isset($_GET['tx']) ? preg_replace('/[^a-zA-Z0-9]+/', '', $_GET['tx']) : ''; |
|
|
|
$tx = ''; |
|
|
|
$page = (int) isset($_GET['page']) ? $_GET['page'] : 0; |
|
|
|
$page = 0; |
|
|
|
$rss = isset($_GET['rss']) ? true : false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_SERVER['QUERY_STRING'])) { |
|
|
|
if (isset($_SERVER['REQUEST_URI'])) { |
|
|
|
|
|
|
|
|
|
|
|
$q = explode('/', $_SERVER['QUERY_STRING']); |
|
|
|
$q = explode('/', $_SERVER['REQUEST_URI']); |
|
|
|
|
|
|
|
|
|
|
|
if (isset($q[1])) { |
|
|
|
if (isset($q[1])) { |
|
|
|
if ($q[1] == 'rss') { |
|
|
|
if ($q[1] == 'rss') { |
|
|
|
$rss = true; |
|
|
|
$rss = true; |
|
|
|
} else if (strlen($q[1]) == 34) { |
|
|
|
} else if (strlen($q[1]) == 34) { |
|
|
|
$ns = preg_replace('/[^a-zA-Z0-9]+/', '', $q[1]); |
|
|
|
$ns = preg_replace('/[^a-zA-Z0-9]+/', '', $q[1]); |
|
|
|
} else if (strlen($q[1]) > 34) { |
|
|
|
} else if (strlen($q[1]) == 64) { |
|
|
|
$tx = preg_replace('/[^a-zA-Z0-9]+/', '', $q[1]); |
|
|
|
$tx = preg_replace('/[^a-zA-Z0-9]+/', '', $q[1]); |
|
|
|
} else { |
|
|
|
} else if (preg_match('/[0-9]+/', $q[1])) { |
|
|
|
$page = (int) $q[1]; |
|
|
|
$page = (int) $q[1]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -31,12 +30,16 @@ if (isset($_SERVER['QUERY_STRING'])) { |
|
|
|
$rss = true; |
|
|
|
$rss = true; |
|
|
|
} else if (strlen($q[2]) == 34) { |
|
|
|
} else if (strlen($q[2]) == 34) { |
|
|
|
$ns = preg_replace('/[^a-zA-Z0-9]+/', '', $q[2]); |
|
|
|
$ns = preg_replace('/[^a-zA-Z0-9]+/', '', $q[2]); |
|
|
|
} else { |
|
|
|
} else if (preg_match('/[0-9]+/', $q[2])) { |
|
|
|
$page = (int) $q[2]; |
|
|
|
$page = (int) $q[2]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($query) { |
|
|
|
|
|
|
|
$rss = isset($_GET['rss']) ? true : false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($page > 0) { |
|
|
|
if ($page > 0) { |
|
|
|
$limit = PAGE_LIMIT * $page - PAGE_LIMIT; |
|
|
|
$limit = PAGE_LIMIT * $page - PAGE_LIMIT; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|