OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2025 11:18:49 AM
rwxr-xr-x
📄
.htaccess
860 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📁
.vscode
-
03/26/2025 03:47:57 AM
rwxr-xr-x
📁
CreateLeadPage
-
03/26/2025 04:16:47 AM
rwxr-xr-x
📄
ImageMagick-7.1.1-45-Q16-HDRI-x64-dll.exe
22.2 MB
03/26/2025 03:47:54 AM
rw-r--r--
📁
Xpress
-
03/26/2025 04:21:24 AM
rwxr-xr-x
📄
XpressPage.php
47.13 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
about.html
3.26 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
account.php
47.77 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
activate.php
2.19 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
add_channel.php
9.7 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
add_to_channel.php
980 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📁
admin
-
03/26/2025 04:16:40 AM
rwxr-xr-x
📄
analytics.php
37.71 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
assets
-
03/26/2025 04:16:41 AM
rwxr-xr-x
📁
audio
-
03/26/2025 03:48:03 AM
rwxr-xr-x
📄
businessLp.php
46.33 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
bussLp.php
57.87 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
card-news.php
6.2 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
channel.php
36.21 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
chattest.php
8.66 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
clients
-
03/26/2025 03:48:03 AM
rwxr-xr-x
📄
collections.php
94.62 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
comments.php
1.67 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
composer.json
65 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📄
composer.lock
4.03 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
contact.html
3.01 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
cookie.php
750 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📄
copytest.html
4.04 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
creamAdmin
-
03/26/2025 04:07:42 AM
rwxr-xr-x
📄
cream_dashboard.php
25.87 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
creamapi
-
03/26/2025 03:48:04 AM
rwxr-xr-x
📄
create.php
42.93 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
created_magazine.html
11.96 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
dashboard.php
55.52 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
data
-
03/26/2025 04:16:48 AM
rwxr-xr-x
📄
down.html
829 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📁
education-podcasts
-
03/31/2025 06:36:42 AM
rwxr-xr-x
📁
featured_channels
-
03/26/2025 03:48:04 AM
rwxr-xr-x
📄
featured_channels.php
32.48 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
featured_topics.php
26.59 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
fetch_articles.php
1.83 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
fetch_liked_users.php
1.55 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
filter.php
4.91 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
follow_action.php
1.75 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
follow_dash.php
33.76 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
form-builder
-
03/26/2025 03:48:04 AM
rwxr-xr-x
📄
function.php
20.61 KB
03/26/2025 03:47:47 AM
rw-r--r--
📁
genai
-
03/26/2025 04:20:06 AM
rwxr-xr-x
📄
generated_article.php
11.86 KB
03/26/2025 03:47:47 AM
rw-r--r--
📄
get_recent_items.php
1.37 KB
03/26/2025 03:47:47 AM
rw-r--r--
📄
handle_channel.php
856 bytes
03/26/2025 03:47:47 AM
rw-r--r--
📁
hindiConverter
-
03/26/2025 04:15:50 AM
rwxr-xr-x
📄
homePin.php
68.38 KB
03/26/2025 03:47:47 AM
rw-r--r--
📁
hps
-
03/26/2025 03:48:05 AM
rwxr-xr-x
📄
impmy_collection.php
124.17 KB
03/26/2025 03:47:47 AM
rw-r--r--
📁
inc
-
03/26/2025 04:15:50 AM
rwxr-xr-x
📄
index.php
30.55 KB
03/26/2025 03:47:48 AM
rw-r--r--
📄
index1.php
61.34 KB
03/26/2025 03:47:50 AM
rw-r--r--
📄
influencer.php
11.72 KB
03/26/2025 03:47:54 AM
rw-r--r--
📁
interface
-
03/26/2025 03:48:05 AM
rwxr-xr-x
📁
kannada
-
03/26/2025 04:20:06 AM
rwxr-xr-x
📄
knobly_logo.png
9.45 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
landing_page.php
17.27 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
landing_signin.php
5.11 KB
03/26/2025 03:47:54 AM
rw-r--r--
📁
leadpage
-
03/26/2025 04:15:53 AM
rwxr-xr-x
📄
link.php
5.63 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
logInCheck.php
4.41 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
loggedInCheck.php
1.15 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
logo (1).svg
814 bytes
03/26/2025 03:47:55 AM
rw-r--r--
📄
logout.php
503 bytes
03/26/2025 03:47:55 AM
rw-r--r--
📄
magazine.html
4.46 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
magazine.php
23.57 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
more.php
9.21 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
my_collection.php
153.03 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
my_settings.php
17.44 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
navbar.php
3.36 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
new-page.php
10.46 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
newEditor.php
17.04 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
newsletter.php
24.31 KB
03/26/2025 03:47:55 AM
rw-r--r--
📁
pageLanding
-
03/26/2025 04:20:07 AM
rwxr-xr-x
📁
pages
-
03/26/2025 04:15:53 AM
rwxr-xr-x
📄
payment.php
29.86 KB
03/26/2025 03:47:55 AM
rw-r--r--
📁
pdf
-
03/26/2025 03:48:06 AM
rwxr-xr-x
📄
pdftk_server-2.02-win-setup.exe
2.91 MB
03/26/2025 03:47:56 AM
rw-r--r--
📄
post-details.php
37.75 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
premium.php
21.79 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
privacy.html
12.1 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
process
-
03/26/2025 03:48:11 AM
rwxr-xr-x
📄
process-plan.php
1.44 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
process.php
1.52 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
process_data.php
5.02 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
profile.php
37.8 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
profile_pic_upload.php
4.83 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
profile_test.php
19.78 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
reels
-
03/26/2025 04:20:08 AM
rwxr-xr-x
📄
refund.html
9.04 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
replyPost.php
3.93 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
report
-
03/26/2025 03:48:11 AM
rwxr-xr-x
📄
request_article.php
22.76 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
reset.html
4.7 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
save_profile.php
2.78 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
saved.php
34.28 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
saved_posts.php
49.25 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
search_bar.php
16.95 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
sendy
-
03/26/2025 04:21:20 AM
rwxr-xr-x
📄
settings.php
81.93 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
sharemarket.php
3.88 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
showcase.php
10.34 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
signInProcess.php
13.83 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
signInProcess_backup.php
11.18 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
social_media
-
03/26/2025 04:16:12 AM
rwxr-xr-x
📄
start.html
3.99 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
store_articles.php
1.04 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
stream.php
62.31 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
streamPush.php
29.82 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
streamb.php
40.75 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
streambb.php
47.34 KB
03/26/2025 03:47:57 AM
rw-r--r--
📁
texttovoice
-
03/26/2025 03:48:13 AM
rwxr-xr-x
📁
thumbsUp
-
03/26/2025 03:48:13 AM
rwxr-xr-x
📄
toggle_channel.php
2.28 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
udupi_sign_up.php
34.5 KB
03/26/2025 03:47:57 AM
rw-r--r--
📁
uploads
-
03/26/2025 04:06:46 AM
rwxr-xr-x
📄
usage.html
37.76 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
userActivity.php
9.79 KB
03/26/2025 03:47:57 AM
rw-r--r--
📁
vendor
-
03/26/2025 04:20:23 AM
rwxr-xr-x
📄
verify.php
744 bytes
03/26/2025 03:47:57 AM
rw-r--r--
📄
view.php
13.36 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
view_newsletter.php
1.58 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
xpress_landing_page.php
78.63 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
xpress_landingpage.html
11.15 KB
03/26/2025 03:47:57 AM
rw-r--r--
Editing: post-details.php
Close
<?php // Assuming you're using a database connection require_once './assets/php/db_connect.php'; require_once './assets/php/config.php'; require_once './assets/php/db_config.php'; require_once './assets/php/validate.logged.php'; require_once './assets/php/function.php'; // Get the post ID from the URL if (isset($_GET['id'])) { $postId = $_GET['id']; } else { echo "Invalid post ID."; exit; } function main_post_card($id, $userId, $chat, $postedOn, $editedOn, $media, $metaData) { global $gUserId, $conn, $db; ?> <div class="mid_container all_post_container"> <div class="post" style="display:flex" data-id="<?= $id ?>"> <div class="con" style="justify-content: space-between; align-items: center;"> <div class="post-header d-flex align-items-center"> <div class="avatar me-2"> <a href="profile.php?userId=<?= $userId ?>"> <img src="<?= viewProfilePic($db, $userId) ?>" alt="Default Image" onerror="this.onerror=null; this.src='assets/img/default.png';"> </a> </div> </div> </div> <div class="postWithMainContainer" style="width:82%"> <div class="usernameWithfollow"> <div class="namewithfollow" style="display: flex; justify-content: space-between;"> <div class="username-date mb-2"> <a href="profile.php?userId=<?= $userId ?>"> <h5 class="mb-0" style="line-height: 14px;"><?= showUserName($db, $userId); ?></h5> </a> <span class="text-muted" style="font-size: 12px;"><?= formatToIST($postedOn); ?></span> <? if ($editedOn) { ?> <small class="text-muted">(Edited)</small> <? } ?> </div> <!-- <div> <? if ($gUserId != $userId) { ?> <button class="followButton" onclick="" data-id="<?= $userId ?>" style="margin-right : 15px"> <?= checkFollow($conn, $gUserId, $userId) ? 'Following' : 'Follow' ?> </button> <? } ?> </div> --> </div> </div> <div class="post-content" tabindex="0" data-thumbnail="false"> <!-- Display truncated content by default --> <!-- <a href="post-details.php?id=<?= $id ?>" style="text-decoration: none;"> --> <p id="fullContent_<?= $id ?>" style="margin:0px;"><?= convertLink(htmlspecialchars($chat)); ?></p> <!-- </a> --> <!-- Image/Video Display Section --> <?php if ($media) { // Split the comma-separated media string into an array $mediaArray = explode(',', $media); $mediaCount = count($mediaArray); if ($mediaCount < 2) { ?> <div class="stream-media"> <?php if (strpos($media, 'mp4') !== false || strpos($media, 'mov') !== false) { ?> <video controls onclick="openModal('video', '<?= htmlspecialchars($media); ?>',0)"> <source src="<?= htmlspecialchars($media); ?>" type="video/<?= strpos($media, 'mp4') !== false ? 'mp4' : 'quicktime'; ?>"> Your browser does not support the video tag. </video> <?php } else { ?> <img src="<?= htmlspecialchars($media); ?>" alt="Post media" onclick="openModal('image', '<?= htmlspecialchars($media); ?>',0)" style="cursor: pointer;"> <?php } ?> </div> <?php } else if ($mediaCount > 1) { ?> <div class="media-container"> <?php // Display the first 3 items normally $displayedMedia = 0; foreach ($mediaArray as $mediaItem) { $mediaItem = trim($mediaItem); if ($displayedMedia < 4) { ?> <div class="stream-media"> <?php if (strpos($mediaItem, 'mp4') !== false || strpos($mediaItem, 'mov') !== false) { ?> <video controls onclick="openModal('video', '<?= htmlspecialchars($media); ?>',<?= $displayedMedia ?>)"> <source src="<?= htmlspecialchars($mediaItem); ?>" type="video/<?= strpos($mediaItem, 'mp4') !== false ? 'mp4' : 'quicktime'; ?>"> Your browser does not support the video tag. </video> <?php } else { ?> <img src="<?= htmlspecialchars($mediaItem); ?>" alt="Post media" onclick="openModal('image', '<?= htmlspecialchars($media); ?>',<?= $displayedMedia ?>)" style="cursor: pointer;"> <?php } ?> </div> <?php $displayedMedia++; } } // If there are more than 3 items, show a "more" indicator in the fourth block if (($mediaCount > 4) && ($mediaCount != 4)) { ?> <div class="stream-media more"> <span class="more-count">+<?= $mediaCount - 3; ?> more</span> <!-- Optionally, you can make this span clickable to show remaining images/videos in a modal --> </div> <?php } ?> </div> <? } ?> <? } ?> </div> <? if (isset($metaData)) { $metaData = json_decode($metaData, true); if (isset($metaData['youtubeLink']) && ($metaData['youtubeLink'] != '')) { ?> <div style="width: 100%;" class="ytprew"><?= $metaData['youtubeLink']; ?></div> <? } else { ?> <div class="linkDisplay" style="width: 100%; height:auto;"> <div class="hyperlink mb-1" style="padding: 5px; background-color:#dedede; border-radius: 5px;"> <img style="width: 100%;" src="<?= $metaData['metaImage'] ?>" alt="Card image"> <div style="padding: 0px; flex-grow: 1;"> <? if (isset($metaData['metaTitle']) && $metaData['metaTitle'] != '') { ?> <b> <h3 id="linkHeading" style="font-size: 16px; margin: 0 0 5px; color: #333;"><?= $metaData['metaTitle'] ?></h3> </b> <? } if (isset($metaData['metaDesc']) && $metaData['metaDesc'] != '') { ?> <p id="linkDesc" style="margin: 0 0 10px; font-size: 14px; color: #555; line-height: 1.4;"> <?= $metaData['metaDesc'] ?> </p> <? } if (isset($metaData['metaUrl']) && $metaData['metaUrl'] != '') { ?> <a id="linkUrl" href="<?= $metaData['metaUrl'] ?>" style="font-size: 13px; color: #007bff; text-decoration: none;"> <?= (isset($metaData['metaDomain']) && $metaData['metaDomain'] != '') ? $metaData['metaDomain'] : $metaData['metaUrl'] ?> </a> <? } ?> </div> </div> </div> <? } } ?> <div class="actions d-flex mt-2" style="justify-content: space-between;"> <button class="btn reader-button viewButton flex" data-id='<?= $id ?>'> <i class="fa-solid fa-chart-column" style="padding-right: 4px; padding-top: 2px;"></i> <div class="viewCount" data-id="<?= $id ?>"> <?= getViewCount($conn, $id) ?> </div> </button> <!-- Like Button --> <button class="btn reader-button likeButton flex" data-id='<?= $id ?>'> <i class="<?= checkUserLike($conn, $id, $gUserId) ?>" style="padding-right: 4px; padding-top: 2px;"></i> <div class="likeCount likedUsers" data-id="<?= $id ?>"> <?= getLikeCount($conn, $id) ?> </div> </button> <!-- Comment Button --> <a style="position: relative;" href="post-details.php?id=<?= $id ?>"> <button class="btn reader-button flex btn-link"><i class="fa-regular fa-comments" style="padding-right: 4px; padding-top: 2px;"></i> <div class="replyCount"> <?= getReplyCount($conn, $id) ?> </div> </button> </a> <button class="btn reader-button saveButton flex" data-id='<?= $id ?>'> <i class="<?= checkUserSave($conn, $id, $gUserId) ?>" style="padding-right: 4px; padding-top: 2px;"></i> </button> <button class="btn p-1 reader-button copyButton shareNow" data-id='<?= $id ?>'> <i class="fa-solid fa-arrow-up-from-bracket"></i> </button> </div> </div> </div> </div> <? } function show_main_post($postId) { global $readerdb, $db, $gUserId; $sql = "SELECT * FROM reader_stream WHERE id= $postId"; $result = $readerdb->query($sql); if ($result->num_rows > 0) { // Fetch the first (and only) row $row = $result->fetch_assoc(); // Call the captureStream function with the data main_post_card($row['id'], $row['userId'], $row['chat'], $row['postedOn'], $row['editedOn'], $row['mediaPath'], $row['metadata']); } else { echo "No results found"; } } function show_reply_content($postId) { global $readerdb, $db, $gUserId; // SQL query to get posts ordered by the most recent $sql = "SELECT * FROM reader_stream WHERE referenceId = $postId and deleteFlag=0"; $result = $readerdb->query($sql); if ($result->num_rows > 0) { ?><div class="mid_container all_post_container"> <div class="header d-flex justify-content-between align-items-center "> <h1 class="fs-5 fw-bold text-white">Replies</h1> </div> <? while ($row = $result->fetch_assoc()) { ?> <div class="post" style="gap: 10px; position: relative;"> <div class="post-header d-flex align-items-center" style="justify-content: space-between;"> <div class="d-flex"> <div class="avatar me-3"> <img src="<?= viewProfilePic($db, $row['userId']) ?>" alt="Default Image" onerror="this.onerror=null; this.src='assets/img/arvind.png';"> </div> <div class="username-date"> <!-- Assuming showUserName fetches the username from the database using the userId --> <h5 class="mb-0"><?= showUserName($db, $row['userId']); ?></h5> <span class="text-muted"><?= formatToIST($row['postedOn']); ?></span> <?php if ($row['editedOn']) { ?> <small class="text-muted">(Edited)</small> <?php } ?> </div> </div> <? if ($gUserId == $row['userId']) { ?> <div alt="menu" width="100%" height="100%" id="menu-icon" style="padding-left: 10px; padding-right: 5px;" <?= $row['id'] ?> onclick="toggleDropcardMenu(<?= $row['id'] ?>)">⋮</div> <? } ?> <!-- Dropcard Menu --> <div id="dropcardMenu_<?= $row['id'] ?>" class="dropcardMenu"> <div class="editYourPost" onclick='editPost(<?= $row['id'] ?>, <?= json_encode($row['chat']) ?>)'> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" style="cursor: pointer;"> <path width="24" height="24" d="m5 16l-1 4l4-1L19.586 7.414a2 2 0 0 0 0-2.828l-.172-.172a2 2 0 0 0-2.828 0zM15 6l3 3m-5 11h8" /> </svg> </div> <div class="deleteYourPost" onclick="deletePost(<?= $row['id'] ?>)"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" style="cursor: pointer;"> <path width="24" height="24" d="M18 19a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3V7H4V4h4.5l1-1h4l1 1H19v3h-1zM6 7v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V7zm12-1V5h-4l-1-1h-3L9 5H5v1zM8 9h1v10H8zm6 0h1v10h-1z" /> </svg> </div> </div> </div> <div class="post-content mt-3"> <p><?= htmlspecialchars($row['chat']); ?></p> <?php if ($row['mediaPath']): ?> <?php if (strpos($row['mediaPath'], 'mp4') !== false): ?> <video controls> <source src="<?= htmlspecialchars($row['mediaPath']); ?>" type="video/mp4"> Your browser does not support the video tag. </video> <?php else: ?> <img src="<?= htmlspecialchars($row['mediaPath']); ?>" alt="Post media"> <?php endif; ?> <?php endif; ?> </div> <div class="actions d-flex justify-content-end mt-2"> <!-- Like Button (Needs AJAX to dynamically update like count) --> <button class="btn reader-button likeButton flex" data-id='<?= $row['id'] ?>'> <i class="<?= checkUserLike($readerdb, $row['id'], $gUserId) ?>" style="padding-right: 4px; padding-top: 2px;"></i> <div class="likeCount likedUsers" data-id="<?= $row['id'] ?>"> <?= getLikeCount($readerdb, $row['id']) ?> </div> </button> <!-- Comment Button --> <a href="?id=<?= $row['id'] ?>" style="text-decoration: none;"> <button class="btn reader-button flex btn-link"><i class="fa-regular fa-comments" style="padding-right: 4px; padding-top: 2px;"></i> <div class="replyCount"> <?= getReplyCount($readerdb, $row['id']) ?> </div> </button> </a> </div> </div> <? } ?> </div><? } else { ?> Be the first one to reply <? } } function show_reply_tab($postId) { ?> <div class="first_right_container"> <!-- Middle Section (Main Content) --> <div class="mid_container"> <div class="upload-section"> <form action="replyPost.php" method="post" enctype="multipart/form-data"> <div class="d-flex align-items-start"> <!-- <div class="avatar"></div> --> <div class="w-100"> <textarea id="contentTextarea" class="form-control mb-2" name="content" rows="3" placeholder="Reply..."></textarea> <div> </div> <div class="d-flex justify-content-between align-items-center"> <div> <!-- Hidden file input --> <input type="file" name="media" id="fileInput" accept="image/*,video/*" class="d-none" onchange="previewMedia();"> <button type="button" class="btn btn-link text-decoration-none text-light" onclick="document.getElementById('fileInput').click();"> <i class="bi bi-image"></i> </button> </div> <input type="hidden" name="refPostId" value="<?= $postId ?>"> <!-- Align Speak and Post buttons to the right side --> <div class="d-flex"> <!-- <button type="button" class="btn btn-link" onclick="startRecording()"> <i class="fa-solid fa-bullhorn"></i> Speak </button> --> <button type="submit" class="btn btn-upload ms-2">Post</button> </div> </div> <!-- Preview Section --> <div id="mediaPreview" class="mediaPreview mt-3"> <!-- Placeholder for image/video preview --> </div> </div> </div> </form> <script> // Check for Web Speech API compatibility const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; let recognition; if (SpeechRecognition) { recognition = new SpeechRecognition(); recognition.lang = "en-US"; // Set the language recognition.continuous = true; // Keep recording until stopped recognition.interimResults = true; // Show results in real time recognition.onresult = (event) => { const textarea = document.getElementById("contentTextarea"); let transcript = ''; for (let i = event.resultIndex; i < event.results.length; i++) { transcript += event.results[i][0].transcript; } textarea.value = transcript; // Update textarea with spoken text }; recognition.onerror = (event) => { console.error("Speech recognition error detected: " + event.error); }; } function previewMedia() { const fileInput = document.getElementById('fileInput'); const mediaPreview = document.getElementById('mediaPreview'); const file = fileInput.files[0]; // Clear previous previews mediaPreview.innerHTML = ''; if (file) { const fileReader = new FileReader(); // For image files if (file.type.startsWith('image')) { fileReader.onload = function(e) { const img = document.createElement('img'); img.src = e.target.result; // img.style.maxWidth = '100%'; // img.style.maxHeight = '300px'; // Set max height for the preview mediaPreview.appendChild(img); }; } // For video files else if (file.type.startsWith('video')) { const video = document.createElement('video'); video.controls = true; video.style.maxWidth = '100%'; video.style.maxHeight = '70vh'; // Set max height for the preview mediaPreview.appendChild(video); fileReader.onload = function(e) { video.src = e.target.result; video.load(); video.play(); }; } // Start reading the file fileReader.readAsDataURL(file); } } // Function to start/stop recording function startRecording() { if (recognition) { if (recognition.recognizing) { recognition.stop(); // Stop recognition if it's already running } else { recognition.start(); // Start recognition } } } </script> </div> </div> </div> <? } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Post Details</title> <!-- Add your stylesheets here, e.g., Bootstrap CSS --> <link href="assets/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/all.min.css"> <link href="assets/css/bootstrap-icons.min.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/styles.css"> <link rel="stylesheet" href="assets/css/stream.css"> <!-- Bootstrap JS and Bootstrap Icons --> <script src="assets/js/bootstrap.bundle.min.js"></script> <link href="assets/css/bootstrap-icons.min.css" rel="stylesheet"> <script src="assets/js/jquery-3.6.0.min.js"></script> <script src="assets/js/stream.js"></script> <!-- likedusers --> <script> function shareNow(postId) { // console.log(postId); var link = "https://knoblycream.com/streamPush.php?id=" + postId; copyToClipboard(link); } function copyToClipboard(note) { // Append the custom text to the note var textToCopy = note; // Try using the Clipboard API first if (navigator.clipboard) { navigator.clipboard.writeText(textToCopy).then(function() { alert('Note copied to clipboard: ' + textToCopy); }).catch(function(error) { console.error('Clipboard API error: ', error); fallbackCopy(textToCopy); }); } else { console.error('Clipboard API is not available'); fallbackCopy(textToCopy); } // Fallback method using a temporary textarea element function fallbackCopy(textToCopy) { // Create a temporary textarea element using jQuery var $tempTextArea = $('<textarea>'); // Set the value of the textarea to the text we want to copy $tempTextArea.val(textToCopy).appendTo('body'); // Focus the textarea and select the content using jQuery $tempTextArea.focus().select(); $tempTextArea[0].setSelectionRange(0, textToCopy.length); // For mobile devices // Try executing the copy command try { var successful = document.execCommand('copy'); if (successful) { alert('Note copied to clipboard: ' + textToCopy); } else { alert('Failed to copy note.'); } } catch (err) { console.error('Error copying text: ', err); alert('Failed to copy note.'); } finally { // Remove the temporary textarea from the document $tempTextArea.remove(); } } } $(document).ready(function() { $('.shareNow').on('click', function() { shareNow($(this).data('id')); }); $('#saveModalEditButton').on('click', function() { saveEditedContent(); }); }); $(document).on('click', '.likedUsers', function() { const postId = $(this).data('id'); // Get post ID from the button's data attribute $.ajax({ url: 'fetch_liked_users.php', type: 'POST', data: { postId: postId }, success: function(response) { console.log(response); // Debugging: Log the response const users = JSON.parse(response); if (users.error) { alert(users.error); } else if (users.message) { $('#likedUsersList').html('<li class="list-group-item text-center">' + users.message + '</li>'); } else { const userList = users.map(user => `<li class="list-group-item">${user}</li>`).join(''); $('#likedUsersList').html(userList); } const likedUsersModal = new bootstrap.Modal(document.getElementById('likedUsersModal')); likedUsersModal.show(); }, error: function() { alert('Error fetching likes.'); } }); }); </script> <script> const userId = <?= $gUserId ?>; $(document).ready(function() { // Handle like button clicks $(document).on('click', '.likeButton', function(e) { // If the clicked element has the `likedUsers` class, do not toggle like/unlike if ($(e.target).hasClass('likedUsers')) { return; // Prevent triggering the like toggle } // Proceed with like toggle functionality var feedId = $(this).data('id'); toggleLike(this, feedId, userId); }); }); function toggleLike(button, feedId, userId) { var thumbsUpIcon = $(button).find('i'); // The <i> tag with the class indicating the like status var likeCountElement = $(button).find('.likeCount'); // The div where the like count is displayed var isLiked = thumbsUpIcon.hasClass('fa-solid'); var requestType = isLiked ? 'unlike' : 'like'; $.ajax({ url: '/assets/php/handler.php', type: 'POST', contentType: 'application/json', data: JSON.stringify({ request: requestType, userId: userId, feedId: feedId }), success: function(response) { if (response.status === "success") { if (requestType === 'like') { thumbsUpIcon.removeClass('fa-regular').addClass('fa-solid'); } else { thumbsUpIcon.removeClass('fa-solid').addClass('fa-regular'); } var updatedLikeCount = response.likeCount === null ? '' : response.likeCount; likeCountElement.text(updatedLikeCount); } else { console.error("Error message:", response.message); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("Error:", textStatus, errorThrown); } }); } </script> <!-- open model script --> <script> function openModal(type, path, count) { let str = path; let mediaPaths = str.split(","); event.stopPropagation(); const modalContent = $('#modalContent'); modalContent.empty(); // Clear existing content if (type === 'video') { const video = $('<video></video>').attr('controls', true).css({ 'max-width': '100%', 'max-height': '100%' }).attr('src', mediaPaths[count]); modalContent.append(video); } else if (type === 'image') { const imgContainer = $('<div></div>').css({ 'position': 'relative', 'overflow': 'auto', // Allow scrolling when zoomed in 'width': '100%', 'height': '100%', 'display': 'flex', 'justify-content': 'center', // Center the image horizontally 'align-items': 'center' // Center the image vertically }); const img = $('<img></img>').attr('src', mediaPaths[count]).css({ 'max-width': '100%', 'max-height': '100%', 'cursor': 'zoom-in', // Cursor will indicate zooming 'transition': 'transform 0.3s ease' // Smooth transition for scaling }).attr('id', 'zoomableImage'); imgContainer.append(img); modalContent.append(imgContainer); } // Initialize modal const modal = new bootstrap.Modal($('#mediaModal')[0]); modal.show(); } </script> <style> .dropcardMenu { width: fit-content; right: 7px; } .editYourPost { padding-bottom: 20px; } .ytprew iframe { width: 100% !important; } .first_right_container { margin-bottom: 65px; } </style> <!-- multiple images --> <style> /* Media container */ .media-container { display: grid; grid-template-columns: repeat(2, 1fr); /* Default 3 columns */ gap: 10px; width: 100%; } /* Stream media styling */ .stream-media { position: relative; } .stream-media img, .stream-media video { width: 100%; height: 100%; object-fit: cover; object-position: center; } /* Specific styles for more block */ .stream-media.more { display: flex; justify-content: center; align-items: center; background-color: #f0f0f0; border: 1px solid #ddd; color: #777; font-size: 16px; } .stream-media.more .more-count { font-weight: bold; } /* Custom grid layouts based on the number of items */ <?php if ($mediaCount == 2) { ?>.media-container { grid-template-columns: repeat(2, 1fr); /* 2 items in half-half layout */ } <?php } elseif ($mediaCount == 3) { ?>.media-container { grid-template-columns: 1fr 2fr; /* 1:2 ratio layout */ } <?php } elseif ($mediaCount == 4) { ?>.media-container { grid-template-columns: repeat(4, 1fr); /* 4 items in 1/4 layout */ } <?php } elseif ($mediaCount == 1) { ?>.media-container { grid-template-columns: 1fr; /* Single item takes full width */ } <?php } ?> </style> </head> <style> .postDetails { display: flex; justify-self: center; justify-content: center; gap:20px; margin-top: 20px; } @media screen and (max-width:540px) { .postDetails { gap:0px; } } .conatiner { padding-left: 0px !important; } </style> <body> <? include 'assets/php/social_navbar.php' ?> <div class="postDetails" style=""> <div class="streamLeftbar"> <?php include 'assets/php/sidebar.php' ?> </div> <div class=" " style="justify-self:center;"> <? show_main_post($postId) ?> <? show_reply_content($postId) ?> <? show_reply_tab($postId) ?> </div> <!-- Bootstrap Modal --> <div class="modal fade" id="likedUsersModal" tabindex="-1" aria-labelledby="likedUsersModalLabel" aria-hidden="true"> <div class="modal-dialog" style="width:fit-content"> <div class="modal-content" style="margin-left: 50px;"> <div class="modal-header"> <h5 class="modal-title" id="likedUsersModalLabel">People who liked this post</h5> </div> <div class="modal-body"> <ul id="likedUsersList" class="list-group"> <!-- Usernames will be dynamically inserted here --> </ul> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> </div> </div> </div> </div> </div> <!-- Edit Post Modal --> <div class="modal fade" id="editPostModal" tabindex="-1" aria-labelledby="editPostModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="editPostModalLabel">Edit Post</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <!-- Textarea for editing content --> <textarea id="modalContentTextarea" class="form-control" rows="5" style="overflow-y: auto; max-height: 200px;"></textarea> </div> <div class="modal-footer"> <!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> --> <button type="button" id="saveModalEditButton" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> <!-- Media Modal --> <div id="mediaModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button style="background-color:#333; position:absolute; right:20px;" type="button" class="btn-close zoomButton" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body text-center" style="position: relative;"> <div id="modalContent" style="max-width: auto; max-height: auto; transition: transform 0.3s ease;"> </div> </div> </div> </div> </div> <? include 'assets/php/footer.php' ?> <? include 'assets/php/bottom_navbar.php' ?> <!-- Include Bootstrap JS --> <script src="assets/js/bootstrap.bundle.min.js"></script> </body> </html>