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/user/following.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 followed by the logged-in user */

$following_statement = mysqli_prepare(
    $conn,
    "
    SELECT
        artist.id,
        artist.username,
        artist.name,
        artist.image,
        artist.user_category,
        follow_record.followed_at

    FROM wall_follows AS follow_record

    INNER JOIN wall_users AS artist
        ON artist.id = follow_record.following_id
       AND artist.is_active = 1

    WHERE follow_record.follower_id = ?

    ORDER BY follow_record.followed_at DESC,
             artist.id DESC
    "
);
if(!$following_statement){
    error_log(
        "Following query preparation failed: "
        . mysqli_error($conn)
    );

    http_response_code(500);
    exit;
}

mysqli_stmt_bind_param(
    $following_statement,
    "i",
    $logged_user_id
);

if(!mysqli_stmt_execute($following_statement)){
    mysqli_stmt_close($following_statement);
    http_response_code(500);
    exit;
}

$following_result = mysqli_stmt_get_result(
    $following_statement
);

$following_count = mysqli_num_rows(
    $following_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>Artists I Follow | HAI Wall</title>

<meta name="description"
      content="View the artists you follow 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 = "following";

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

?>


<section class="connections-section">

<div class="connections-header">

<div>

<h1>
<i class="fa fa-check-circle"></i>
Following
</h1>

<p>
Artists whose creative journey you follow
</p>

</div>

<span class="connections-count">
<?=htmlspecialchars(
    $following_count . " Following",
    ENT_QUOTES,
    "UTF-8"
)?>
</span>
</div>


<?php if($following_count > 0){ ?>

<div class="connections-grid">

<?php while(
    $follower = mysqli_fetch_assoc(
        $following_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);

?>

<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"
    data-target-user-id="<?=(int)$follower["id"]?>"
    data-following="1"
    data-remove-on-unfollow="1"
    data-action-token="<?=htmlspecialchars(
        $follow_action_token,
        ENT_QUOTES,
        "UTF-8"
    )?>"
    aria-pressed="true"
>

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

<span class="connection-follow-label">
Unfollow
</span>

</button>

</div>

<?php } ?>

</div>

<?php }else{ ?>

<div class="connections-empty">

<i class="fa fa-users"></i>

<h2>You are not following any artists yet</h2>

<p>
Discover artists and follow the creative work you would like to see in My Circle.
</p>

<a href="/wall/user/all-users.php">
<i class="fa fa-users" aria-hidden="true"></i>
Discover Artists
</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-2"></script>

</body>
</html>

<?php
mysqli_stmt_close($following_statement);
?>