HEX
Server: LiteSpeed
System: Linux in-mum-web921.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: u590867752 (590867752)
PHP: 8.2.33
Disabled: NONE
Upload Files
File: /home/u590867752/domains/himanshuartinstitute.com/public_html/wall/gallery.php
 <?php 
 
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");

include($_SERVER['DOCUMENT_ROOT']."/wall/baba/shiva.php");
$gallery_filter = strtolower(
    trim((string)($_GET['type'] ?? 'all'))
);

if(
    !in_array(
        $gallery_filter,
        [
            'all',
            'images',
            'videos',
            'polls'
        ],
        true
    )
){
    $gallery_filter = 'all';
}

$gallery_type_condition = '';

if($gallery_filter === 'images'){

    $gallery_type_condition =
        " AND post_type = 'artwork'";

}elseif($gallery_filter === 'videos'){

    $gallery_type_condition =
        " AND post_type = 'youtube'";

}elseif($gallery_filter === 'polls'){

    $gallery_type_condition =
        " AND post_type = 'poll'";
}

function getPostGroupLabel($date){
    if(empty($date)) return "Old";
    $postTime = strtotime($date);
    // Normalize today's start
    $today = strtotime(date('Y-m-d'));
    // Calculate days difference
    $diffDays = floor(($today - strtotime(date('Y-m-d', $postTime))) / 86400);
    if ($diffDays == 0) {
        return "Today";
    } 
    elseif ($diffDays == 1) {
        return "Yesterday";
    } 
    elseif ($diffDays <= 7) {
        return date('l', $postTime); // Monday, Tuesday
    } 
    else {
        return date("j F Y", $postTime); // Full Date
    }
}?>




<!DOCTYPE html>
<html>
<head>
<meta name="robots" content="index, follow, max-image-preview:large">
<link rel="canonical" href="https://www.himanshuartinstitute.com/wall/gallery.php">
<meta charset="UTF-8">
<title>HAI Wall – Share Your Artwork | Himanshu Art Institute</title>
<meta name="description" content="Join Himanshu Art Institute Wall to share your drawings and paintings, connect with artists, and explore creative ideas. Learn art, showcase your talent, and grow your skills online." />
<meta name="keywords" content="hai wall, art community online,  share artwork online,  drawing and painting wall, online art platform, art social network, learn drawing online,  painting ideas and tutorials, art posts and creativity, artists community India, art sharing website,  fine art learning platform,  student art community,  creative art network, himanshu art institute">

<meta property="og:image" content="https://www.himanshuartinstitute.com/wall/bcknds/hai-wall.jpg" />
<meta property="og:title" content="HAI Wall – Share Your Creativity">
<meta property="og:description" content="A Creative Platform for Art Lovers">
<meta property="og:url" content="https://www.himanshuartinstitute.com/wall/gallery.php">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<script src="../codes/glry/js/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link rel="shortcut icon" href="https://www.himanshuartinstitute.com/wall/bcknds/hai-wall.png" type="image/x-icon" >
<link href="bcknds/css/wall-home.css?v=20260722-5" media="screen" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>

<!-- HEADER -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/header.php"); ?>


<!-- MAIN -->
<div class="container">

<!-- LEFT SIDEBAR -->
<div class="sidebar leftcolmn">
<!-- TOP LIKED POST -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/top-liked-post.php"); ?>
<!-- NEW USER SLIDER -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/new-users.php"); ?>
</div>



<!-- CENTER WALL -->
<div>
<div class="haifeed-colum">
<div class="wall-container">

<nav
    class="gallery-filter-nav"
    aria-label="Filter gallery posts"
>

    <a
        href="/wall/gallery.php"
        class="gallery-filter-link<?=$gallery_filter === 'all' ? ' is-active' : ''?>"
        <?=$gallery_filter === 'all' ? 'aria-current="page"' : ''?>
    >
        <i
            class="fa fa-th"
            aria-hidden="true"
        ></i>

        All
    </a>

    <a
        href="/wall/gallery.php?type=images"
        class="gallery-filter-link<?=$gallery_filter === 'images' ? ' is-active' : ''?>"
        <?=$gallery_filter === 'images' ? 'aria-current="page"' : ''?>
    >
        <i
            class="fa fa-image"
            aria-hidden="true"
        ></i>

        Images
    </a>

    <a
        href="/wall/gallery.php?type=videos"
        class="gallery-filter-link<?=$gallery_filter === 'videos' ? ' is-active' : ''?>"
        <?=$gallery_filter === 'videos' ? 'aria-current="page"' : ''?>
    >
        <i
            class="fa fa-youtube-play"
            aria-hidden="true"
        ></i>

        Videos
    </a>

    <a
        href="/wall/gallery.php?type=polls"
        class="gallery-filter-link<?=$gallery_filter === 'polls' ? ' is-active' : ''?>"
        <?=$gallery_filter === 'polls' ? 'aria-current="page"' : ''?>
    >
        <i
            class="fa fa-bar-chart"
            aria-hidden="true"
        ></i>

        Polls
    </a>

</nav>

<div
    class="gallery-grid"
    data-gallery-filter="<?=htmlspecialchars(
        $gallery_filter,
        ENT_QUOTES,
        'UTF-8'
    )?>"
>


<?php
$query = "
SELECT *
FROM HAIWALL
WHERE status = '1'
$gallery_type_condition
ORDER BY date DESC, id DESC
LIMIT 15
";


// Disable after 30 days
mysqli_query($conn, "
UPDATE HAIWALL 
SET status=0, disabled_at=NOW()
WHERE status=1
AND (
    
    (
        last_activated_at IS NOT NULL
        AND last_activated_at <= NOW() - INTERVAL 30 DAY
    )

    OR

    (
        last_activated_at IS NULL
        AND date <= NOW() - INTERVAL 30 DAY
    )

)
");


// Delete after 30 days of disable
mysqli_query($conn, "
DELETE FROM HAIWALL 
WHERE status=0 
AND disabled_at <= NOW() - INTERVAL 30 DAY
");

$select=mysqli_query($conn,$query);

?>

<?php $lastLabel = ""; ?>

<?php
while($row=mysqli_fetch_assoc($select)){
	
?>


<?php

$post_type = (string)(
    $row['post_type'] ?? 'artwork'
);

if(
    !in_array(
        $post_type,
        [
            'artwork',
            'youtube',
            'poll'
        ],
        true
    )
){
    $post_type = 'artwork';
}

$is_youtube_post =
    $post_type === 'youtube'
    &&
    !empty($row['youtube_video_id']);

$is_poll_post =
    $post_type === 'poll';

$post_title = !empty($row['blog_name'])
    ? (string)$row['blog_name']
    : 'Untitled Post';

if($is_youtube_post){

    $gallery_image_url =
        'https://i.ytimg.com/vi/'
        . rawurlencode(
            (string)$row['youtube_video_id']
        )
        . '/hqdefault.jpg';

}elseif($is_poll_post){

    $gallery_image_url =
        '/wall/wall-feeds/default-poll.jpg';

}else{

    $gallery_image = !empty($row['image'])
        ? basename((string)$row['image'])
        : 'default.jpg';

    $gallery_image_url =
        '/wall/wall-feeds/'
        . rawurlencode($gallery_image);
}

?>

<div class="gallery-item<?=$is_youtube_post ? ' gallery-video-item' : ($is_poll_post ? ' gallery-poll-item' : '')?>">

<a
    href="/wall/feed/<?=rawurlencode(
        (string)($row['page_url'] ?? '')
    )?>"
    class="<?=$is_youtube_post ? 'gallery-video-link' : ''?>"
    aria-label="<?=$is_youtube_post ? 'Watch ' : 'View '?><?=htmlspecialchars(
        $post_title,
        ENT_QUOTES,
        'UTF-8'
    )?>"
>

<img
    src="<?=htmlspecialchars(
        $gallery_image_url,
        ENT_QUOTES,
        'UTF-8'
    )?>"
    loading="lazy"
    decoding="async"
    alt="<?=htmlspecialchars(
        $post_title,
        ENT_QUOTES,
        'UTF-8'
    )?>"
    title="<?=htmlspecialchars(
        $post_title,
        ENT_QUOTES,
        'UTF-8'
    )?>"
>

<?php if($is_youtube_post){ ?>

<span class="gallery-video-label">

    <i
        class="fa fa-youtube-play"
        aria-hidden="true"
    ></i>

    Video
</span>

<span class="gallery-video-play">

    <i
        class="fa fa-play"
        aria-hidden="true"
    ></i>

</span>

<?php }elseif($is_poll_post){ ?>

<span class="gallery-poll-label">

    <i
        class="fa fa-bar-chart"
        aria-hidden="true"
    ></i>

    Poll
</span>

<?php } ?>

</a>

</div>
 
<?php }?>
</div>




</div>
</div>
<div id="gallery-load-more" class="loadmorepost">Loading...</div>
</div>




<!-- RIGHT SIDEBAR -->
<div class="sidebar">
<div class="grynone">
<!-- LATEST POSTS -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/latest-post-slider.php"); ?>
<!-- HAI BLOG SLIDER -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/hai-blog-slider.php"); ?>
<!-- FOLLOW US -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/follow-us.php"); ?>
</div>

</div>
</div>

<!-- FOOTER -->
<?php include($_SERVER['DOCUMENT_ROOT']."/wall/bcknds/footer.php"); ?>



<script src="bcknds/load-gallery.js?v=20260730-1"></script>
<script src="bcknds/hai-blog-slidr.js"></script>
<script src="bcknds/search.js"></script>
<script src="bcknds/user-menu.js"></script>
</body>
</html>