File: /home/u590867752/domains/himanshuartinstitute.com/public_html/wall/user/followers.php
<?php
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"
);
include(
$_SERVER["DOCUMENT_ROOT"]
. "/wall/bcknds/user-auth.php"
);
$login_user = trim(
(string)($_SESSION["wall_user"] ?? "")
);
if($login_user === ""){
header("Location: /wall/user/login.php");
exit;
}
/* Find the logged-in active user */
$user_statement = mysqli_prepare(
$conn,
"
SELECT id
FROM wall_users
WHERE username = ?
AND is_active = 1
LIMIT 1
"
);
if(!$user_statement){
http_response_code(500);
exit;
}
mysqli_stmt_bind_param(
$user_statement,
"s",
$login_user
);
if(!mysqli_stmt_execute($user_statement)){
mysqli_stmt_close($user_statement);
http_response_code(500);
exit;
}
$user_result = mysqli_stmt_get_result(
$user_statement
);
$logged_user = mysqli_fetch_assoc(
$user_result
);
mysqli_stmt_close($user_statement);
if(!$logged_user){
header("Location: /wall/user/login.php");
exit;
}
$logged_user_id = (int)$logged_user["id"];
/* Create the follow action token once per session */
if(empty($_SESSION["follow_action_token"])){
$_SESSION["follow_action_token"] =
bin2hex(random_bytes(32));
}
$follow_action_token =
(string)$_SESSION["follow_action_token"];
/* Load active artists who follow the logged-in user */
$followers_statement = mysqli_prepare(
$conn,
"
SELECT
follower.id,
follower.username,
follower.name,
follower.image,
follower.user_category,
follow_record.followed_at,
EXISTS(
SELECT 1
FROM wall_follows AS reciprocal_follow
WHERE reciprocal_follow.follower_id =
follow_record.following_id
AND reciprocal_follow.following_id =
follower.id
LIMIT 1
) AS is_following_back
FROM wall_follows AS follow_record
INNER JOIN wall_users AS follower
ON follower.id = follow_record.follower_id
AND follower.is_active = 1
WHERE follow_record.following_id = ?
ORDER BY follow_record.followed_at DESC,
follower.id DESC
"
);
if(!$followers_statement){
error_log(
"Followers query preparation failed: "
. mysqli_error($conn)
);
http_response_code(500);
exit;
}
mysqli_stmt_bind_param(
$followers_statement,
"i",
$logged_user_id
);
if(!mysqli_stmt_execute($followers_statement)){
mysqli_stmt_close($followers_statement);
http_response_code(500);
exit;
}
$followers_result = mysqli_stmt_get_result(
$followers_statement
);
$followers_count = mysqli_num_rows(
$followers_result
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex, follow">
<title>My Followers | HAI Wall</title>
<meta name="description"
content="View the artists who follow you on HAI Wall.">
<link rel="shortcut icon"
href="/wall/bcknds/hai-wall.png"
type="image/x-icon">
<link href="/wall/bcknds/css/wall-home.css?v=20260730-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 href="/wall/bcknds/css/user-connections.css?v=20260730-3"
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"
);
?>
<div class="container">
<!-- LEFT SIDEBAR -->
<div class="sidebar leftcolmn">
<?php
include(
$_SERVER["DOCUMENT_ROOT"]
. "/wall/bcknds/top-liked-post.php"
);
include(
$_SERVER["DOCUMENT_ROOT"]
. "/wall/bcknds/new-users.php"
);
?>
</div>
<!-- CENTER CONTENT -->
<div>
<div class="haifeed-colum">
<div class="wall-container">
<?php
$network_page = "followers";
include(
$_SERVER["DOCUMENT_ROOT"]
. "/wall/bcknds/user-network-nav.php"
);
?>
<section class="connections-section">
<div class="connections-header">
<div>
<h1>
<i class="fa fa-user-plus"></i>
Followers
</h1>
<p>
Artists who follow your creative journey
</p>
</div>
<span class="connections-count">
<?=htmlspecialchars(
$followers_count
. " "
. (
$followers_count === 1
? "Follower"
: "Followers"
),
ENT_QUOTES,
"UTF-8"
)?>
</span>
</div>
<?php if($followers_count > 0){ ?>
<div class="connections-grid">
<?php while(
$follower = mysqli_fetch_assoc(
$followers_result
)
){ ?>
<?php
$follower_username = trim(
(string)$follower["username"]
);
$follower_name = !empty($follower["name"])
? trim((string)$follower["name"])
: $follower_username;
if(function_exists("mb_convert_case")){
$follower_name = mb_convert_case(
mb_strtolower(
$follower_name,
"UTF-8"
),
MB_CASE_TITLE,
"UTF-8"
);
}else{
$follower_name = ucwords(
strtolower($follower_name)
);
}
$follower_image = !empty($follower["image"])
? basename((string)$follower["image"])
: "default-user.png";
$follower_category = trim(
(string)($follower["user_category"] ?? "")
);
$follower_profile =
"/wall/user/profile.php?user="
. rawurlencode($follower_username);
$is_following_back =
(int)($follower["is_following_back"] ?? 0)
=== 1;
?>
<div class="connection-card connection-card-with-action">
<a
href="<?=htmlspecialchars(
$follower_profile,
ENT_QUOTES,
"UTF-8"
)?>"
class="connection-profile-link"
aria-label="View <?=htmlspecialchars(
$follower_name,
ENT_QUOTES,
"UTF-8"
)?> profile"
>
<img
src="/wall/user/user-images/<?=rawurlencode(
$follower_image
)?>"
class="connection-image"
loading="lazy"
decoding="async"
alt="<?=htmlspecialchars(
$follower_name,
ENT_QUOTES,
"UTF-8"
)?>"
>
<span class="connection-info">
<strong>
<?=htmlspecialchars(
$follower_name,
ENT_QUOTES,
"UTF-8"
)?>
</strong>
<?php if($follower_category !== ""){ ?>
<small>
<?=htmlspecialchars(
$follower_category,
ENT_QUOTES,
"UTF-8"
)?>
</small>
<?php }else{ ?>
<small>HAI Wall Artist</small>
<?php } ?>
</span>
</a>
<button
type="button"
class="connection-follow-btn<?=
$is_following_back
? " is-following"
: ""
?>"
data-target-user-id="<?=(int)$follower["id"]?>"
data-following="<?=
$is_following_back ? "1" : "0"
?>"
data-action-token="<?=htmlspecialchars(
$follow_action_token,
ENT_QUOTES,
"UTF-8"
)?>"
aria-pressed="<?=
$is_following_back
? "true"
: "false"
?>"
>
<i
class="fa <?=
$is_following_back
? "fa-check"
: "fa-user-plus"
?>"
aria-hidden="true"
></i>
<span class="connection-follow-label">
<?=
$is_following_back
? "Following"
: "Follow Back"
?>
</span>
</button>
</div>
<?php } ?>
</div>
<?php }else{ ?>
<div class="connections-empty">
<i class="fa fa-users"></i>
<h2>No followers yet</h2>
<p>
Keep sharing your artwork and engaging with the community. Your audience will grow over time.
</p>
<a href="/wall/user/create-post.php?add">
<i class="fa fa-plus" aria-hidden="true"></i> Share New Artwork
</a>
</div>
<?php } ?>
</section>
</div>
</div>
</div>
<!-- RIGHT SIDEBAR -->
<div class="sidebar">
<div class="grynone">
<?php
include(
$_SERVER["DOCUMENT_ROOT"]
. "/wall/bcknds/latest-post-slider.php"
);
include(
$_SERVER["DOCUMENT_ROOT"]
. "/wall/bcknds/hai-blog-slider.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="/wall/bcknds/hai-blog-slidr.js"></script>
<script src="/wall/bcknds/search.js"></script>
<script src="/wall/bcknds/user-menu.js"></script>
<script src="/wall/bcknds/follow-connections.js?v=20260730-1"></script>
</body>
</html>
<?php
mysqli_stmt_close($followers_statement);
?>