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/index.php
 <?php 
if(session_status() === PHP_SESSION_NONE){
    session_start();
} 
 
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");

include($_SERVER['DOCUMENT_ROOT']."/wall/baba/shiva.php");
require_once $_SERVER["DOCUMENT_ROOT"]
    . "/wall/bcknds/like-identity.php";

$like_identity = haiGetLikeIdentity($conn);

function getPostGroupLabel($date)
{
    if (empty($date)) {
        return "Old";
    }

    $postTime = strtotime($date);

    if ($postTime === false) {
        return "Old";
    }

    $todayStart = strtotime(date("Y-m-d"));
    $postDayStart = strtotime(date("Y-m-d", $postTime));

    $diffDays = (int) floor(
        ($todayStart - $postDayStart) / 86400
    );

    if ($diffDays === 0) {
        return "Today";
    }

    if ($diffDays === 1) {
        return "Yesterday";
    }

    if ($diffDays > 1 && $diffDays <= 7) {
        return date("l", $postTime);
    }

    return date("j F Y", $postTime);
}

?>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HAI Wall &ndash; Share Your Creativity with Everyone | 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="robots" content="index, follow, max-image-preview:large">
<link rel="canonical" href="https://www.himanshuartinstitute.com/wall/">
<!-- Open Graph: Facebook, WhatsApp and LinkedIn -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="HAI Wall">
<meta property="og:title" content="HAI Wall &ndash; Share Your Creativity with Everyone">
<meta property="og:description" content="Share your creativity, discover inspiring artwork, and connect with artists on HAI Wall.">
<meta property="og:url" content="https://www.himanshuartinstitute.com/wall/">
<meta property="og:image" content="https://www.himanshuartinstitute.com/wall/bcknds/hai-wall.jpg">
<meta property="og:image:alt" content="HAI Wall creative community by Himanshu Art Institute">
<meta property="og:locale" content="en_IN">
<!-- X / Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="HAI Wall &ndash; Share Your Creativity with Everyone">
<meta name="twitter:description" content="Share your creativity, discover inspiring artwork, and connect with artists on HAI Wall.">
<meta name="twitter:image" content="https://www.himanshuartinstitute.com/wall/bcknds/hai-wall.jpg">
<meta name="twitter:image:alt"  content="HAI Wall creative community by Himanshu Art Institute">
<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="/wall/bcknds/css/wall-home.css?v=20260804-1" media="screen" rel="stylesheet" type="text/css" />
<link href="/wall/bcknds/css/user-network-nav.css?v=20260730-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">

<?php

$network_page = 'hai-wall';

include(
    $_SERVER['DOCUMENT_ROOT']
    . '/wall/bcknds/user-network-nav.php'
);

?>


<?php

$query = "
SELECT * FROM HAIWALL
WHERE status='1'
ORDER BY date DESC, id DESC
LIMIT 5
";


// 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)){
	$post_id = (int) ($row["id"] ?? 0);
	$is_liked = haiHasLikedPost(
    $conn,
    $post_id,
    $like_identity
);
	
  if(!empty($row['post_user'])){
        $user_check = mysqli_fetch_assoc(mysqli_query($conn,"
        SELECT delete_request FROM wall_users 
        WHERE username='".$row['post_user']."' 
        LIMIT 1
        "));

        if($user_check && $user_check['delete_request'] == 1){
            continue; // skip this post
        }
    }	

$currentLabel = getPostGroupLabel($row['date']);

if($currentLabel != $lastLabel){
    echo '<div class="date-separator">'.$currentLabel.'</div>';
    $lastLabel = $currentLabel;
}

?>

<div class="feed-blok">
<div class="post-header">
<div class="post-user">

<?php
$post_username = trim($row["post_user"] ?? "");

$username = "Admin";
$userimg = "himanshu-art-institute.png";
$usercategory = "";

if ($post_username !== "") {

    $safe_post_username = mysqli_real_escape_string(
        $conn,
        $post_username
    );

    $user = mysqli_query($conn, "
        SELECT name, image, user_category
        FROM wall_users
        WHERE username = '$safe_post_username'
        LIMIT 1
    ");

    if ($user && mysqli_num_rows($user) === 1) {

        $userrow = mysqli_fetch_assoc($user);

        $username = !empty($userrow["name"])
            ? $userrow["name"]
            : $post_username;

        $userimg = !empty($userrow["image"])
            ? basename($userrow["image"])
            : "default-user.png";

        $usercategory = !empty($userrow["user_category"])
            ? $userrow["user_category"]
            : "";

    } else {

        $username = $post_username;
        $userimg = "default-user.png";
    }
}


/* Display post author name in consistent Title Case */
$username = trim((string)$username);

$username = preg_replace(
    '/\s+/u',
    ' ',
    $username
);

if (function_exists('mb_convert_case')) {

    $username = mb_convert_case(
        $username,
        MB_CASE_TITLE,
        'UTF-8'
    );

} else {

    $username = ucwords(
        strtolower($username)
    );
}


$profile_url = "/wall/user/profile.php?user="
    . rawurlencode($post_username);
	
$user_image_url = "/wall/user/user-images/"
    . rawurlencode($userimg);
?>
<?php if ($post_username !== "") { ?>

<a
    href="<?=htmlspecialchars($profile_url, ENT_QUOTES, "UTF-8")?>"
    aria-label="View <?=htmlspecialchars($username, ENT_QUOTES, "UTF-8")?> profile"
>
    <img
        src="<?=htmlspecialchars($user_image_url, ENT_QUOTES, "UTF-8")?>"
        class="user-pic"
        alt=""
        width="45"
        height="45"
        loading="lazy"
        decoding="async"
    >
</a>

<?php } else { ?>

<img
    src="<?=htmlspecialchars($user_image_url, ENT_QUOTES, "UTF-8")?>"
    class="user-pic"
    alt=""
    width="45"
    height="45"
    loading="lazy"
    decoding="async"
>

<?php } ?>

<div class="user-text">

<?php if ($post_username !== "") { ?>

<a href="<?=htmlspecialchars($profile_url, ENT_QUOTES, "UTF-8")?>">
    <span class="user-name">
        <?=htmlspecialchars($username, ENT_QUOTES, "UTF-8")?>
    </span>
</a>

<?php } else { ?>

<span class="user-name">
    <?=htmlspecialchars($username, ENT_QUOTES, "UTF-8")?>
</span>

<?php } ?>

<?php if ($usercategory !== "") { ?>

<div class="user-category">
    <?=htmlspecialchars($usercategory, ENT_QUOTES, "UTF-8")?>
</div>

<?php } ?>

</div>
</div>

<div class="post-menu">
<span class="menu-btn"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></span>
<div class="menu-dropdown">
<a
    class="copy-link"
    data-url="<?=htmlspecialchars(
        'https://www.himanshuartinstitute.com/wall/feed/'
        . rawurlencode($row['page_url'] ?? ''),
        ENT_QUOTES,
        'UTF-8'
    )?>"
>
    Copy Link
</a>

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

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

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

$youtube_video_id = $is_youtube_post
    ? trim((string)$row['youtube_video_id'])
    : '';

$feed_image = '';
$feed_image_url = '';

if($is_youtube_post){

    $feed_image =
        'youtube-'
        . $youtube_video_id
        . '.jpg';

    $feed_image_url =
        'https://i.ytimg.com/vi/'
        . rawurlencode($youtube_video_id)
        . '/hqdefault.jpg';

}elseif(!$is_poll_post){

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

    $feed_image_url =
        '/wall/wall-feeds/'
        . rawurlencode($feed_image);
}


/* Load poll information */

$poll_id = 0;
$poll_ends_at = null;
$poll_total_votes = 0;
$poll_options = [];
$poll_has_ended = false;
$current_user_poll_option_id = 0;
$current_user_poll_change_count = 0;
$current_user_poll_vote_removed = false;

if($is_poll_post){

    $poll_query = mysqli_query(
        $conn,
        "
        SELECT
            wall_polls.id AS poll_id,
            wall_polls.ends_at,
            wall_poll_options.id AS option_id,
            wall_poll_options.option_text,
            wall_poll_options.option_image,
            wall_poll_options.display_order,
            COUNT(wall_poll_votes.id) AS vote_count

        FROM wall_polls

        INNER JOIN wall_poll_options
            ON wall_poll_options.poll_id = wall_polls.id

        LEFT JOIN wall_poll_votes
            ON wall_poll_votes.option_id =
               wall_poll_options.id
           AND wall_poll_votes.is_removed = 0

        WHERE wall_polls.post_id = $post_id

        GROUP BY
            wall_polls.id,
            wall_polls.ends_at,
            wall_poll_options.id,
            wall_poll_options.option_text,
            wall_poll_options.option_image,
            wall_poll_options.display_order

        ORDER BY
            wall_poll_options.display_order ASC,
            wall_poll_options.id ASC
        "
    );

    if($poll_query){

        while(
            $poll_option =
                mysqli_fetch_assoc($poll_query)
        ){

            $poll_id = (int)(
                $poll_option['poll_id'] ?? 0
            );

            $poll_ends_at =
                $poll_option['ends_at'] ?? null;

            $vote_count = (int)(
                $poll_option['vote_count'] ?? 0
            );

            $poll_total_votes += $vote_count;

            $poll_options[] = [
                'id' => (int)(
                    $poll_option['option_id'] ?? 0
                ),
                'text' => trim(
                    (string)(
                        $poll_option['option_text'] ?? ''
                    )
                ),
                'image' => !empty(
                    $poll_option['option_image']
                )
                    ? basename(
                        (string)$poll_option[
                            'option_image'
                        ]
                    )
                    : '',
                'votes' => $vote_count
            ];
        }
    }

    if(
        !empty($poll_ends_at)
        &&
        strtotime($poll_ends_at) <= time()
    ){
        $poll_has_ended = true;
    }

    $poll_session_username = trim(
        (string)($_SESSION['wall_user'] ?? '')
    );

    if(
        $poll_id > 0
        &&
        $poll_session_username !== ''
    ){
        $selected_option_statement = mysqli_prepare(
            $conn,
            "
            SELECT
                wall_poll_votes.option_id,
                wall_poll_votes.vote_change_count,
                wall_poll_votes.is_removed

            FROM wall_poll_votes

            INNER JOIN wall_users
                ON wall_users.id =
                   wall_poll_votes.user_id

            WHERE wall_poll_votes.poll_id = ?
              AND wall_users.username = ?

            LIMIT 1
            "
        );

        if($selected_option_statement){

            mysqli_stmt_bind_param(
                $selected_option_statement,
                "is",
                $poll_id,
                $poll_session_username
            );

            if(
                mysqli_stmt_execute(
                    $selected_option_statement
                )
            ){
                $selected_option_result =
                    mysqli_stmt_get_result(
                        $selected_option_statement
                    );

                $selected_option_data =
                    mysqli_fetch_assoc(
                        $selected_option_result
                    );

                if($selected_option_data){

                    $current_user_poll_vote_removed =
                        (int)(
                            $selected_option_data[
                                'is_removed'
                            ] ?? 0
                        ) === 1;

                    $current_user_poll_change_count =
                        (int)(
                            $selected_option_data[
                                'vote_change_count'
                            ] ?? 0
                        );

                    if(
                        !$current_user_poll_vote_removed
                    ){
                        $current_user_poll_option_id =
                            (int)(
                                $selected_option_data[
                                    'option_id'
                                ] ?? 0
                            );
                    }
                }
            }

            mysqli_stmt_close(
                $selected_option_statement
            );
        }
    }
}


$download_title = trim((string)($row["blog_name"] ?? ""));

$download_title = preg_replace(
    '/[^\p{L}\p{N}\-_ ]+/u',
    '',
    $download_title
);

$download_title = preg_replace(
    '/[\s_-]+/u',
    '-',
    $download_title
);

$download_title = trim($download_title, '-');

if ($download_title === '') {
    $download_title = 'hai-wall-post';
}

if (function_exists('mb_substr')) {
    $download_title = mb_substr(
        $download_title,
        0,
        100,
        'UTF-8'
    );
} else {
    $download_title = substr($download_title, 0, 100);
}

$image_extension = strtolower(
    pathinfo($feed_image, PATHINFO_EXTENSION)
);

$allowed_extensions = [
    'jpg',
    'jpeg',
    'png',
    'webp',
    'gif'
];

if (!in_array($image_extension, $allowed_extensions, true)) {
    $image_extension = 'jpg';
}

$download_filename =
    $download_title
    . '-'
    . $post_id
    . '.'
    . $image_extension;
?>
<?php if(!$is_youtube_post && !$is_poll_post){ ?>

<a
    href="<?=htmlspecialchars(
        $feed_image_url,
        ENT_QUOTES,
        "UTF-8"
    )?>"
    download="<?=htmlspecialchars(
        $download_filename,
        ENT_QUOTES,
        "UTF-8"
    )?>"
    class="download-img"
>
    Download Image
</a>

<?php } ?>
<?php if(isset($_SESSION['wall_user'])){ ?>
<a href="#" class="report-post-btn" data-id="<?=(int)$row['id']?>">
  <i class="fa fa-flag"></i> Report Post
</a>
<?php } else { ?>
<a href="#" class="report-login-alert">
  <i class="fa fa-flag"></i> Report Post
</a>
<?php } ?>
</div>
</div>
</div>

<?php if($is_poll_post){ ?>

<div class="wall-poll-card">

    <div class="wall-poll-label">
        <i class="fa fa-bar-chart" aria-hidden="true"></i>
        Poll
    </div>

    <h3 class="wall-poll-question">
        <?=htmlspecialchars(
            (string)($row['blog_name'] ?? 'Poll'),
            ENT_QUOTES,
            'UTF-8'
        )?>
    </h3>

    <?php if(!empty(trim((string)($row['short_des'] ?? '')))){ ?>

    <div class="wall-poll-description">
        <?=nl2br(
            htmlspecialchars(
                trim((string)$row['short_des']),
                ENT_QUOTES,
                'UTF-8'
            )
        )?>
    </div>

    <?php } ?>

    <div
        class="wall-poll-options"
        data-poll-id="<?=$poll_id?>"
    >

        <?php foreach(
            $poll_options as
            $poll_option_index => $poll_option
        ){ ?>

        <?php

        $option_id = (int)(
            $poll_option['id'] ?? 0
        );

        $option_votes = (int)(
            $poll_option['votes'] ?? 0
        );

        $option_image_name = trim(
            (string)(
                $poll_option['image'] ?? ''
            )
        );

        $option_image_url =
            $option_image_name !== ''
                ? (
                    '/wall/wall-feeds/polls/'
                    . rawurlencode(
                        basename($option_image_name)
                    )
                )
                : '';

        $option_percentage =
            $poll_total_votes > 0
                ? (int)round(
                    ($option_votes / $poll_total_votes) * 100
                )
                : 0;

        $is_selected_option =
            $current_user_poll_option_id === $option_id;

        $option_letter = chr(
            65 + (int)$poll_option_index
        );

        ?>

        <button
            type="button"
            class="wall-poll-option<?=$is_selected_option ? ' is-selected' : ''?>"
            data-poll-id="<?=$poll_id?>"
            data-option-id="<?=$option_id?>"
            aria-pressed="<?=$is_selected_option ? 'true' : 'false'?>"
            <?=(
                $poll_has_ended
                ||
                $current_user_poll_vote_removed
            )
                ? 'disabled'
                : ''
            ?>
        >

            <span
                class="wall-poll-progress"
                style="width:<?=$option_percentage?>%;"
                aria-hidden="true"
            ></span>

            <span class="wall-poll-option-content">

                <span class="wall-poll-option-main">

                    <?php if($option_image_url !== ''){ ?>

                    <span class="wall-poll-option-image">

                        <img
                            src="<?=htmlspecialchars(
                                $option_image_url,
                                ENT_QUOTES,
                                'UTF-8'
                            )?>"
                            alt="<?=htmlspecialchars(
                                'Image for '
                                . (
                                    $poll_option['text']
                                    ?? 'poll option'
                                ),
                                ENT_QUOTES,
                                'UTF-8'
                            )?>"
                            loading="lazy"
                            decoding="async"
                            onerror="this.parentElement.style.display='none';"
                        >

                    </span>

                    <?php } ?>

                    <span
                        class="wall-poll-option-letter"
                        aria-hidden="true"
                    >
                        <?=$option_letter?>
                    </span>

                    <span class="wall-poll-option-text">
                        <?=htmlspecialchars(
                            (string)($poll_option['text'] ?? ''),
                            ENT_QUOTES,
                            'UTF-8'
                        )?>
                    </span>

                </span>

                <strong class="wall-poll-percentage">
                    <?=$option_votes?>
                    <?=$option_votes === 1 ? 'vote' : 'votes'?>
                </strong>

            </span>

        </button>

        <?php } ?>

    </div>

    <?php if(
        $current_user_poll_vote_removed
    ){ ?>

    <div class="wall-poll-vote-status is-removed">

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

        <span>
            Your vote was removed. You can no longer
            vote in this poll.
        </span>

    </div>

    <?php } ?>

    <?php if(
        $current_user_poll_option_id > 0
        &&
        $current_user_poll_change_count < 1
        &&
        !$poll_has_ended
    ){ ?>

    <div class="wall-poll-vote-management">

        <button
            type="button"
            class="wall-poll-remove-vote"
            data-poll-id="<?=$poll_id?>"
            data-option-id="<?=$current_user_poll_option_id?>"
        >
            <i
                class="fa fa-times-circle-o"
                aria-hidden="true"
            ></i>

            Remove My Vote
        </button>

    </div>

    <?php } ?>

    <div class="wall-poll-footer">

        <span>
            <?=$poll_total_votes?>
            <?=$poll_total_votes === 1 ? 'vote' : 'votes'?>
        </span>

        <?php if($poll_has_ended){ ?>

        <span>Poll ended</span>

        <?php }elseif(!empty($poll_ends_at)){ ?>

        <span>
            Ends <?=htmlspecialchars(
                date(
                    'd M Y, h:i A',
                    strtotime($poll_ends_at)
                ),
                ENT_QUOTES,
                'UTF-8'
            )?>
        </span>

        <?php } ?>

    </div>

</div>

<?php }else{ ?>

<div class="wallpost<?=$is_youtube_post ? ' youtube-wallpost' : ''?>">

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

    <img
        src="<?=htmlspecialchars(
            $feed_image_url,
            ENT_QUOTES,
            'UTF-8'
        )?>"
        alt="<?=htmlspecialchars(
            (string)$row['blog_name'],
            ENT_QUOTES,
            'UTF-8'
        )?>"
        loading="lazy"
        decoding="async"
    >

<?php if($is_youtube_post){ ?>

    <span class="youtube-post-label">
        <i
            class="fa fa-youtube-play"
            aria-hidden="true"
        ></i>
        Video
    </span>

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

<?php } ?>

</a>

</div>

<?php } ?>

<?php
$comment_count = 0;

$comment_count_query = mysqli_query($conn, "
    SELECT COUNT(*) AS total
    FROM wall_comments
    WHERE post_id = $post_id
      AND is_deleted = 0
");

if ($comment_count_query) {

    $comment_count_data = mysqli_fetch_assoc(
        $comment_count_query
    );

    $comment_count = (int) (
        $comment_count_data["total"] ?? 0
    );
}

$action_post_url = "/wall/feed/"
    . rawurlencode($row["page_url"] ?? "");

$share_post_url =
    "https://www.himanshuartinstitute.com/wall/feed/"
    . rawurlencode($row["page_url"] ?? "");
?>


<div class="like-box">


<div class="likdvd post-actions-left">


<span
    class="view-count post-action-item"
    title="Views"
>
    <i
        class="fa fa-eye"
        aria-hidden="true"
    ></i>

    <span id="view-<?=$post_id?>">
        <?=(int) ($row["views"] ?? 0)?>
    </span>
</span>


<span class="post-action-pair">

<button
    type="button"
    class="like-btn<?=$is_liked ? " is-liked" : ""?>"
    data-id="<?=$post_id?>"
    aria-label="<?=$is_liked ? "Unlike this post" : "Like this post"?>"
    aria-pressed="<?=$is_liked ? "true" : "false"?>"
    title="<?=$is_liked ? "Unlike" : "Like"?>"
>
    <i
        class="fa <?=$is_liked ? "fa-heart" : "fa-heart-o"?>"
        aria-hidden="true"
    ></i>
</button>

<span class="like-count">
    <?=(int) ($row["likes"] ?? 0)?>
</span>

</span>


<a
    class="comment-action post-action-pair"
    href="<?=htmlspecialchars($action_post_url, ENT_QUOTES, "UTF-8")?>"
    title="View comments"
>
    <i
        class="fa fa-comment-o"
        aria-hidden="true"
    ></i>

    <span class="comment-count">
        <?=$comment_count?>
    </span>
</a>


</div>


<div class="likdvd post-actions-right">


<span class="post-action-pair">

<button
    type="button"
    class="share-btn"
    data-id="<?=$post_id?>"
	data-url="<?=htmlspecialchars($share_post_url, ENT_QUOTES, "UTF-8")?>"
	data-type="<?=$is_poll_post ? 'poll' : ($is_youtube_post ? 'youtube' : 'artwork')?>"
    aria-label="Share this post"
    title="Share"
>
    <i
        class="fa fa-share"
        aria-hidden="true"
    ></i>
</button>

<span
    class="share-count"
    id="share-count-<?=$post_id?>"
>
    <?=(int) ($row["shares"] ?? 0)?>
</span>

</span>


</div>


</div> 
<?php
$post_title = trim($row["blog_name"] ?? "");
$post_description = trim($row["short_des"] ?? "");

$post_excerpt = mb_substr(
    $post_description,
    0,
    100,
    "UTF-8"
);

$has_more_text = mb_strlen(
    $post_description,
    "UTF-8"
) > 100;

$post_detail_url = "/wall/feed/"
    . rawurlencode($row["page_url"] ?? "");
?>

<?php if (!$is_poll_post) { ?>

<div class="feeddscrpn">

<h2>
    <?=htmlspecialchars($post_title, ENT_QUOTES, "UTF-8")?>
</h2>

<?php if ($post_excerpt !== "") { ?>

<p>
    <?=htmlspecialchars($post_excerpt, ENT_QUOTES, "UTF-8")?>

    <?php if ($has_more_text) { ?>
        &hellip;
    <?php } ?>

    <a href="<?=htmlspecialchars($post_detail_url, ENT_QUOTES, "UTF-8")?>">
        more
    </a>
</p>

<?php } ?>

</div>

<?php } ?> 
</div>
 
<?php }?>
</div>
</div>
<input type="hidden" id="last-label-init" value="<?=$lastLabel?>">
<div id="load-more" class="loadmorepost">Loading More Posts...</div>
</div>



<!-- RIGHT SIDEBAR -->
<div class="sidebar">
<!-- 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>

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


<div
    class="report-modal"
    id="reportModal"
    role="dialog"
    aria-modal="true"
    aria-labelledby="reportModalTitle"
    style="display:none;"
>
    <div class="report-box">

        <h3 id="reportModalTitle">
            Report Post
        </h3>

        <label for="reportReason">
            Select reason
        </label>

        <select id="reportReason">

            <option value="">
                Select reason
            </option>

            <option value="spam">
                Spam / Promotion
            </option>

            <option value="inappropriate">
                Inappropriate Content
            </option>

            <option value="copyright">
                Copyright Issue
            </option>

            <option value="abusive">
                Abusive / Offensive
            </option>

            <option value="irrelevant">
                Not Art Related
            </option>

            <option value="other">
                Other
            </option>

        </select>

        <textarea
            id="reportMessage"
            maxlength="1000"
            rows="4"
            placeholder="Please enter report details..."
            style="display:none;"
        ></textarea>

        <div class="report-modal-actions">

            <button
                id="closeReport"
                type="button"
            >
                Cancel
            </button>

            <button
                id="submitReport"
                type="button"
            >
                Submit
            </button>

        </div>

    </div>
</div>
<div class="share-panel" id="sharePanel">
<div class="share-box">
<h3>Share</h3>
<a id="share-facebook" target="_blank"><i class="fa fa-facebook"></i> Facebook</a>
<a id="share-whatsapp" target="_blank"><i class="fa fa-whatsapp"></i> WhatsApp</a>
<a id="share-twitter" target="_blank"><i class="fa fa-twitter"></i> Twitter</a>
<a id="copy-link" class="copy-link"><i class="fa fa-link"></i> Copy Link</a>
<button class="close-share">Close</button>
</div>
</div>

<script src="/wall/bcknds/report-button.js?v=20260718-1"></script>
<script src="bcknds/views-update.js?v=20260824-1"></script>
<script src="bcknds/likebtns.js"></script>
<script src="/wall/bcknds/shared.js?v=20260731-2"></script>
<script src="bcknds/load-posts.js"></script>
<script src="bcknds/hai-blog-slidr.js"></script>
<script src="bcknds/search.js"></script>
<script src="bcknds/post-mnu-btn.js?v=20260722-1"></script>
<script src="bcknds/user-menu.js"></script>
<script src="/wall/bcknds/poll-vote.js?v=20260801-1"></script>
</body>
</html>