NoteOnMe博客平台搭建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 lines
2.7 KiB

<!DOCTYPE html>
<head>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="js/jquery.singlePageNav.min.js"></script>
<script src="js/setting.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/templatemo-style.css?t={{time()}}">
</head><body>
<?php
require_once "pdo.php";
session_start();
if(!isset($_GET["user_id"] ))
{
header('Location: index.php');
}
$stmt = $pdo->prepare('SELECT category,public FROM article WHERE user_id = :user_id');
$stmt->execute(array( ':user_id' => $_GET["user_id"]));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ( $row == false ) {
$flag=0;
}
else{
$flag=1;
if(isset($_SESSION['user_id'])&&$_SESSION['user_id']==$_GET['user_id'])
{
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) {
if($row['category']!=null)
{
$category[]=$row['category'];
}
}
}
else{
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) {
if($row['category']!=null&&$row['public']=="public")
{
$category[]=$row['category'];
}
}
}
$category=array_unique($category);
}
?>
<div class="fixed-header">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">NOTE</a>
</div>
<nav class="main-menu">
<ul>
<li><a class="external" href="index.php">Home</a></li>
<li><div class="hidee"><a class=" external " href="edit_article.php">新文章</a></div></li>
</ul>
</nav>
</div>
</div>
<div class="container">
<section class="col-md-12 content" id="home">
<div class="col-lg-12 col-md-12 content-item content-item-1">
<ul><hr/>
<?php
if($flag){
foreach($category as $cat) {
echo ('<li style="list-style:none; "><a class="mytitle" href="personal_page2.php?category='.$cat.'&&user_id='.$_GET["user_id"].'">');
echo('<h6 class="section-title text-center ">');
echo(htmlentities($cat));
echo("</h6></a> ");
echo("</li><hr/>");
}
}
?>
</ul>
<p class="section-title text-center mytitle">M<br/>O<br/>R<br/>E<br/> ...<br/>
</p>
</div>
</section>
</div>
</body>
</html>