HEX
Server: LiteSpeed
System: Linux premium313.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User: wekawqug (1662)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/wekawqug/ndondocup.sisihub.co.tz/stories.php
<div class="row">
          <div class="col-md-9">
           <!--START MAIN BLOCK-->
           <?php
            $where = '';
          
            if(isset($_GET['q'])){
               $where = " and md5(p.category_id) = '{$_GET['q']}' ";

            }
              $news = $conn->query("SELECT p.*,c.category from post_list p inner join category_list c on c.id = p.category_id where status = 1 $where AND p.category_id = 2 AND p.side = 'top' order by unix_timestamp(date_published) desc LIMIT 1");
             
              if($news->num_rows > 0):
                while($row = $news->fetch_assoc()):
                  // Format date_published to display only the date part (YYYY-MM-DD)
                  $date_published = date('F j, Y', strtotime($row['date_published']));

                  $trans = get_html_translation_table(HTML_ENTITIES,ENT_QUOTES);
                    unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
                    $desc = strtr(html_entity_decode($row['content']),$trans);
                    $desc=str_replace(array("<li>","</li>"), array("",", "), $desc);
                   
                      
                
            ?>
            <div class="d-lg-flex post-entry-2">
              <a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>' class="me-4 thumbnail mb-4 mb-lg-0 d-inline-block">
                <img src="assets/uploads/content_images/<?php echo $row['cover_img'] ?>" alt="" class="img-fluid">
              </a>
              <div>
                <div class="post-meta"><span class="date">Mastory</span> <span class="mx-1">&bullet;</span> <span><?php echo $date_published ?></span></div>
                <h2 ><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>' style="color:#010101"><?php echo $row['title'] ?></a></h2>
                <p><?php echo strip_tags($desc) ?></p>
                <div class="d-flex align-items-center author">
                  <div class="photo"><img src="assets/uploads/content_images/<?php echo $row['cover_img'] ?>" alt="" class="img-fluid"></div>
                  <div class="name">
                    <h3 class="m-0 p-0">Amri Kiemba</h3>
                  </div>
                </div>
              </div>
            </div>
            <?php    endwhile;     endif;?>
            <!--END BLOCK-->

            <div class="row">
              <div class="col-lg-4">
                  <!--BEGIN LEFT 1 BLOCK-->
                  <?php
                    $where = '';
                    if (isset($_GET['q'])) {
                        $where = " AND md5(p.category_id) = '{$_GET['q']}' ";
                    }

                    $news = $conn->query("SELECT p.*, c.category FROM post_list p INNER JOIN category_list c ON c.id = p.category_id WHERE status = 1 $where AND p.category_id = 2 AND p.side = 'left' ORDER BY unix_timestamp(date_published) DESC LIMIT 1");

                    if ($news->num_rows > 0):
                        $row = $news->fetch_assoc();
                        // Format date_published to display only the date part (YYYY-MM-DD)
                        $date_published = date('F j, Y', strtotime($row['date_published']));

                        $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
                        unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
                        $desc = strtr(html_entity_decode($row['content']), $trans);
                        $desc = str_replace(array("<li>", "</li>"), array("", ", "), $desc);
                        ?>
                            <div class="post-entry-1 border-bottom">                   
                            <a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>'><img src="assets/uploads/content_images/<?php echo $row['cover_img'] ?>" alt="" class="img-fluid"></a>
                            <div class="post-meta"><span class="date">Mastory</span> <span class="mx-1">&bullet;</span> <span><?php echo $date_published ?></span></div>
                            <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>'><?php echo $row['title'] ?></a></h2>
                            <span class="author mb-3 d-block">Alex Lwambano</span>
                            <p class="mb-4 d-block"><?php echo strip_tags($desc) ?></p>
                            </div>
                            <?php endif;?>
                 <!--END BLOCK-->
                

                 <!--BEGIN LEFT 2 BLOCK-->
                 <?php
                    $where = '';
                    if (isset($_GET['q'])) {
                        $where = " AND md5(p.category_id) = '{$_GET['q']}' ";
                    }

                    $news = $conn->query("SELECT p.*, c.category FROM post_list p INNER JOIN category_list c ON c.id = p.category_id WHERE status = 1 $where AND p.category_id = 2 AND p.side = 'left' ORDER BY unix_timestamp(date_published) DESC LIMIT 1 OFFSET 1");

                    if ($news->num_rows > 0):
                        $row = $news->fetch_assoc();
                        // Format date_published to display only the date part (YYYY-MM-DD)
                        $date_published = date('F j, Y', strtotime($row['date_published']));

                        $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
                        unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
                        $desc = strtr(html_entity_decode($row['content']), $trans);
                        $desc = str_replace(array("<li>", "</li>"), array("", ", "), $desc);
                        ?>
                        <div class="post-entry-1">
                        <div class="post-meta"><span class="date">Mastory</span> <span class="mx-1">&bullet;</span> <span><?php echo $date_published ?></span></div>
                        <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>'><?php echo $row['title'] ?></a></h2>
                        <span class="author mb-3 d-block">Shaffih Dauda</span>
                        </div>
                        <?php  endif;?>
                 <!--END BLOCK-->
                 
              </div>
              <div class="col-lg-8">
                 <!--BEGIN MIDDLE BLOCK-->
                 <?php
                    $where = '';
                    if (isset($_GET['q'])) {
                        $where = " AND md5(p.category_id) = '{$_GET['q']}' ";
                    }

                    $news = $conn->query("SELECT p.*, c.category FROM post_list p INNER JOIN category_list c ON c.id = p.category_id WHERE status = 1 $where AND p.category_id = 2 AND p.side = 'middle' ORDER BY unix_timestamp(date_published) DESC LIMIT 1");

                    if ($news->num_rows > 0):
                        $row = $news->fetch_assoc();
                        // Format date_published to display only the date part (YYYY-MM-DD)
                        $date_published = date('F j, Y', strtotime($row['date_published']));

                        $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
                        unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
                        $desc = strtr(html_entity_decode($row['content']), $trans);
                        $desc = str_replace(array("<li>", "</li>"), array("", ", "), $desc);
                        ?>
                <div class="post-entry-1">
                  <a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>'><img src="assets/uploads/content_images/<?php echo $row['cover_img'] ?>" alt="" class="img-fluid"></a>
                  <div class="post-meta"><span class="date">Mastory</span> <span class="mx-1">&bullet;</span> <span><?php echo $date_published ?></span></div>
                  <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>'><?php echo $row['title'] ?></a></h2>
                  <span class="author mb-3 d-block">Cotinho</span>
                  <p class="mb-4 d-block"><?php echo strip_tags($desc) ?></p>
                </div>
                <?php  endif;?>
                 <!--END BLOCK-->
              </div>
            </div>
          </div>

          <div class="col-md-3">
            <!--BEGIN LIST BLOCK-->
            <?php
                    $where = '';
                    if (isset($_GET['q'])) {
                        $where = " AND md5(p.category_id) = '{$_GET['q']}' ";
                    }

                    $news = $conn->query("SELECT p.*, c.category FROM post_list p INNER JOIN category_list c ON c.id = p.category_id WHERE status = 1 $where AND p.category_id = 2 AND p.side = 'list' ORDER BY unix_timestamp(date_published) DESC LIMIT 6");

                    if ($news->num_rows > 0):
                        while($row = $news->fetch_assoc()):
                        // Format date_published to display only the date part (YYYY-MM-DD)
                        $date_published = date('F j, Y', strtotime($row['date_published']));

                        $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
                        unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
                        $desc = strtr(html_entity_decode($row['content']), $trans);
                        $desc = str_replace(array("<li>", "</li>"), array("", ", "), $desc);
                        ?>
            <div class="post-entry-1 border-bottom">
              <div class="post-meta"><span class="date">Mastory</span> <span class="mx-1">&bullet;</span> <span><?php echo $date_published ?></span></div>
              <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>" data-id = '<?php echo $row['id'] ?>'><?php echo $row['title'] ?></a></h2>
              <span class="author mb-3 d-block">Masoud Kipanya</span>
            </div>
            <?php  endwhile; endif;?>           

            <!--END LIST BLOCK-->
          </div>
        </div>