NoteOnMe博客平台搭建
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

102 líneas
2.9 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"]) ||!isset($_GET["category"] ))
{
header('Location: index.php');
}
$stmt = $pdo->prepare('SELECT headline,public,article_id,content FROM article WHERE user_id = :user_id and category=:category');
$stmt->execute(array( ':user_id' => $_GET["user_id"],':category'=>$_GET["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 background" >
<ul style="margin-top:5em;" >
<?php
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) {
if(isset($_SESSION['user_id'])&&$_SESSION['user_id']==$_GET['user_id']){
echo ('<li><a href="view.php?article_id='.$row['article_id'].'">');
echo('<h1 class="section-title text-center dark-blue-text">');
echo(htmlentities($row['headline']));
echo("</h2></a> <p>");
$article= substr($row['content'],0,300);
echo(htmlentities($article));
echo("</p></li><hr/>");
}
else{
if($row['public']=="public")
{
echo ('<li><a href="view.php?article_id='.$row['article_id'].'">');
echo('<h1 class="section-title text-center dark-blue-text">');
echo(htmlentities($row['headline']));
echo("</h2></a> <p>");
$article= substr($row['content'],0,300);
echo(htmlentities($article));
echo("</p></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>