-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·49 lines (40 loc) · 1.12 KB
/
index.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
46
47
48
49
<?php
session_start();
require_once('./inc/common.inc.php');
if ((preg_match("/(iphone|ipad|ipod|android)/i", strtolower(VWSCore::UserAgent()))) AND strstr(strtolower(VWSCore::UserAgent()), 'webkit'))
{
header('Location: mobile/');
exit;
}
else if (trim(VWSCore::UserAgent()) == '' OR preg_match("/(nokia|sony|ericsson|mot|htc|samsung|sgh|lg|philips|lenovo|ucweb|opera mobi|windows mobile|blackberry)/i", strtolower(VWSCore::UserAgent())))
{
header('Location: mobile/?m');
exit;
}
require_once 'header.php';
$sql = "SELECT COUNT(DISTINCT vws_words.key) AS id FROM vws_words;";
$res = $db->query($sql);
$row = $db->fetch_array($res);
$amount = $row['id'];
$pages = ceil($amount/$vw_perpage);
if (isset($_GET['page'])) {
if (($_GET['page'] > 1) && ($_GET['page'] < $pages+1)) {
$page = (int) $_GET['page'];
}
elseif ($_GET['page'] > $pages) {
header('Location: ?page=' . $pages);
exit;
}
}
else {
$page = 1;
}
$lists = DisplayCore::indexDisplay();
foreach ($lists as $list) {
echo $list;
}
if ($pages > 1) {
echo VWSCore::pagination();
}
require_once 'footer.php';
?>