コード例 #1
0
<?php

session_start();
require_once 'php/db.php';
require_once 'php/function.php';
if (isset($_GET['p'])) {
    $postindexnumber = $_GET['p'];
    $article = getarticle($_GET['p']);
    if (isset($_SESSION['is_login']) && $_SESSION['is_login'] == true) {
        $loginusername = $_SESSION["name"];
    }
}
if (isset($_POST['submit'])) {
    $sql = "insert into msg (username,content,lastdate,postindex) \n\t\tvalues ('{$loginusername}','{$_POST['content']}',now(),'{$postindexnumber}')";
    mysql_query($sql);
}
?>
<!DOCTYPE html>
<html lang="zh-TW">
	<head>
		<meta charset="utf-8">
		<title>日月潭釣友網</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
		<!-- Le styles -->
		<!-- TODO: make sure bootstrap.min.css points to BootTheme generated file
		-->
		<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			body {
コード例 #2
0
function createarticlepage($artid)
{
    include '../scripts/sessionstart.php';
    include '../scripts/articleparse.php';
    include '../scripts/getsetarticle.php';
    $content = getarticle($artid);
    if ($content["articleid"] == null) {
        header('Location: /404.php');
    } else {
        newvisit($artid);
        echo '<!DOCTYPE html>
		<html lang="en">
		<head>
			<meta charset="UTF-8">
			<title>Explore The World</title>
			<link rel="stylesheet" href="/css/meyerweb.css"/>
			<link rel="stylesheet" href="/css/articlestyle.css"/>';
        echo '<style>
			body{
				/*background-color: #f22;*/
				background: url("' . $content['imgurl'] . '");
				background-attachment: fixed;
				-webkit-background-size: cover;
				background-size: cover;
				background-position: center;}
			</style>';
        if ($content['imgurl'] == null or $content['imgurl'] == "") {
            echo '<link rel="stylesheet" href="/css/nonimg.css"/>';
        }
        echo "</head><body>";
        echo '<header>
			<h1><span> ' . $content['author'] . '</span></h1>
			<div class="clear"></div>';
        if (!($content['ainfo'] == null) and !($content['ainfo'] == "")) {
            echo '<p><span>' . $content['ainfo'] . '</span></p>
				<div class="clear"></div>';
        }
        if ($content['privat'] == 0) {
            echo '<p id=e" ><a href="mailto:' . $content['email'] . '">' . $content['email'] . '</a></p>';
        }
        echo '</header>
			<div class="contfootwrap">
				<div class="content_wrapper">
					<div class="content">';
        echo articleparse($content['article']);
        echo '</div>

					</div>
					<footer>
						<div class="inline"><a href="/index.php"><h1>Explore The World</h1></a></div>
						<div class="inline" id="copyright">
							<p>Creatred by Yakov Yusipenko</p>
							<p>Contact me <a href="mailto:myemail@explore.world">myemail@explore.world</a></p>
						</div>
					</footer>

				</div>


			</body>
			</html>';
    }
}