<commit_before><?php 
  session_start();
  if (isset($_SESSION["isLogin"])){
 ?>

<!DOCTYPE html>
<?php 
    include 'mainviewer.php';
    $con = phpsqlconnection();
    $postid = htmlspecialchars($_GET['postid'], ENT_QUOTES, 'UTF-8');
    $getpostresult = getspecificpost($con,$postid);
    $row = mysqli_fetch_array($getpostresult);
    $getcommentsresult = getspecificcomments($con,$postid);
 ?>
<html>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="Deskripsi Blog">
<meta name="author" content="<NAME>">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="omfgitsasalmon">
<meta name="twitter:title" content="Simple Blog">
<meta name="twitter:description" content="Deskripsi Blog">
<meta name="twitter:creator" content="Simple Blog">
<meta name="twitter:image:src" content="{{! TODO: ADD GRAVATAR URL HERE }}">

<meta property="og:type" content="article">
<meta property="og:title" content="Simple Blog">
<meta property="og:description" content="Deskripsi Blog">
<meta property="og:image" content="{{! TODO: ADD GRAVATAR URL HERE }}">
<meta property="og:site_name" content="Simple Blog">

<link rel="stylesheet" type="text/css" href="assets/css/screen.css" />
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">

<!--[if lt IE 9]>
    <script src=""data:application/octet-stream;base64,LyoKIEhUTUw1IFNoaXYgdjMuNy4wIHwgQGFmYXJrYXMgQGpkYWx0b24gQGpvbl9uZWFsIEByZW0gfCBNSVQvR1BMMiBMaWNlbnNlZAoqLwooZnVuY3Rpb24obCxmKXtmdW5jdGlvbiBtKCl7dmFyIGE9ZS5lbGVtZW50cztyZXR1cm4ic3RyaW5nIj09dHlwZW9mIGE/YS5zcGxpdCgiICIpOmF9ZnVuY3Rpb24gaShhKXt2YXIgYj1uW2Fbb11dO2J8fChiPXt9LGgrKyxhW29dPWgsbltoXT1iKTtyZXR1cm4gYn1mdW5jdGlvbiBwKGEsYixjKXtifHwoYj1mKTtpZihn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W1lbnR9Zz1ifWNhdGNoKGQpe2c9aj0hMH19KSgpO3ZhciBlPXtlbGVtZW50czprLmVsZW1lbnRzfHwiYWJiciBhcnRpY2xlIGFzaWRlIGF1ZGlvIGJkaSBjYW52YXMgZGF0YSBkYXRhbGlzdCBkZXRhaWxzIGRpYWxvZyBmaWdjYXB0aW9uIGZpZ3VyZSBmb290ZXIgaGVhZGVyIGhncm91cCBtYWluIG1hcmsgbWV0ZXIgbmF2IG91dHB1dCBwcm9ncmVzcyBzZWN0aW9uIHN1bW1hcnkgdGVtcGxhdGUgdGltZSB2aWRlbyIsdmVyc2lvbjoiMy43LjAiLHNoaXZDU1M6ITEhPT1rLnNoaXZDU1Msc3VwcG9ydHNVbmtub3duRWxlbWVudHM6ZyxzaGl2TWV0aG9kczohMSE9PWsuc2hpdk1ldGhvZHMsdHlwZToiZGVmYXVsdCIsc2hpdkRvY3VtZW50OnEsY3JlYXRlRWxlbWVudDpwLGNyZWF0ZURvY3VtZW50RnJhZ21lbnQ6ZnVuY3Rpb24oYSxiKXthfHwoYT1mKTsKaWYoZylyZXR1cm4gYS5jcmVhdGVEb2N1bWVudEZyYWdtZW50KCk7Zm9yKHZhciBiPWJ8fGkoYSksYz1iLmZyYWcuY2xvbmVOb2RlKCksZD0wLGU9bSgpLGg9ZS5sZW5ndGg7ZDxoO2QrKyljLmNyZWF0ZUVsZW1lbnQoZVtkXSk7cmV0dXJuIGN9fTtsLmh0bWw1PWU7cShmKX0pKHRoaXMsZG9jdW1lbnQpOwo="></script>
<![endif]-->

<?php 
    echo 
        "<title>Simple Blog | ".htmlspecialchars($row['Title'], ENT_QUOTES, 'UTF-8')."</title>";
 ?>


</head>

<body class="default">
<div class="wrapper">

<nav class="nav">
    <a style="border:none;" id="logo" href="index.php"><h1>Simple<span>-</span>Blog</h1></a>
    <ul class="nav-primary">
        <li><a href="new_post.php">+ Tambah Post</a></li>
    </ul>
</nav>

<article class="art simple post">
    
    <header class="art-header">
        <div class="art-header-inner" style="margin-top: 0px; opacity: 1;">
            <?php 
              $time = strtotime(htmlspecialchars($row['Date'], ENT_QUOTES, 'UTF-8'));
              $time = date('j F Y',$time);
              echo "<time class=\"art-time\">".$time."</time>";
             ?>
             <?php 
              echo "<h2 class=\"art-title\">".htmlspecialchars($row['Title'], ENT_QUOTES, 'UTF-8')."</h2>";
              ?>
              <?php 
                echo "<h6 style= 'text-align: center;'> by : ".$row['Nama']."</h6>";
                ?>
            <p class="art-subtitle"></p>
        </div>
    </header>

    <div class="art-body">
        <div class="art-body-inner">
            <hr class="featured-article" />
            <?php 
                echo "<p>".htmlspecialchars($row['Contents'], ENT_QUOTES, 'UTF-8')."</p>";
             ?>
            <hr />
            
            <h4>Komentar</h4>

            <div id="contact-area">
                <?php 
                    echo 
                    "<form name=\"AddComment\" method=\"post\"  onSubmit=\"return showcomments(".$postid.",Komentar.value)\">";
                 ?> 
                    <label for="Komentar">Komentar:</label><br>
                    <textarea name="Komentar" rows="20" cols="20" id="Komentar"></textarea>

                    <input type="submit" name="submit" value="Kirim" class="submit-button">
                </form>
            </div>
            <ul class="art-list-body" id ="comments">
                        <?php 
                            while($comments = mysqli_fetch_array($getcommentsresult)) {                                
                                echo
                                "<li class=\"art-list-item\">
                                <div class=\"art-list-item-title-and-time\">";
                                $time = strtotime(htmlspecialchars($comments['Time'], ENT_QUOTES, 'UTF-8'));
                                $time = date('j F Y',$time);
                                echo 
                                "<div class=\"art-list-time\">".$time."</div> </div>";
                                echo
                                "<p> By: ".htmlspecialchars($comments['Nama'], ENT_QUOTES, 'UTF-8')."<br>". 
                                "".htmlspecialchars($comments['Contents'], ENT_QUOTES, 'UTF-8')."</p>";                                
                                echo "</li>";
                            }
                         ?>
            </ul>
        </div>
    </div>

</article>

<footer class="footer">
    <div class="back-to-top"><a href="">Back to top</a></div>
    <!-- <div class="footer-nav"><p></p></div> -->
    <div class="psi">&Psi;</div>
    <aside class="offsite-links">
        Asisten IF3110 /
        <a class="rss-link" href="#rss">RSS</a> /
        <br>
        <a class="twitter-link" href="http://twitter.com/YoGiiSinaga">Yogi</a> /
        <a class="twitter-link" href="http://twitter.com/sonnylazuardi">Sonny</a> /
        <a class="twitter-link" href="http://twitter.com/fathanpranaya">Fathan</a> /
        <br>
        <a class="twitter-link" href="#">Renusa</a> /
        <a class="twitter-link" href="#">Kelvin</a> /
        <a class="twitter-link" href="#">Yanuar</a> /
        
    </aside>
</footer>

</div>

<script type="text/javascript" src="assets/js/fittext.js"></script>
<script type="text/javascript" src="assets/js/app.js"></script>
<script type="text/javascript" src="assets/js/respond.min.js"></script>
<script>
function showcomments(postid, contents) 
{
  if (window.XMLHttpRequest) {
    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  } else { // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function() 
  {
    if (xmlhttp.readyState==4 && xmlhttp.status==200) 
    {
      document.getElementById ("comments").innerHTML=xmlhttp.responseText;
      document.forms.value = "";
    }
  }

  xmlhttp.open("GET","getcomments.php?postid="+postid+"&contents="+contents,true);
  xmlhttp.send();
  return false;
}
</script>
<script>
  function validateEmail() {
    var x = document.forms["AddComment"]["Email"].value;
    var atpos = x.indexOf("@");
    var dotpos = x.lastIndexOf(".");
    if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
        alert("Email tidak valid");
        return false;
    }
    else
    {
      return true;      
    }
}
</script>
</body>
</html>
<?php 
    }else{
        header("Location: login.php"); /* Redirect browser */
        exit();
    }
 ?><commit_msg>Image view in post detail<commit_after><?php 
  session_start();
  if (isset($_SESSION["isLogin"])){
 ?>

<!DOCTYPE html>
<?php 
    include 'mainviewer.php';
    $con = phpsqlconnection();
    $postid = htmlspecialchars($_GET['postid'], ENT_QUOTES, 'UTF-8');
    $getpostresult = getspecificpost($con,$postid);
    $row = mysqli_fetch_array($getpostresult);
    $getcommentsresult = getspecificcomments($con,$postid);
 ?>
<html>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="Deskripsi Blog">
<meta name="author" content="<NAME>">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="omfgitsasalmon">
<meta name="twitter:title" content="Simple Blog">
<meta name="twitter:description" content="Deskripsi Blog">
<meta name="twitter:creator" content="Simple Blog">
<meta name="twitter:image:src" content="{{! TODO: ADD GRAVATAR URL HERE }}">

<meta property="og:type" content="article">
<meta property="og:title" content="Simple Blog">
<meta property="og:description" content="Deskripsi Blog">
<meta property="og:image" content="{{! TODO: ADD GRAVATAR URL HERE }}">
<meta property="og:site_name" content="Simple Blog">

<link rel="stylesheet" type="text/css" href="assets/css/screen.css" />
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">

<!--[if lt IE 9]>
    <script src=""data:application/octet-stream;base64,LyoKIEhUTUw1IFNoaXYgdjMuNy4wIHwgQGFmYXJrYXMgQGpkYWx0b24gQGpvbl9uZWFsIEByZW0gfCBNSVQvR1BMMiBMaWNlbnNlZAoqLwooZnVuY3Rpb24obCxmKXtmdW5jdGlvbiBtKCl7dmFyIGE9ZS5lbGVtZW50cztyZXR1cm4ic3RyaW5nIj09dHlwZW9mIGE/YS5zcGxpdCgiICIpOmF9ZnVuY3Rpb24gaShhK<KEY>></script>
<![endif]-->

<?php 
    echo 
        "<title>Simple Blog | ".htmlspecialchars($row['Title'], ENT_QUOTES, 'UTF-8')."</title>";
 ?>


</head>

<body class="default">
<div class="wrapper">

<nav class="nav">
    <a style="border:none;" id="logo" href="index.php"><h1>Simple<span>-</span>Blog</h1></a>
    <ul class="nav-primary">
        <li><a href="new_post.php">+ Tambah Post</a></li>
    </ul>
</nav>

<article class="art simple post">
    
    <header class="art-header">
        <div class="art-header-inner" style="margin-top: 0px; opacity: 1;">
            <?php 
              $time = strtotime(htmlspecialchars($row['Date'], ENT_QUOTES, 'UTF-8'));
              $time = date('j F Y',$time);
              echo "<time class=\"art-time\">".$time."</time>";
             ?>
             <?php 
              echo "<h2 class=\"art-title\">".htmlspecialchars($row['Title'], ENT_QUOTES, 'UTF-8')."</h2>";
              ?>
              <?php 
                echo "<h6 style= 'text-align: center;'> by : ".$row['Nama']."</h6>";
                ?>
            <p class="art-subtitle"></p>
        </div>
    </header>

    <div class="art-body">
        <div class="art-body-inner">
            <hr class="featured-article" />
            <?php 
                echo "<p>".htmlspecialchars($row['Contents'], ENT_QUOTES, 'UTF-8')."</p>";
             ?>
            <hr />
            
            <h4>Komentar</h4>

            <div id="contact-area">
                <?php 
                    echo 
                    "<form name=\"AddComment\" method=\"post\"  onSubmit=\"return showcomments(".$postid.",Komentar.value)\">";
                 ?> 
                 <?php 
                    if (isset($row['Image'])) {
                        echo "<img src=\"".$row['Image']."\" alt=\"\">";                            
                    }
                  ?>

                    <label for="Komentar">Komentar:</label><br>
                    <textarea name="Komentar" rows="20" cols="20" id="Komentar"></textarea>

                    <input type="submit" name="submit" value="Kirim" class="submit-button">
                </form>
            </div>
            <ul class="art-list-body" id ="comments">
                        <?php 
                            while($comments = mysqli_fetch_array($getcommentsresult)) {                                
                                echo
                                "<li class=\"art-list-item\">
                                <div class=\"art-list-item-title-and-time\">";
                                $time = strtotime(htmlspecialchars($comments['Time'], ENT_QUOTES, 'UTF-8'));
                                $time = date('j F Y',$time);
                                echo 
                                "<div class=\"art-list-time\">".$time."</div> </div>";
                                echo
                                "<p> By: ".htmlspecialchars($comments['Nama'], ENT_QUOTES, 'UTF-8')."<br>". 
                                "".htmlspecialchars($comments['Contents'], ENT_QUOTES, 'UTF-8')."</p>";                                
                                echo "</li>";
                            }
                         ?>
            </ul>
        </div>
    </div>

</article>

<footer class="footer">
    <div class="back-to-top"><a href="">Back to top</a></div>
    <!-- <div class="footer-nav"><p></p></div> -->
    <div class="psi">&Psi;</div>
    <aside class="offsite-links">
        Asisten IF3110 /
        <a class="rss-link" href="#rss">RSS</a> /
        <br>
        <a class="twitter-link" href="http://twitter.com/YoGiiSinaga">Yogi</a> /
        <a class="twitter-link" href="http://twitter.com/sonnylazuardi">Sonny</a> /
        <a class="twitter-link" href="http://twitter.com/fathanpranaya">Fathan</a> /
        <br>
        <a class="twitter-link" href="#">Renusa</a> /
        <a class="twitter-link" href="#">Kelvin</a> /
        <a class="twitter-link" href="#">Yanuar</a> /
        
    </aside>
</footer>

</div>

<script type="text/javascript" src="assets/js/fittext.js"></script>
<script type="text/javascript" src="assets/js/app.js"></script>
<script type="text/javascript" src="assets/js/respond.min.js"></script>
<script>
function showcomments(postid, contents) 
{
  if (window.XMLHttpRequest) {
    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  } else { // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function() 
  {
    if (xmlhttp.readyState==4 && xmlhttp.status==200) 
    {
      document.getElementById ("comments").innerHTML=xmlhttp.responseText;
      document.forms.value = "";
    }
  }

  xmlhttp.open("GET","getcomments.php?postid="+postid+"&contents="+contents,true);
  xmlhttp.send();
  return false;
}
</script>
<script>
  function validateEmail() {
    var x = document.forms["AddComment"]["Email"].value;
    var atpos = x.indexOf("@");
    var dotpos = x.lastIndexOf(".");
    if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
        alert("Email tidak valid");
        return false;
    }
    else
    {
      return true;      
    }
}
</script>
</body>
</html>
<?php 
    }else{
        header("Location: login.php"); /* Redirect browser */
        exit();
    }
 ?>
{'fraction_non_alphanumeric': 0.15306481916392672, 'fraction_numerical': 0.03152888680131517, 'mean_word_length': 3.007764705882353, 'pattern_counts': {'":': 0, '<': 300, '<?xml version=': 0, '>': 298, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5470851', 'n_tokens_mistral': 7144, 'n_tokens_neox': 6792, 'n_words': 749}