| Server IP : 104.21.80.248 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/news/group/ |
Upload File : |
<?php include("db.php");
//echo ini_get('display_errors');
ini_set('display_errors', '0');
//echo ini_get('display_errors');
include("header.php");
$id = $mysqli->escape_string($_GET['id']);
$mysqli->query("UPDATE posts SET views=views+1 WHERE id='$id'");
if(!isset($_SESSION['username'])){
}else{
$username1 = $_SESSION['username'];
$user1 = $mysqli->query("SELECT * FROM users WHERE username='$username1' LIMIT 1");
$userrow1 = mysqli_fetch_array($user1);
}
$story = $mysqli->query("SELECT * FROM posts WHERE id='$id' LIMIT 1");
$storyrow = mysqli_fetch_array($story);
$storydescription = stripslashes($storyrow['description']);
$userid = $storyrow['uid'];
$link = $storyrow['url'];
$cnid = $storyrow['id'];
if($storyrow['id'] < 4431){
list($original_width, $original_height) = getimagesize("".$storyrow['image']."");
}else{
list($original_width, $original_height) = getimagesize("uploads/".$storyrow['image']."");
}
//change image size
$max_width = 655;
$max_height = 400;
$ratio = ($max_width / $original_width < $max_height / $original_height
? $max_width / $original_width
: $max_height / $original_width
);
if ($original_width > $max_width || $original_height > $max_height) {
$new_width = $original_width * $ratio;
$new_height = $original_height * $ratio;
}
$user = $mysqli->query("SELECT * FROM users WHERE id='$userid' LIMIT 1");
$userrow = mysqli_fetch_array($user);
?>
<!DOCTYPE HTML>
<html>
<head>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrap/css/style.css" rel="stylesheet" >
<link href="bootstrap/icon/css/font-awesome.min.css" rel="stylesheet" >
<script src="bootstrap/js/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Sarabun&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.js"></script>
<script type="text/javascript">
$("[data-fancybox]").fancybox({ });
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo $storyrow['title'];?></title>
<link rel="icon" type="image/png" href="https://thaitextanalytic.com/asset/images/green/logo.png" />
<link rel="canonical" content="https://www.facebook.com/sharer.php?u=https://web.sesao8.go.th/news/group/story.php?id=<?php echo $storyrow['id'];?>" />
<meta property='og:type' content='article'/>
<meta property='og:title' content="<?php echo $storyrow['title'];?>" />
<meta property="og:image" content="https://web.sesao8.go.th/news/group/uploads/<?php echo $storyrow['image'];?>" />
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="myweb"/>
<meta property="og:url" content="https://web.sesao8.go.th/news/group/story.php?id=<?php echo $storyrow['id'];?>" >
<style type="text/css">
.gallery img {
width: 22%;
height: auto;
border-radius: 8px;
cursor: pointer;
transition: .4s;
}
</style>
<!-- Bootstrap core CSS -->
<link href="https://web.sesao8.go.th/news/csr/main/assets/css/bootstrap.min.css" rel="stylesheet">
<style>
.thumbnailx {
position: relative;
width: 150px;
height: 100px;
overflow: hidden;
}
.thumbnailx img {
position: absolute;
left: 50%;
top: 50%;
height: 100%;
width: auto;
-webkit-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
}
.thumbnailx img.portrait {
width: 100%;
height: auto;
}
.ox1 {
position: absolute;
margin-top: 50% !important;
margin-left: 80% !important;
margin-right: 0% !important;
padding: 0;
}
.ox2 {
position: absolute;
margin-top: 2% !important;
margin-left: 5% !important;
margin-right: 0% !important;
padding: 0;
}
.no {color: white; text-shadow: black 0.1em 0.1em 0.2em}
</style>
</style>
<?php
// Create the function, so you can use it
function isMobile() {
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}
// If the user is on a mobile device, redirect them
if(isMobile()) {
$x="135";
$y="97";
} else {
//echo "<div id='Layer1'><a href='index.php'><img src='images/logo.png'></a></div>";
$x="135";
$y="97";
$wt="900";
}
?>
<link rel="stylesheet" type="text/css" media="all" href="css/inland-forest.css">
<script>
$(document).ready(function(){
//Examples of how to assign the Colorbox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
$('.non-retina').colorbox({rel:'group5', transition:'none'})
$('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/th_TH/sdk.js#xfbml=1&appId=142536932596593&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<style type="text/css">
@media screen and (min-width: 768px) {
.modal-dialog {
width: 800px; /* New width for default modal */
}
.modal-sm {
width: 350px; /* New width for small modal */
}
}
@media screen and (min-width: 992px) {
.modal-lg {
width: 950px; /* New width for large modal */
}
}
P { font-family: 'Sarabun', sans-serif;
font-size: 16px;
line-height: 18pt;
}
.i-am-centered { margin: auto; max-width: 800px;}
</style>
<style>
body {
background-color: white;
}
</style>
</head>
<body >
<div id="fb-root"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v2.3&appId=142536932596593";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="wrapper960" >
<div class="container">
<div class="row">
<div style="width:<?=$wt;?>px;"><br>
<center><font style="font-size:20px"><?php echo $storyrow['title'];?></font></center>
</div>
</div>
</div>
<br>
<?php
$photo = $mysqli->query("SELECT * FROM photo where id_news='$id'");
?>
<center>
<div class="row">
<div class="col-sm-12">
<?php
$txtdetail = $storydescription;
$detailtxt = preg_replace('/font-family.+?;/', "", $txtdetail);;
?>
<?php if($cnid > 4430) { ?>
<img class="img-thumbnail" src="uploads/<?=$storyrow['image'];?>" alt="<?php echo $storyrow['title']; ?>">
<?php } else {?>
<img class="img-thumbnail" src="<?=$storyrow['image'];?>" alt="<?php echo $storyrow['title']; ?>">
<?php } ?>
<br>
</div>
</div>
</center><br>
<div class="container">
<div class="row">
<div class="col-sm-12">
<?php echo $detailtxt;?>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12">
<?php
$upfile = $mysqli->query("SELECT * FROM file WHERE id_news='$id' ");
$row_file = mysqli_fetch_array($upfile);
$idnewsfile=$row_file['id'];
$filename=$row_file['detail'];
if ($idnewsfile > 0) {
$file = $mysqli->query("SELECT * FROM file where id_news='$id'");
echo "<table border='0' cellspacing='0' cellpadding='0' bordercolor='#FFFFCC' bgcolor='#FFCC00'>";
$num=1;
while($file_row = mysqli_fetch_array($file)){
$fileid=$file_row['id'];
$filidnews=$file_row['id_news'];
$detail=$file_row['detail'];
$file_name=$file_row['file_name'];
echo "<tr style='height: 0.7cm;'>";
echo "<td style='BORDER-BOTTOM: #CCC 1px dotted' bgcolor='#eef4fc'> <img src='images/attachfile.gif'></td>";
echo "<td style='BORDER-BOTTOM: #CCC 1px dotted' bgcolor='#eef4fc'><font color='red'><b><a href='myfile/$file_name' target='_blank' >$detail</b></font> ";
$filetotal = filesize("myfile/$file_name") ;
echo "(ขนาด ". round($filetotal/1024) . " KB) ";
echo "</td>";
echo "</tr>";
$num++;
}
echo"</table><br>";
} else {}
?>
</div>
</div>
</div><br>
<div class="container i-am-centered">
<div class="row">
<?php
$intRows = 0;
while($storypoprow = mysqli_fetch_array($photo)){
$intRows++;
?>
<a data-fancybox="group" href="myphoto/<?php echo $storypoprow['photo_name'];?>?image=<?php echo $storypoprow['id'];?>">
<div class="card d-flex align-items-stretch" >
<div class="thumbnailx">
<img class="portrait" src="myphoto/<?php echo $storypoprow['photo_name'];?>?image=<?php echo $storypoprow['id'];?>" >
</div>
<div class="card-img-overlay ox2 no">
<?=$intRows;?>
</div>
</div>
</a>
<?php } ?>
</div>
</div>
<?php
$userid = $storyrow['uid'];
$user = $mysqli->query("SELECT * FROM users WHERE id='$userid' LIMIT 1");
$userrow = mysqli_fetch_array($user);
?>
<div class="look-up-story">
<?php if(!isset($_SESSION['username'])){?>
<?php }elseif
($userrow['id']=="$userrow1[id]") {
?>
<a href="edit_news.php?id=<?php echo $storyrow['id'];?>">แก้ไข</a>
<a class="red-button" href="delete_news.php?id=<?php echo $storyrow['id'];?>">ลบ</a>
<?php } ?>
<br>
<div class="look-up-story">
<div class="fb-share-button" data-type="button_count"></div> <br>
</div><!--look-up-->
</div><!--submit box-->
<table width="100%" border="0" cellpadding="2">
<tr>
<td bgcolor="#F1E7D7"><div align="center"><img src="images/shadow.png">
</div>
<center> <p>เขียนโดย <?php echo $storyrow['ppost'];?> <a href="category-<?php echo $storyrow['cat_id'];?>-1.html"><?php echo $userrow['school'];?></a> เปิดอ่าน <?php echo number_format($storyrow['views']);?> ครั้ง เขียนเมื่อ <?php echo $storyrow['date'];?></p></center>
</td>
</tr>
</table>
<div class="fb-comments" data-href="https://web.sesao8.go.th/news/group/story.php?id=<?php echo $storyrow['id'];?>" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
<div id="content" class="clearfix shadow"><br>
</div>
<style type="text/css">
<!--
.style39 {
color: #FFFFFF;
font-size: 14px;
}
-->
</style>
<center>
<script data-ad-client="ca-pub-6461791533063032" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<div class="row">
<div class="col-xs-2" align="right">
</div>
<div class="col-xs-8" align="center">
</div>
<div class="col-xs-2" align="center">
<img src="images/qrcode.png" height="120">
</div>
</div>
</center>
<div id="footer" class="shadow">
<p align="center">
© 2015 สำนักงานเขตพื้นที่การศึกษามัธยมศึกษา เขต 8 <br>
เว็บไซต์ http://www.sesao8.go.th<br></p>
</div>
</div></div>
</body>
</html>