-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
130 lines (124 loc) · 5.11 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<!-- <link rel="icon" href="../../favicon.ico"> -->
<title>Forum</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/main.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery-2.1.4.min.js"></script>
<!-- Bootstrap -->
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php
require('checkvalid.php');
$username = $_SESSION['username'];
$u_id = $_SESSION['u_id'];
$role = $_SESSION['role'];
$status = $_SESSION['status'];
?>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="nav-wrapper">
<div class="container-fluid">
<ul class="nav navbar-nav ">
<li class="divider-vertical"></li>
<li><a href="index.php"><b>论坛首页</b></a></li>
</ul>
<form class="navbar-form navbar-left" role="search" method="post" action="posts.php">
<div class="form-group">
<input type="text" name="keyword" class="form-control" placeholder="帖子主题">
</div>
<button type="submit" class="btn btn-default" name="search">搜索</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li>
<div class="navbar-header">
<img alt="avatar" src="<?php echo $_SESSION['avatar']; ?>" class="img-nav img-rounded">
</div>
</li>
<li class="dropdown">
<a href="#" id="username-nav" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php echo $username?>
<!-- <span class="caret"></span> -->
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="editinfo.php">编辑信息</a></li>
<li><a href="message.php">短消息</a></li>
<?php if($_SESSION['role'] == 0){ ?>
<li><a href="usermanagement.php">用户管理</a></li>
<li><a href="boardmanagement.php">版块管理</a></li>
<?php } ?>
<li class="divider"></li>
<li><a href="logout.php">注销</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="divider-vertical"></li>
<li><a>浏览 <span class="sr-only">(current)</span></a></li>
<li class="divider-vertical"></li>
<li><a href="top10.php">热门帖子</a></li>
<li class="divider-vertical"></li>
<li><a>公告</a></li>
<li class="divider-vertical"></li>
<li class="divider-vertical-invisable"></li>
<li class="divider-vertical-invisable"></li>
<li class="divider-vertical-invisable"></li>
<li class="divider-vertical-invisable"></li>
<li class="divider-vertical-invisable"></li>
</ul>
</div>
</div>
</nav>
<div class="panel panel-default panel-size">
<div class="panel-heading">
<ol class="breadcrumb breadcrumb-post">
<li class="active">选择板块</li>
</ol>
</div>
<div class="panel-body">
<div class="row">
<?php
/**
* Created by PhpStorm.
* User: Henry
* Date: 2015/6/10
* Time: 19:10
*/
include('connect.php');
$sql = "SELECT `b_id`, `b_name`, `description`, `posts_count` FROM `forum_board`;";
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query, MYSQL_BOTH)) {
?>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<div class="caption">
<h3><?php echo $row['b_name'] ?></h3>
<p><?php echo $row['description'] ?></p>
<p>帖子数: <?php echo $row['posts_count'] ?></p>
<p>
<a href="posts.php?b_id=<?php echo $row['b_id'] ?>" class="btn btn-primary" role="button">进入</a>
</p>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</body>
<footer>
<br />
<h3 align="center">友情链接: <a href="http://10.12.218.56/sibylla/wangmeng/test/">教务系统首页</a></h3>
</footer>
</html>