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: channel.php
Close
<?php include './assets/php/db_connect.php'; include './inc/config.php'; include './assets/php/validate.logged.php'; include './assets/php/function.php'; require_once './assets/php/db_config.php'; $channel_id = $_GET['channelId']; function show_stream_content($channel_id) { global $readerdb, $gUserId; // Ensure $gUserId is defined and accessible // Fetch channel details (name, profilePic, bio) $channel_sql = "SELECT name, profilePic, bio FROM channels WHERE id = ?"; $channel_stmt = $readerdb->prepare($channel_sql); $channel_stmt->bind_param("i", $channel_id); $channel_stmt->execute(); $channel_result = $channel_stmt->get_result(); // Check if channel exists if ($channel_result->num_rows > 0) { $channel_info = $channel_result->fetch_assoc(); $channel_name = $channel_info['name']; $profilePic = "https://knoblycream.com/data/channelPic/" . $channel_info['profilePic']; $bio = $channel_info['bio']; } else { echo "<p>Channel not found.</p>"; return; } ?> <div class='channel_info'> <img src=<?= $profilePic ?> alt='Profile Picture' class='channel-profile-pic'> <div class='channel_text'> <h1><?= $channel_name ?></h1> <p><?= $bio ?></p> </div> </div> <? // Fetch posts for the channel $sql = "SELECT cc.post_id AS id, rs.userId, rs.chat, rs.postedOn, rs.editedOn, rs.mediaPath, rs.metadata FROM reader_stream rs INNER JOIN channel_content cc ON rs.id = cc.post_id WHERE rs.deleteFlag = 0 AND cc.channel_id = ? ORDER BY rs.postedOn DESC"; // Prepare and execute query for posts $stmt = $readerdb->prepare($sql); $stmt->bind_param("i", $channel_id); $stmt->execute(); $result = $stmt->get_result(); // Display posts if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { generate_stream_card($row['id'], $row['userId'], $row['chat'], $row['postedOn'], $row['editedOn'], $row['mediaPath'], $row['metadata']); } } else { echo "<p>No posts available.</p>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Knobly Cream</title> <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"> <style> .readMoreBtn { color: #6d6e71 !important; background: none; border: none; padding: 0; cursor: pointer; color: blue !important; font-size: x-small !important; display: inline !important; } .readMoreBtn:hover { text-decoration: underline; } .hyperlink img { border-radius: 10px; /* margin-top: 10px; */ max-width: 100%; margin-bottom: 10px; } .linkDisplay .hyperlink img { object-fit: cover; border-radius: 5px; } @media screen and (max-width:720px) { .linkDisplay .hyperlink img { object-fit: cover; border-radius: 5px; width: 100vw; } } .ytprew { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px auto; padding: 10px; /* border: 1px solid #ccc; */ border-radius: 8px; background-color: #f9f9f9; width: auto; /* Ensures the div doesn't stretch too wide */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } .ytprew iframe { width: 100%; max-width: 853px; /* Matches YouTube's default embed width */ height: 480px; border-radius: 8px; border: none; } .ytprew a { margin-top: 10px; color: #0073e6; text-decoration: none; font-weight: bold; } .ytprew a:hover { text-decoration: underline; color: #005bb5; } .ytprew p { margin: 10px 0 0; font-size: 14px; color: #555; text-align: center; } #ytPreview { display: none; } </style> <style> #modalContent img { display: block; margin: 0 auto; } #modalContent video { display: block; margin: 0 auto; } @media screen and (max-width:540px) { .navaigation_main { display: none; } } .first_right_container { border: none; } .first_right_container { margin-bottom: 50px; } </style> <style> .channel_info { display: flex; align-items: center; gap: 15px; /* Space between image and text */ padding: 10px; max-width: 100%; margin: 10px 0; /* Adjust spacing */ background: none; /* Remove background */ box-shadow: none; /* Remove box shadow */ border-radius: 0; /* Remove border-radius */ } .channel-profile-pic { width: 80px; /* Adjust as needed */ height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid #007bff; /* Keep a slight border */ } .channel_text h1 { font-size: 20px; color: #333; margin-bottom: 5px; } .channel_text p { font-size: 14px; color: #666; line-height: 1.4; margin: 0; } </style> <style> .streamLeftbar { height: 85vh; overflow-y: auto; } .first_right_container { height: 85vh; overflow-y: scroll; padding-bottom: 55px; } @media screen and (max-width:768px) { .streamLeftbar { height: 1vh !important; overflow-y: auto; } } </style> <script src="assets/js/jquery-3.6.0.min.js"></script> <!-- Bootstrap JS and Bootstrap Icons --> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/stream.js"></script> <script> const userId = <?= $gUserId ?>; let tempUrl = ''; let letUrl = true; let dotInterval; var myModal; $(document).ready(function() { // Initialize the height on page load var $textarea = $('#contentTextarea'); if ($textarea.length) { adjustTextareaHeight($textarea[0]); } $('.followButton').on('click', function() { const targetUserId = $(this).data('id'); // ID of the user to follow/unfollow toggleFollow(this, userId, targetUserId); // Pass `this` (the button element) as the first parameter }); $('#saveModalEditButton').on('click', function() { saveEditedContent(); }); // likedUsers $(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.'); } }); }); // Handle like button clicks $(document).on('click', '.likeButton', function(e) { event.stopPropagation(); // 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); }); $(document).on('click', '.saveButton', function(e) { var id = $(this).data('id'); toggleSave(this, id); }); $('#contentTextarea').on('input', function() { var content = $('#contentTextarea').val().trim(); console.log(content); // Updated regular expression to match full URLs, including subdomains and paths var url_pattern = /(?:https?|ftp):\/\/(?:[a-zA-Z0-9-]+\.)?(?:[a-zA-Z0-9-]+\.[a-zA-Z]{2,})(?:\/[^\s]*)?/g; var youtube_pattern = /(?:v=|youtu\.be\/|embed\/)([a-zA-Z0-9_-]+)/; // Attempt to match all URLs within the content var matchedUrls = content.match(url_pattern); var youtubeUrl = content.match(youtube_pattern); if (youtubeUrl) { youtubeUrl.forEach(function(url) { console.log('Matched URL:', url); // Log each matched URL }); if (tempUrl != youtubeUrl[0]) { letUrl = true; tempUrl = youtubeUrl[0]; removeMeta(); // Show the loading animation $('#loadingIcon').show(); // $('#postedContent').html(''); // Clear any previous metadata // Send the first matched URL to the server for metadata fetching $.ajax({ url: 'link.php', // Submit to the same page type: 'POST', data: { ytUrl: youtubeUrl[0] }, // Send the first matched URL success: function(response) { // Hide the loading animation $('#loadingIcon').hide(); if (response.iframe) { $('#ytPreview').html(response.iframe); $('#hiddenYTLink').val(response.iframe || ''); $('#hiddenTitle').val(response.title || ''); $('#ytPreview').show(); } else { return; } }, error: function() { // Hide the loading animation on error $('#loadingIcon').hide(); console.log("Error fetching Youtube Link"); } }); } } else if (matchedUrls) { // Log all matched URLs to the console (for testing purposes) matchedUrls.forEach(function(url) { console.log('Matched URL:', url); // Log each matched URL }); if (tempUrl != matchedUrls[0]) { letUrl = true; tempUrl = matchedUrls[0]; removeYT(); // Show the loading animation $('#loadingIcon').show(); // $('#postedContent').html(''); // Clear any previous metadata // Send the first matched URL to the server for metadata fetching $.ajax({ url: 'link.php', // Submit to the same page type: 'POST', data: { url: matchedUrls[0] }, // Send the first matched URL success: function(response) { // Hide the loading animation $('#loadingIcon').hide(); $('#linkPreview').show(); if (response.url) { $('#linkPreview #linkHeading').html(response.title || ''); // Set heading text $('#linkPreview #linkDesc').html(response.description || ''); // Set description text $('#linkPreview #linkUrl').attr('href', response.url || ''); // Set link URL $('#linkPreview #linkUrl').html(response.domain || ''); $('#hiddenTitle').val(response.title || ''); $('#hiddenDesc').val(response.description || ''); $('#hiddenUrl').val(response.url || ''); $('#hiddenDomain').val(response.domain || ''); if (response.image) { $('#linkPreview img').attr('src', response.image); // Set image source $('#hiddenImage').val(response.image); } } else { return; } }, error: function() { // Hide the loading animation on error $('#loadingIcon').hide(); console.log("Error fetching the metadata"); } }); } } else { // Clear content and hide the loading animation if no valid URL is found $('#loadingIcon').hide(); } if (tempUrl != youtubeUrl[0]) { removeYT(); } if (tempUrl != matchedUrls[0]) { removeMeta() } if (youtubeUrl[0] == '') { removeYT(); } if (matchedUrls[0] == '') { removeMeta(); } }); }); function removeMeta() { $('#linkPreview').hide(); $('#hiddenTitle').val(''); $('#hiddenDesc').val(''); $('#hiddenUrl').val(''); $('#hiddenDomain').val(''); $('#hiddenImage').val(''); } function removeYT() { $('ytPreview').html(''); $('#ytPreview').hide(); } // The uploadPost function can now use myModal because it's in a broader scope function uploadPost() { // Collect the data from the inputs var content = $("#contentTextarea").val(); // Textarea content var fileInput = $("#fileInput")[0].files[0]; // The selected file var hiddenTitle = $("#hiddenTitle").val(); var hiddenDesc = $("#hiddenDesc").val(); var hiddenUrl = $("#hiddenUrl").val(); var hiddenImage = $("#hiddenImage").val(); var hiddenDomain = $("#hiddenDomain").val(); var hiddenYTLink = $("#hiddenYTLink").val(); // Create a FormData object to send data (use FormData if sending files) var formData = new FormData(); // Conditionally append fields if they have values if (content) formData.append("content", content); if (fileInput) formData.append("media", fileInput); // Attach the file if selected if (hiddenTitle) formData.append("hiddenTitle", hiddenTitle); if (hiddenDesc) formData.append("hiddenDesc", hiddenDesc); if (hiddenUrl) formData.append("hiddenUrl", hiddenUrl); if (hiddenImage) formData.append("hiddenImage", hiddenImage); if (hiddenDomain) formData.append("hiddenDomain", hiddenDomain); if (hiddenYTLink) formData.append("hiddenYTLink", hiddenYTLink); // Show loading spinner $("#loadingIcon").show(); // Send the data to PHP via AJAX $.ajax({ url: 'process_data.php', // The PHP page where you want to process the data type: 'POST', data: formData, processData: false, // Important for sending files contentType: false, // Important for sending files success: function(response) { // Hide loading spinner after response $("#loadingIcon").hide(); if (response.status === 'success') { alert("Posted successfully!"); myModal.hide(); // Use myModal here to hide the modal after successful post window.location.reload(); } else { alert("Error: " + response.message); } }, error: function(xhr, status, error) { $("#loadingIcon").hide(); alert("An error occurred: " + error); } }); } // Close the dropdown menu if the user clicks anywhere outside the menu or the icon $(document).click(function(event) { var $isClickInsideMenu = $(event.target).closest('.dropcardMenu'); var $isClickInsideIcon = $(event.target).closest('.menu-container'); // Close the dropdown if the click is outside the menu and icon if ($isClickInsideMenu.length === 0 && $isClickInsideIcon.length === 0) { closeAllDropcardMenus(); } }); // Add event listeners to Edit and Delete buttons to close the dropdown when clicked $('.editBtn').click(function() { closeAllDropcardMenus(); }); $('.dropcardMenu a button').click(function() { closeAllDropcardMenus(); }); // Attach the `oninput` event for dynamic resizing $(document).on('input', '#contentTextarea', function() { adjustTextareaHeight(this); }); </script> <script> function openModal(type, path) { 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', path); 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', path).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(); // Add zoom functionality if (type === 'image') { const zoomableImage = $('#zoomableImage'); const imgContainer = zoomableImage.parent(); let scaleValue = 1; // Start with the image at its original size (100%) // Click event to zoom in (only zoom in, no zoom out) zoomableImage.on('click', function() { if (scaleValue < 2) { // Zoom in by 50% up to a max scale of 2 (200%) scaleValue += 0.5; // Zoom in by 50% zoomableImage.css('cursor', 'zoom-out'); // Change cursor to zoom-out after zooming in } zoomableImage.css('transform', `scale(${scaleValue})`); }); // Enable scrolling to zoom in (no zoom out) zoomableImage.on('wheel', function(event) { event.preventDefault(); // Zoom in when scrolling up if (scaleValue < 2 && event.originalEvent.deltaY < 0) { // Zoom in if scale < 2 and scroll up scaleValue += 0.1; // Zoom in by 10% } scaleValue = Math.min(scaleValue, 2); // Limit the zoom to 200% zoomableImage.css('transform', `scale(${scaleValue})`); }); // Allow dragging functionality after zooming in (scroll to move the image) let isDragging = false; let startX, startY, scrollLeft, scrollTop; imgContainer.on('mousedown', function(e) { if (scaleValue > 1) { // Enable dragging only when zoomed in isDragging = true; startX = e.pageX - imgContainer.offset().left; startY = e.pageY - imgContainer.offset().top; scrollLeft = imgContainer.scrollLeft(); scrollTop = imgContainer.scrollTop(); } }); imgContainer.on('mouseleave mouseup', function() { isDragging = false; }); imgContainer.on('mousemove', function(e) { if (!isDragging) return; e.preventDefault(); const moveX = e.pageX - startX; const moveY = e.pageY - startY; imgContainer.scrollLeft(scrollLeft - moveX); imgContainer.scrollTop(scrollTop - moveY); }); } } </script> <!-- <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 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> --> </head> <body> <? include 'assets/php/social_navbar.php' ?> <div class="add_emerge" style="display: flex; flex-direction:column; justify-content:center"> <div class="container" style="margin-top: 10px; padding:0;"> <div class="streamLeftbar"> <? include 'assets/php/sidebar.php' ?> </div> <div class="first_right_container"> <div class="stream_content"> <? show_stream_content($channel_id) ?> </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> <!-- likedUsers 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> <!-- Upload Modal --> <div class="modal fade" id="uploadModal" tabindex="-1" aria-labelledby="uploadModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="uploadModalLabel">Share</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" style="background-color:#555"></button> </div> <div class="modal-body"> <!-- Your upload form goes here --> <div class="upload-section"> <div class="d-flex align-items-start"> <div class="w-100"> <div id="loadingIndicator" style="display: none; font-size: 14px; color: gray;">Generating<span id="dots">...</span></div> <div style="display: flex; align-items: center; gap: 10px;"> <textarea id="contentTextarea" class="form-control mb-2" placeholder="What would you like to share?" style="flex: 1; overflow: hidden; resize: none;" oninput="adjustTextareaHeight(this)"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <div> <input type="file" id="fileInput" accept="image/*,video/*" class="d-none" onchange="previewMedia();"> <button type="button" class="btn btn-link text-decoration-none text-light bg-none" onclick="document.getElementById('fileInput').click();"> <i class="bi bi-image"></i> </button> </div> <div class="d-flex"> <button type="button" onclick="fetchGenAIContent()" style="text-decoration: none; border:none; border-radius:5px"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <g fill="none" fill-rule="evenodd"> <path d="m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z" /> <path fill="currentColor" d="M19 19a1 1 0 0 1 .117 1.993L19 21h-7a1 1 0 0 1-.117-1.993L12 19zm.631-14.632a2.5 2.5 0 0 1 0 3.536L8.735 18.8a1.5 1.5 0 0 1-.44.305l-3.804 1.729c-.842.383-1.708-.484-1.325-1.326l1.73-3.804a1.5 1.5 0 0 1 .304-.44L16.096 4.368a2.5 2.5 0 0 1 3.535 0m-2.12 1.414L6.677 16.614l-.589 1.297l1.296-.59L18.217 6.49a.5.5 0 1 0-.707-.707M6 1a1 1 0 0 1 .946.677l.13.378a3 3 0 0 0 1.869 1.87l.378.129a1 1 0 0 1 0 1.892l-.378.13a3 3 0 0 0-1.87 1.869l-.129.378a1 1 0 0 1-1.892 0l-.13-.378a3 3 0 0 0-1.869-1.87l-.378-.129a1 1 0 0 1 0-1.892l.378-.13a3 3 0 0 0 1.87-1.869l.129-.378A1 1 0 0 1 6 1m0 3.196A5 5 0 0 1 5.196 5q.448.355.804.804q.355-.448.804-.804A5 5 0 0 1 6 4.196" /> </g> </svg> </button> <button class="btn btn-upload ms-2" onclick="uploadPost()"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <path fill="none" stroke="currentColor" d="m6.998 10.247l.435.76c.277.485.415.727.415.993s-.138.508-.415.992l-.435.761c-1.238 2.167-1.857 3.25-1.375 3.788c.483.537 1.627.037 3.913-.963l6.276-2.746c1.795-.785 2.693-1.178 2.693-1.832s-.898-1.047-2.693-1.832L9.536 7.422c-2.286-1-3.43-1.5-3.913-.963s.137 1.62 1.375 3.788Z" /> </svg> </button> </div> </div> <div id="mediaPreview" class="mt-3"></div> <div id="linkPreview" class="mt-3" style="display: none; width: 100%; height:auto;"> <div class="hyperlink" style="padding: 10px;"> <img src="" alt="Card image"> <div style="padding: 0px; flex-grow: 1;"> <h3 id="linkHeading" style="font-size: 16px; margin: 0 0 5px; color: #333;"></h3> <p id="linkDesc" style="margin: 0 0 10px; font-size: 14px; color: #555; line-height: 1.4;"></p> <a id="linkUrl" href="" style="font-size: 13px; color: #007bff; text-decoration: none;"></a> </div> </div> </div> <div id="ytPreview" class="mt-3 ytprew"></div> <div id="loadingIcon" class="text-center" style="display:none;"> <div class="spinner-border" role="status"> <span class="sr-only">Loading...</span> </div> </div> <div> <input type="hidden" id="hiddenTitle"> <input type="hidden" id="hiddenDesc"> <input type="hidden" id="hiddenUrl"> <input type="hidden" id="hiddenImage"> <input type="hidden" id="hiddenDomain"> <input type="hidden" id="hiddenYTLink"> </div> </div> </div> </div> </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' ?> </body> </html>