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: featured_channels.php
Close
<?php error_reporting(E_ALL); ini_set('display_errors', 1); ini_set('log_errors', 1); include 'assets/php/validate.logged.php'; include 'assets/php/db_connect.php'; include 'inc/config.php'; include 'assets/php/function.php'; require_once './assets/php/db_config.php'; $rss_id = isset($_GET['rss_id']) ? intval($_GET['rss_id']) : null; $feedId = isset($_GET['feed_id']) ? intval($_GET['feed_id']) : null; function guardianImg($image) { $position = strpos($image, '.jpg'); // Remove any existing query parameters by splitting the URL at the '?' and keeping the base part $baseUrl = substr($image, 0, $position + 4); // Append the new query parameters $modimg = $baseUrl . '?width=620&dpr=1&s=none'; return $modimg; } function fetch_articles($readerdb, $rss_id) { if ($rss_id === null) { echo '<p>Error: RSS ID not provided.</p>'; exit; // Stop execution if rss_id is not provided } // Prepare the query $stmt = $readerdb->prepare("SELECT rfa.id, rfu.rss_publisher, rfa.url, rfa.title, rfa.description, rfa.image AS articleImage, rfu.rss_image AS rssImage, rfa.date FROM rss_feeds_articles rfa INNER JOIN rss_feeds_url rfu ON rfa.feed_id = rfu.rss_id WHERE rfu.rss_id = ? ORDER BY rfa.date DESC limit 100 "); $stmt->bind_param("i", $rss_id); $stmt->execute(); $result = $stmt->get_result(); ?> <h1 class="text-center mb-4 text-white"><?= fetch_publisher_title($readerdb, $rss_id) ?></h1> <? if ($result->num_rows > 0) { // Output data of each row while ($row = $result->fetch_assoc()) { $feedId = stripslashes($row['id']); $title = htmlspecialchars(strip_tags(stripslashes($row['title']))); $description = htmlspecialchars(strip_tags(stripslashes($row['description']))); // $image = is_null($row['articleImage']) || $row['articleImage'] === '' ? (is_null($row['rssImage']) || $row['rssImage'] === '' ? '' : ($row['rssImage'])) : $row['articleImage']; $image = $row['rssImage']; $date = htmlspecialchars(strip_tags(stripslashes($row['date']))); if ($rss_id == 37) { $image = guardianImg($image); } ?> <div class="col-md-4"> <div class="card mb-4 news-item" data-id="<?= htmlspecialchars($feedId) ?>" data-title="<?= $title ?>" data-description="<?= $description ?>" data-image="<?= htmlspecialchars($image) ?>" data-url="<?= htmlspecialchars($row['url']) ?>" data-date="<?= $date ?>"> <img src="<?= htmlspecialchars($image) ?>" class="card-img-top" alt="News Image"> <div class="card-body"> <h5 class="card-title"><?= $title ?></h5> <p class="card-text"><strong>Date: </strong><?= $date ?></p> </div> </div> </div> <? } } else { ?> <p>No news available at the moment.</p> <? } // Close the prepared statement and the database connection $stmt->close(); $readerdb->close(); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Featured Channels</title> <link rel="stylesheet" href="assets/css/bootstrap.min.4.5.css"> <link rel="stylesheet" href="assets/css/all.min.css"> <link rel="stylesheet" href="assets/css/styles.css"> <link rel="stylesheet" href="assets/js/scripts.js"> <!-- jQuery --> <script src="assets/js/jquery-3.6.0.min.js"></script> <script src="assets/js/popper.min.2.9.js"></script> <script src="assets/js/bootstrap.bundle.min.4.5.js"></script> <!-- Bootstrap CSS --> <link href="assets/css/bootstrap.min.css" rel="stylesheet"> <!-- Bootstrap JS --> <script src="assets/js/bootstrap.bundle.min.js"></script> <style> body { background-color: #141414 !important; color: #fff; font-family: 'Roboto', sans-serif; margin: 0; padding: 0; } .card, .modal-content { background-color: #1c1c1c !important; color: white !important; border: none; margin-bottom: 20px; transition: transform 0.3s; } .card:hover { transform: scale(1.05); } .card img { max-height: 200px; object-fit: cover; } .modal-content { background-color: #1c1c1c; color: white; } .modal-body { padding: 20px; } .morewithlike i { color: #a3a2a2; border: none; padding: 0; } .morewithlike button::after { border-color: pink; /* Ensure no outline when focused */ border: none; outline: none; } .card-body { /* margin-bottom: var(--bs-card-title-spacer-y)!important; */ color: black !important; background-color: #fff !important; } #news-container .text-white { --bs-text-opacity: 1; color: #141414 !important; } .modal-content { background-color: var(--bg-color-light) !important; color: var(--bg-color-dark) !important; border: none; margin-bottom: 20px; transition: transform 0.3s; } </style> <style> .sideWithMainContainer { display: flex; flex-direction: row; gap: 10px; overflow-x: hidden; } p { color: black; } .sideMaincontent { overflow-y: scroll; padding: 30px 0; } @media (min-width: 768px) { .col-md-2 { padding: 0px !important; } } @media (max-width: 768px) { .col-md-2 { display: none !important; } } @media (min-width: 1400px) { .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl { max-width: 100% !important; } } </style> </head> <body> <!-- Navbar --> <? include 'assets/php/social_navbar.php' ?> <div class="sideWithMainContainer"> <div class="col-md-2"> <? include 'assets/php/sidebar.php' ?> </div> <div class="container mt-4 mb-4 col-sm-12 col-md-10 sideMaincontent"> <div class="row" id="news-container"> <? fetch_articles($readerdb, $rss_id) ?> </div> </div> <!-- Modal --> <div class="modal fade" id="newsModal" tabindex="-1" aria-labelledby="newsModalLabel" aria-hidden="true" style=" top:100px"> <div class="modal-dialog" style="margin-bottom: 110px;"> <div class="modal-content"> <div class="modal-header w-full flex justify-between items-center gap-4"> <h5 class="model-title " id="newsModalLabel"></h5> <button type="button" class="btn-close w-full w-[1/5] flex items-center justify-center color-red" data-bs-dismiss="modal" aria-label="Close" style="background-color: #a3a2a2;"></button> </div> <div class="modal-body"> <img src="" id="modal-image" class="img-fluid mb-3" alt="News Image"> <p id="modal-description"></p> <p class="datewithtime"><strong>Date: </strong><span id="modal-date"></span></p> <div class="morewithlike d-flex justify-content-between"> <a href="" id="modal-url" class="btn btn-primary">Read More</a> <div id="dataModal" data-id="" data-title="" data-description="" data-url=""></div> <div class="data col-12 col-md-6 text-md-right pl-0 mt-2 mt-md-0 d-flex "> <!-- <button class="btn p-2 reader-button play-button"> <i class="fas fa-volume-up"></i> </button> --> <button class="btn p-2 reader-button pause-button" style="display:none;"> <i class="fas fa-pause"></i> </button> <button class="btn p-2 reader-button resume-button" style="display:none;"> <i class="fas fa-play"></i> </button> <button class="btn p-2 reader-button stop-button" style="display:none;"> <i class="fas fa-stop"></i> </button> <button class="btn reader-button likeButton"> <i id="thumbsUp" class="fa-regular fa-thumbs-up" style="padding-right: 4px; padding-top: 2px;"></i> <div id="likeCount"></div> </button> <!-- <button class="btn p-2 reader-button comments" onclick="toggleComment()"> <i class="fa-regular fa-comments"></i> </button> --> <button class="btn p-2 reader-button icon-container" style="margin-bottom: 0px;"> <i class="far fa-bookmark" id="bookmarkIcon"></i> </button> <!-- <button class="btn p-2 reader-button" onclick="toggleShare()"> <i class="fa-solid fa-arrow-up-from-bracket"></i> </button> --> <button class="btn p-2 reader-button copyButton"> <i class="fa-solid fa-arrow-up-from-bracket"></i> </button> </div> </div> </div> </div> </div> </div> </div> <!-- Footer --> <? include 'assets/php/footer.php' ?> <? include 'assets/php/bottom_navbar.php' ?> <script> const userId = <?= $gUserId ?>; $(document).ready(function() { $('.news-item').on('click', function() { var feed_id = $(this).data('id'); var title = $(this).data('title'); var description = $(this).data('description'); var image = $(this).data('image'); var date = $(this).data('date'); var url = $(this).data('url'); $('#dataModal').attr('data-id', feed_id); $('#dataModal').attr('data-title', title); $('#newsModalLabel').text(title); $('#modal-description').text(description); $('#modal-image').attr('src', image); $('#modal-date').text(date); $('#modal-url').attr('href', url); // loadLike(feed_id, userId); // likeCount(feed_id, userId); checkCollection(feed_id, userId) var modal = new bootstrap.Modal($('#newsModal')[0]); modal.show(); }); $('.likeButton').on('click', function() { var feed_id = $('#dataModal').attr('data-id'); toggleLike(feed_id, userId); }); $('.copyButton').on('click', function() { var feed_url = $('#modal-url').attr('href'); // var feed_url = $('.news-item').data('url'); copyToClipboard(feed_url); // Call the correct function with the correct variable // copyToClipboards(feed_url); }); $('#bookmarkIcon').on('click', function() { var feed_id = $('#dataModal').attr('data-id'); // Ensure this targets the correct item console.log(feed_id); // Check the current state of the icon if ($(this).hasClass('far fa-bookmark')) { addToCollection(feed_id, userId); } else { removeFromCollection(feed_id, userId); } }); }); function loadLike(feedId, userId) { $.ajax({ url: 'inc/handler.php', type: 'POST', contentType: 'application/json', // Specify that you're sending JSON data: JSON.stringify({ request: 'loadLike', userId: userId, feedId: feedId }), success: function(response) { if (response.status === "success") { console.log("Response:", response.response); // Access 'response' instead of 'data' if (response.response === true) { $('.likeButton #thumbsUp').removeClass('fa-regular').addClass('fa-solid'); // Change to solid thumbs up } else { $('.likeButton #thumbsUp').removeClass('fa-solid').addClass('fa-regular'); // Change to regular thumbs up } } else { console.error("Error message:", response.message); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("Error:", textStatus, errorThrown); } }); } function likeCount(feedId, userId) { $.ajax({ url: 'inc/handler.php', type: 'POST', contentType: 'application/json', // Specify that you're sending JSON data: JSON.stringify({ request: 'likeCount', userId: userId, feedId: feedId }), success: function(response) { if (response.status === "success") { console.log("Response:", response); // Access 'response' instead of 'data' $('.likeButton #likeCount').html(response.count || ''); // Change to solid thumbs up } else { console.error("Error message:", response.message); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("Error:", textStatus, errorThrown); } }); } function toggleLike(feedId, userId) { var thumbsUpIcon = $('.likeButton #thumbsUp'); var isLiked = thumbsUpIcon.hasClass('fa-solid'); // Determine the request type based on the current like status var requestType = isLiked ? 'unlike' : 'like'; // Make the AJAX call to like/unlike the post $.ajax({ url: 'inc/handler.php', type: 'POST', contentType: 'application/json', data: JSON.stringify({ request: requestType, userId: userId, feedId: feedId }), success: function(response) { if (response.status === "success") { // Toggle the icon based on the like status if (requestType === 'like') { thumbsUpIcon.removeClass('fa-regular').addClass('fa-solid'); } else { thumbsUpIcon.removeClass('fa-solid').addClass('fa-regular'); } likeCount(feedId, userId); } else { console.error("Error message:", response.message); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("Error:", textStatus, errorThrown); } }); } </script> <script> 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(); } } } </script> <script> function checkCollection(feedId, userId) { $.ajax({ url: 'inc/handler.php', type: 'POST', contentType: 'application/json', data: JSON.stringify({ request: 'checkColl', userId: userId, feedId: feedId }), success: function(response) { try { if (response.status === 'success') { if (response.count > 0) { // console.log(response.count); $('#bookmarkIcon').removeClass('far fa-bookmark').addClass('fas fa-bookmark'); } else { $('#bookmarkIcon').removeClass('fas fa-bookmark').addClass('far fa-bookmark'); } } else { console.error('Failed to check collection: ' + response.message); } } catch (e) { console.error('Parsing error:', e); // alert('An error occurred while processing your request.'); // User-friendly error message } }, error: function(xhr, status, error) { console.error('AJAX request failed: ' + error); alert('Failed to check collection. Please check your connection and try again.'); // User-friendly error message } }); } function addToCollection(feedId, userId) { $.ajax({ url: 'inc/handler.php', type: 'POST', contentType: 'application/json', data: JSON.stringify({ request: 'addColl', userId: userId, feedId: feedId }), success: function(response) { if (response.status === 'success') { console.log('Added to collection'); $('#bookmarkIcon').removeClass('far fa-bookmark').addClass('fas fa-bookmark'); } else { console.error('Failed to add to collection: ' + response.message); } }, error: function(xhr, status, error) { console.error('AJAX request failed: ' + error); } }); } function removeFromCollection(feedId, userId) { $.ajax({ url: 'inc/handler.php', type: 'POST', contentType: 'application/json', data: JSON.stringify({ request: 'removeColl', userId: userId, feedId: feedId }), success: function(response) { if (response.status === 'success') { console.log('Removed from collection'); $('#bookmarkIcon').removeClass('fas fa-bookmark').addClass('far fa-bookmark'); } else { console.error('Failed to remove from collection: ' + response.message); } }, error: function(xhr, status, error) { console.error('AJAX request failed: ' + error); } }); } </script> <script> var isPlaying = false; $(document).ready(function() { // Play button click handler $('.play-button').on('click', function() { var title = $('#dataModal').data('title'); var desc = $('#dataModal').data('description'); playAudio(title, desc, $(this)); }); // Function to play audio function playAudio(title, desc, button) { var audio = new Audio(); if (isPlaying) { console.log("Audio is already playing. Cannot start another instance."); return; } console.log("Starting audio playback..."); isPlaying = true; // Set flag to true to indicate audio playback has started // Ajax call to get audio file URL $.ajax({ url: 'texttovoice/processvoice.php', type: 'POST', data: { title: title, description: desc }, success: function(response) { audio.src = response; audio.play(); // Update button visibility button.hide(); button.siblings('.pause-button').show(); button.siblings('.stop-button').show(); // Pause button click handler button.siblings('.pause-button').on('click', function() { audio.pause(); $(this).hide(); $(this).siblings('.resume-button').show(); }); // Resume button click handler button.siblings('.resume-button').on('click', function() { audio.play(); $(this).hide(); $(this).siblings('.pause-button').show(); }); button.siblings('.stop-button').on('click', function() { audio.pause(); // Pause the audio (assuming this stops playback) audio.currentTime = 0; // Reset audio playback to the beginning button.siblings('.resume-button').hide(); // Hide resume button if shown button.siblings('.stop-button').hide(); button.siblings('.pause-button').hide(); button.show(); isPlaying = false; }); // Reset when audio ends audio.onended = function() { isPlaying = false; button.show(); button.siblings('.pause-button').hide(); button.siblings('.resume-button').hide(); button.siblings('.stop-button').hide(); }; }, error: function(xhr, status, error) { console.error("Error playing audio:", error); } }); } }); function broadcast(link) { if (isPlaying) { console.log("Audio is already playing. Cannot start another instance."); return; } console.log("Starting audio playback..."); isPlaying = true; // Set flag to true to indicate audio playback has started var braudio = new Audio(); console.log(link); braudio.src = link; braudio.play(); $('.broadcast-pause').show(); $('.broadcast-stop').show(); $('.broadcast-pause').on('click', function() { braudio.pause(); $('.broadcast-pause').hide(); $('.broadcast-resume').show(); }); $('.broadcast-resume').on('click', function() { braudio.play(); $('.broadcast-resume').hide(); $('.broadcast-pause').show(); }); $('.broadcast-stop').on('click', function() { braudio.pause(); braudio.currentTime = 0; $('.broadcast-pause').hide(); $('.broadcast-resume').hide(); $('.broadcast-stop').hide(); isPlaying = false; }); braudio.onended = function() { isPlaying = false; $('.broadcast-pause').hide(); $('.broadcast-resume').hide(); $('.broadcast-stop').hide(); }; } </script> <!-- <script> async function toggleLike(feedId, userId) { const thumbsUpIcon = document.getElementById(`thumbsUp${feedId}`); const likeCountElement = document.getElementById(`likeCount${feedId}`); const isLiked = thumbsUpIcon.classList.contains('liked'); const action = isLiked ? 'removeLike' : 'addLike'; const response = await fetch('handler.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams({ articleId: feedId, userId: userId, action: action }) }); if (response.ok) { const data = await response.json(); console.log("hellowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww") if (data.status === 'success') { thumbsUpIcon.classList.toggle('liked', !isLiked); likeCountElement.textContent = data.newLikeCount; // Update like count } else { console.error(data.message); } } else { console.error('Failed to update like status.'); } } </script> --> <!-- <script> function addLike(articleId, callback) { $.ajax({ url: 'thumbsUp/handler.php', type: 'POST', data: { action: 'addLike', articleId: articleId, userId: <?= $gUserId ?> }, success: function(response) { if (response === "Ok") { callback(true); } else { console.log("Failed to add like: " + response); callback(false); } }, error: function(xhr, status, error) { console.error('AJAX request failed: ' + error); callback(false); } }); } function removeLike(articleId, callback) { $.ajax({ url: 'thumbsUp/handler.php', type: 'POST', data: { action: 'removeLike', articleId: articleId, userId: <?= $gUserId ?> }, success: function(response) { if (response === "Ok") { callback(true); } else { console.log("Failed to remove like: " + response); callback(false); } }, error: function(xhr, status, error) { console.error('AJAX request failed: ' + error); callback(false); } }); } $(document).ready(function() { // Select all elements with the class 'likeButtonContainer' $('.likeButtonContainer').each(function() { var likeCount = parseInt($(this).find('#likeCount').html(), 10); if (likeCount === 0) { $(this).find('#likeCount').html(''); } }); }); $(document).on('click', '.likeButton', function() { // Preserve the original context var article_data = $(this).closest(".panelFeed").find('#attr-article'); var $this = $(this); var likeStatus = $this.find('#thumbsUp'); // var articleId = $this.parents().eq(1).attr('class').data('article'); var articleId = article_data.data('article_id'); var likeCountHtml = $this.find('#likeCount').html(); var likeCount = likeCountHtml == '' ? 0 : parseInt(likeCountHtml, 10); console.log("count before: " + likeCount); if (likeStatus.hasClass("fa-solid fa-thumbs-up") && (likeCount > 0)) { removeLike(articleId, function(success) { if (success) { likeStatus.removeClass("fa-solid fa-thumbs-up").addClass("fa-regular fa-thumbs-up"); likeCount -= 1; if (likeCount === 0) { likeCount = ''; } $this.find('#likeCount').html(likeCount); } }); } else if (likeStatus.hasClass("fa-regular fa-thumbs-up")) { addLike(articleId, function(success) { if (success) { likeStatus.removeClass("fa-regular fa-thumbs-up").addClass("fa-solid fa-thumbs-up"); likeCount += 1; $this.find('#likeCount').html(likeCount); console.log("count: " + likeCount); } }); } }); </script> --> </body> </html>