forked from Candle5000/ez5000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
97 lines (96 loc) · 2.95 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
//=====================================
// トップページ
//=====================================
require_once("/var/www/class/mysql.php");
require_once("/var/www/class/guestdata.php");
require_once("/var/www/bbs/class/board.php");
require_once("/var/www/functions/template.php");
require_once("/var/www/functions/item.php");
$PAGE_ID = 10000;
$PAGESIZE = 10;
$title = "EZ5000テストサイト";
//$user_file = "../../../../etc/mysql-user/user5000.ini";
$user_file = "/etc/mysql-user/user5000.ini";
if($fp_user = fopen($user_file, "r")) {
$userName = rtrim(fgets($fp_user));
$password = rtrim(fgets($fp_user));
$database = rtrim(fgets($fp_user));
} else {
die("接続設定の読み込みに失敗しました");
}
$data = new GuestData($userName, $password, $database);
if(mysqli_connect_error()) {
die("データベースの接続に失敗しました");
}
$sql = "SELECT * FROM `board`";
$result = $data->query($sql);
$count = $data->top_count();
$rows = $data->select_all_l("*", "info", 0, $PAGESIZE, "id desc");
?>
<html>
<head>
<?=pagehead($title)?>
<meta name="robots" content="index" />
<meta name="Keywords" content="オンラインRPG,MMORPG,エターナルゾーン,攻略情報,データベース,蛭注意,EZ5000,5分戦闘,五千" />
<meta name="description" content="【オンラインRPG】エターナルゾーンの攻略サイト開発スペース。テスト公開中。" />
<meta name="author" content="Candle" />
</head>
<body>
<div id="all">
<h1>EZ5000テストサイト</h1>
<hr class="normal">
<ul id="linklist">
<li><a href="./about/"<?=mbi_ack(1)?>><?=mbi("1.")?>このサイトについて</a></li>
<li><a href="./db/"<?=mbi_ack(2)?>><?=mbi("2.")?>データベース</a></li>
<?php
$ak = 2;
while($array = $result->fetch_array()) {
$board = new Board($array);
$ak++;
$accesskey = ($ak < 10) ? mbi_ack($ak) : "";
$aklabel = ($ak < 10) ? mbi($ak.'.') : "";
?>
<li><a href="./bbs/?id=<?=$board->name?>"<?=$accesskey?>><?=$aklabel.$board->title?></a></li>
<?php
}
?>
</ul>
<hr class="normal">
<div class="cnt">
<table id="topcount">
<tr><td class="lft" width="60%">今日の冒険者数</td><td class="rgt" width="40%"><?=$count['t']?> 人</td></tr>
<tr><td class="lft">昨日の冒険者数</td><td class="rgt"><?=$count['y']?> 人</td></tr>
<tr><td class="lft">今月の冒険者数</td><td class="rgt"><?=$count['m']?> 人</td></tr>
</table>
</div>
<hr class="normal">
<ul id="linklist">
<li><a href="./info/">インフォメーション</a></li>
</ul>
<?php
if($rows > 0) {
while($row = $data->fetch()) {
?>
<div id="infobox">
<div id="date"><?=preg_replace("/-/", "/", $row["id"])?></div>
<p>
<span id="boxtitle">■<?=$row["subject"]?></span><br />
<?=nl2br($row["info"])?>
</p>
</div>
<?php
}
}
?>
<ul id="footlink">
<li><a href="http://5000.sameha.org/">本家5000に帰る</a></li>
</ul>
<?php
$data->select_id("accesscount", $PAGE_ID);
$c_data = $data->fetch();
pagefoot($data->access_count("accesscount", $PAGE_ID, $c_data["count"]));
?>
</div>
</body>
</html>