<?php
$this_page = "feed";
require_once("../inc/conx.php");
if($logged_in == false) {
  header("location: /");
  exit();
}
$get_rstr = safe($_GET['i']);
if(mysqli_num_rows($gpostq = mysqli_query($conx, "SELECT id FROM feed WHERE random_str='$get_rstr'")) != 1) {
  header("location: /feed");
  exit();
}
?>
<!DOCTYPE html>
<html>
<head>
  <title>Feed - Misdew</title>
  <meta charset="utf-8">
  <meta name="description" content="We are a fairly cool social network.">
  <meta name="keywords" content="Misdew, MD, Social, Network, Communication, 3DS, DSi, Nintendo">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="google" value="notranslate">
  <meta name="theme-color" content="<?php echo $meta_theme_color; ?>">
  <?php
  if($css_type == "sheet") {
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$g_sheet\">";
  }
  if($css_type == "raw") {
    echo "<style type=\"text/css\">$g_raw</style>";
  }
  ?>

  <link rel="icon" type="image/png" href="/img/favicon.png">
  <link rel="apple-touch-icon" href="/img/logo.png">
  <style type="text/css">
  body {
    background-color: <?php echo $bgcolor; ?>;
  }
  .header_tds {
    background-color: <?php echo $tdcolor; ?>;
  }
  </style>
</head>
<body>
  <center>
    <?php
    $back_button = true;
    $linebreak = true;
    require_once("../inc/header.php");
    ?>
    <div id="postIt">
      <form id="feed_form" method="post" action="ppost.php?i=<?php echo "$get_rstr&&"; ?>share=true">
        <table class="postbox_tb">
          <tr>
            <td>
              <textarea id="fpostb" name="body" rows="4" class="feed_parea" placeholder="type something..."><?php echo $post_text; ?></textarea>
            </td>
          </tr>
        </table>
        <table class="postbox_tb" id="postbox_tb2">
            <td class="postbox2_td2">
              <input type="submit" value="share" class="postbox_sub" style="width: 90%;" onclick="this.disabled=true;this.value='sharing...';this.form.submit();">
            </td>
          </tr>
        </table>
      </form>
    </div>
    <?php
    require_once("../inc/footer.php");
    ?>
  </center>
</body>
</html>
